Skip to content

Commit

Permalink
add more records (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 23, 2022
1 parent 65e6496 commit 5c0d0ab
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/plumbing/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ enum Usage {
name: &'static str,
deviation: Option<&'static str>,
},
/// Needs analysis
Puzzled,
}
use Usage::*;

impl Display for Usage {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Puzzled => f.write_str("❓")?,
NotApplicable => f.write_str("not applicable")?,
Planned { note } => {
write!(f, "{}", "planned".blink())?;
Expand All @@ -39,6 +42,7 @@ impl Display for Usage {
impl Usage {
pub fn icon(&self) -> &'static str {
match self {
Puzzled => "?",
NotApplicable => "❌",
Planned { .. } => "🕒",
InModule { deviation, .. } => deviation.is_some().then(|| "👌️").unwrap_or("✅"),
Expand All @@ -65,6 +69,48 @@ impl Tabled for Record {
}

static GIT_CONFIG: &[Record] = &[
Record {
config: "fetch.recurseSubmodules",
usage: Planned {
note: Some("Seems useful for cargo as well"),
},
},
Record {
config: "fetch.fsckObjects",
usage: Puzzled,
},
Record {
config: "fetch.fsck.<msg-id>",
usage: Puzzled,
},
Record {
config: "fetch.fsck.skipList",
usage: Puzzled,
},
Record {
config: "fetch.unpackLimit",
usage: Planned { note: None },
},
Record {
config: "fetch.prune",
usage: Planned { note: None },
},
Record {
config: "fetch.pruneTags",
usage: Planned { note: None },
},
Record {
config: "fetch.writeCommitGraph",
usage: Planned { note: None },
},
Record {
config: "fetch.parallel",
usage: Planned { note: None },
},
Record {
config: "fetch.showForcedUpdates",
usage: NotApplicable,
},
Record {
config: "fetch.output",
usage: NotApplicable,
Expand All @@ -82,6 +128,13 @@ static GIT_CONFIG: &[Record] = &[
deviation: Some("if unset, it uses all threads as opposed to just 1"),
},
},
Record {
config: "pack.indexVersion",
usage: InModule {
name: "remote::connection::fetch",
deviation: None,
},
},
];

/// A programmatic way to record and display progress.
Expand Down

0 comments on commit 5c0d0ab

Please sign in to comment.