diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-14 16:05:22 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-14 16:05:22 -0700 |
commit | ab4665f8b2e5361726e52b0bb042540ab13b7c48 (patch) | |
tree | 170cfaaca6e6de1963e2dc50493992ee343d1dec /lib | |
parent | 3f038f24daabf38358902dafdddeb168130483ce (diff) | |
download | dotfiles-ab4665f8b2e5361726e52b0bb042540ab13b7c48.tar.gz |
run all the git logs before interacting with the user
Diffstat (limited to 'lib')
-rw-r--r-- | lib/perl5/Local/MrRepo/Repo/Git/Annex.pm | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm index 7268bc97..f613eabf 100644 --- a/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm +++ b/lib/perl5/Local/MrRepo/Repo/Git/Annex.pm @@ -93,6 +93,25 @@ sub review_unused { } foreach my $unused_file (@unused_files) { + # We need the RUN here to avoid special postprocessing but + # also to get the -c option passed -- unclear how to pass + # short options to git itself, not the 'log' subcommand, + # with Git::Wrapper except by using RUN (passing long + # options to git itself is easy, per Git::Wrapper docs) + @{ $unused_file->{log_lines} } = map { s/^/ /r } $self->git->RUN( + "-c", + "diff.renameLimit=3000", + "log", + { + stat => 1, + no_textconv => 1 + }, + "--color=always", + "-S", + $unused_file->{key}); + } + + foreach my $unused_file (@unused_files) { system('clear', '-x') if $opts{interactive}; say_bold("unused file #" . $unused_file->{number} . ":"); @@ -119,23 +138,7 @@ sub review_unused { say " looks like stale tmp or bad file, with key " . $unused_file->{key}; } else { - # We need the RUN here to avoid special postprocessing but - # also to get the -c option passed -- unclear how to pass - # short options to git itself, not the 'log' subcommand, - # with Git::Wrapper except by using RUN (passing long - # options to git itself is easy, per Git::Wrapper docs) - my @log_lines = map { s/^/ /r } $self->git->RUN( - "-c", - "diff.renameLimit=3000", - "log", - { - stat => 1, - no_textconv => 1 - }, - "--color=always", - "-S", - $unused_file->{key}); - + my @log_lines = @{ $unused_file->{log_lines} }; if ($opts{interactive}) { # truncate log output if necessary to ensure user's # terminal does not scroll |