History

feat: add support for multiple blame ranges like `gix blame -L <range> -L <other-range> ...`

Update the blame subcommand to handle multiple line ranges. This allows specifying multiple `-L` options similar to the usage of git.

Bart Dubbeldam committed 1 year ago

Commit 36a6ffe1 parent 8143d692 files · +4 −4Browse files

Unified · Split

2 files
  1. src/plumbing/main.rs +2 −2
  2. src/plumbing/options/mod.rs +2 −2
src/plumbing/main.rs+2−2
@@ -1560,7 +1560,7 @@ pub fn main() -> Result<()> { · 1559 unmodified lines
15601560 Subcommands::Blame {
15611561 statistics,
15621562 file,
1563− range,
1563+ ranges,
15641564 since,
15651565 } => prepare_and_run(
15661566 "blame",
@@ -1578,7 +1578,7 @@ pub fn main() -> Result<()> { · 11 unmodified lines
15781578 &file,
15791579 gix::blame::Options {
15801580 diff_algorithm,
1581− range: range.map(BlameRanges::from_range).unwrap_or_default(),
1581+ range: gix::blame::BlameRanges::from_ranges(ranges),
15821582 since,
15831583 },
15841584 out,
src/plumbing/options/mod.rs+2−2
@@ -168,8 +168,8 @@ pub enum Subcommands { · 167 unmodified lines
168168 /// The file to create the blame information for.
169169 file: std::ffi::OsString,
170170 /// Only blame lines in the given 1-based inclusive range '<start>,<end>', e.g. '20,40'.
171− #[clap(short='L', value_parser=AsRange)]
172− range: Option<std::ops::Range<u32>>,
171+ #[clap(short='L', value_parser=AsRange, action=clap::ArgAction::Append)]
172+ ranges: Vec<std::ops::Range<u32>>,
173173 /// Don't consider commits before the given date.
174174 #[clap(long, value_parser=AsTime, value_name = "DATE")]
175175 since: Option<gix::date::Time>,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t