git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/5] status: show files that would have resolutions recorded by rerere

From
EWEric Wong <normalperson@yhbt.net>
Date
Dec 8, 2006, 10:49 UTC
Message-ID
<11655749732181-git-send-email-normalperson@yhbt.net>
In-Reply-To
<20061205092126.GE27236@soma>
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
Previous: Eric WongNext: Eric Wong
Message 6 of 10 in “Re: [PATCH] git-explain”
  1. Eric WongDec 5, 2006
  2. 0/5 WIP status/rerere reportingEric Wong, Dec 8, 2006
  3. 1/5 rerere: avoid misrecording on a skipped or aborted rebase/amEric Wong, Dec 8, 2006
  4. Junio C HamanoDec 8, 2006
  5. 6/5 git-rerere: document the 'clear' and 'diff' commandsEric Wong, Dec 8, 2006
  6. 2/5 status: show files that would have resolutions recorded by rerereEric Wong, Dec 8, 2006
  7. 3/5 am and rebase resolve states get picked up by status/commitEric Wong, Dec 8, 2006
  8. 4/5 am: run git rerere to record resolution on successful --resolvedEric Wong, Dec 8, 2006
  9. 5/5 rerere: add the diff commandEric Wong, Dec 8, 2006
  10. Jakub NarebskiDec 8, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.