diff options
| author | Johannes Sixt <j6t@kdbg.org> | 2025-03-23 22:34:11 +0100 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2025-05-23 17:03:30 -0400 |
| commit | 79a3ef53143f75450a828f4bc4e9dd3d4f2bb5ba (patch) | |
| tree | 58261b447a03f4829cb21b6f79680c68fa3a255b /gitk | |
| parent | 2aeb4484a046a545fb540ba07397b25b13fe6881 (diff) | |
| download | git-79a3ef53143f75450a828f4bc4e9dd3d4f2bb5ba.tar.gz | |
gitk: collect construction of blameargs into a single conditional
The command line to invoke 'git blame' for a single line is constructed
using several if-conditionals, each with the same condition
{$from_index new {}}. Merge all of them into a single conditional.
This requires to duplicate significant parts of the command, but it
helps the next change, where we will have to deal with a nested list
structure.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'gitk')
| -rwxr-xr-x | gitk | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -3967,17 +3967,15 @@ proc show_line_source {} { } set line [lindex $h 1] } - set blameargs {} + set blamefile [file join $cdup $flist_menu_file] if {$from_index ne {}} { - lappend blameargs | git cat-file blob $from_index - } - lappend blameargs | git blame -p -L$line,+1 - if {$from_index ne {}} { - lappend blameargs --contents - + set blameargs [list \ + | git cat-file blob $from_index \ + | git blame -p -L$line,+1 --contents - -- $blamefile] } else { - lappend blameargs $id + set blameargs [list \ + | git blame -p -L$line,+1 $id -- $blamefile] } - lappend blameargs -- [file join $cdup $flist_menu_file] if {[catch { set f [open $blameargs r] } err]} { |
