[PATCH 2/5] status: show files that would have resolutions recorded by rerere
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-commit.sh | 17 ++++++++++++++++-
git-rerere.perl | 18 ++++++++++++------
2 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/git-commit.sh b/git-commit.sh
index 81c3a0c..9f6d1ef 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -48,7 +48,22 @@ run_status () {
GIT_INDEX_FILE="$NEXT_INDEX"
export GIT_INDEX_FILE
fi
-
+ if test -d "$GIT_DIR/rr-cache"
+ then
+ rr_shown=
+ git-rerere status | while read line; do
+ if [ -z "$rr_shown" ]; then
+ echo '#'
+ echo '# Resolutions to be recorded for files:'
+ echo '# (git-rerere will automatically record' \
+ 'conflict resolutions'
+ echo '# when these files are committed)'
+ echo '#'
+ rr_shown=1
+ fi
+ echo "# $line"
+ done
+ fi
case "$status_only" in
t) color= ;;
*) color=--nocolor ;;
diff --git a/git-rerere.perl b/git-rerere.perl
index dd86577..b78194a 100755
--- a/git-rerere.perl
+++ b/git-rerere.perl
@@ -173,14 +173,20 @@ sub merge {
read_rr();
-if (@ARGV && $ARGV[0] eq 'clear') {
- for my $path (keys %merge_rr) {
- my $name = $merge_rr{$path};
- if (-d "$rr_dir/$name") {
- rmtree(["$rr_dir/$name"]);
+if (my $arg = shift @ARGV) {
+ if ($arg eq 'clear') {
+ for my $path (keys %merge_rr) {
+ my $name = $merge_rr{$path};
+ if (-d "$rr_dir/$name") {
+ rmtree(["$rr_dir/$name"]);
+ }
+ }
+ unlink $merge_rr;
+ } elsif ($arg eq 'status') {
+ for my $path (keys %merge_rr) {
+ print $path, "\n";
}
}
- unlink $merge_rr;
exit 0;
}
--
1.4.4.2.g860f4