Skip to content

Commit

Permalink
support for merge related options in config tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 2, 2024
1 parent 4b1764c commit 80e006b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gix/src/config/tree/sections/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ mod renames {
}
}

mod validate {
pub(super) mod validate {
use crate::{
bstr::BStr,
config::tree::{keys, Diff},
Expand Down
16 changes: 15 additions & 1 deletion gix/src/config/tree/sections/merge.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
use crate::config;
use crate::config::tree::SubSectionRequirement;
use crate::config::{
tree::{keys, Key, Merge, Section},
tree::{diff, keys, Key, Merge, Section},
Tree,
};

impl Merge {
/// The `merge.renameLimit` key.
pub const RENAME_LIMIT: keys::UnsignedInteger = keys::UnsignedInteger::new_unsigned_integer(
"renameLimit",
&config::Tree::MERGE,
)
.with_note(
"The limit is actually squared, so 1000 stands for up to 1 million diffs if fuzzy rename tracking is enabled",
);
/// The `merge.renames` key.
pub const RENAMES: diff::Renames = diff::Renames::new_renames("renames", &config::Tree::MERGE);
/// The `merge.renormalize` key
pub const RENORMALIZE: keys::Boolean = keys::Boolean::new_boolean("renormalize", &Tree::MERGE);
/// The `merge.default` key
Expand All @@ -32,11 +42,15 @@ impl Section for Merge {

fn keys(&self) -> &[&dyn Key] {
&[
&Self::RENAME_LIMIT,
&Self::RENAMES,
&Self::RENORMALIZE,
&Self::DEFAULT,
&Self::DRIVER_NAME,
&Self::DRIVER_COMMAND,
&Self::DRIVER_RECURSIVE,
#[cfg(feature = "blob-merge")]
&Self::CONFLICT_STYLE,
]
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/plumbing/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Display for Usage {
}
InUse(deviation) => {
if !deviation.is_empty() {
write!(f, "❗️❗️❗️{deviation}")?;
write!(f, "❗️{deviation}")?;
}
}
}
Expand Down Expand Up @@ -411,12 +411,12 @@ static GIT_CONFIG: &[Record] = &[
usage: Planned("Required for big monorepos, and typically used in conjunction with sparse indices")
},
Record {
config: "merge.renameLimit",
usage: Planned("The same as 'diff.renameLimit'")
config: "merge.directoryRenames",
usage: NotPlanned("On demand")
},
Record {
config: "merge.renames",
usage: Planned("The same as 'diff.renames'")
config: "merge.verbosity",
usage: NotApplicable("Only useful for Git CLI")
},
Record {
config: "status.renameLimit",
Expand All @@ -431,7 +431,7 @@ static GIT_CONFIG: &[Record] = &[
usage: Planned("Currently we are likely to expose passwords in errors or in other places, and it's better to by default not do that")
},
Record {
config: "diff.*.cachetextconv",
config: "diff.*.cacheTextConv",
usage: NotPlanned("It seems to slow to do that, and persisting results to save a relatively cheap computation doesn't seem right")
},
];
Expand Down

0 comments on commit 80e006b

Please sign in to comment.