summaryrefslogtreecommitdiff
path: root/builtin/rerere.c
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2011-02-16 10:47:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-02-16 21:20:50 (GMT)
commitac49f5ca84d82e5b10bc1eb022dfdd9b0e8f7749 (patch)
tree418f03c9befc275a222889dde09610b5e9440cc2 /builtin/rerere.c
parent685e9d9145a186a4b2036ecf2be73cc86d99a9b7 (diff)
downloadgit-ac49f5ca84d82e5b10bc1eb022dfdd9b0e8f7749.zip
git-ac49f5ca84d82e5b10bc1eb022dfdd9b0e8f7749.tar.gz
git-ac49f5ca84d82e5b10bc1eb022dfdd9b0e8f7749.tar.bz2
rerere "remaining"
After "rerere" resolves conflicts by reusing old resolution, there would be three kinds of paths with conflict in the index: * paths that have been resolved in the working tree by rerere; * paths that need further work whose resolution could be recorded; * paths that need resolving that rerere won't help. When the user wants a list of paths that need hand-resolving, output from "rerere status" does not help, as it shows only the second category, but the paths in the third category still needs work (rerere only makes sense for regular files that have both our side and their side, and does not help other kinds of conflicts, e.g. "we modified, they deleted"). The new subcommand "rerere remaining" can be used to show both. As opposed to "rerere status", this subcommand also skips printing paths that have been added to the index, since these paths are already resolved and are no longer "remaining". Initial patch provided by Junio. Refactored and modified to skip resolved paths by Martin. Commit message mostly by Junio. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rerere.c')
-rw-r--r--builtin/rerere.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 642bf35..67cbfeb 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -8,7 +8,7 @@
#include "xdiff-interface.h"
static const char * const rerere_usage[] = {
- "git rerere [clear | status | diff | gc]",
+ "git rerere [clear | status | remaining | diff | gc]",
NULL,
};
@@ -156,7 +156,17 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
else if (!strcmp(argv[0], "status"))
for (i = 0; i < merge_rr.nr; i++)
printf("%s\n", merge_rr.items[i].string);
- else if (!strcmp(argv[0], "diff"))
+ else if (!strcmp(argv[0], "remaining")) {
+ rerere_remaining(&merge_rr);
+ for (i = 0; i < merge_rr.nr; i++) {
+ if (merge_rr.items[i].util != RERERE_RESOLVED)
+ printf("%s\n", merge_rr.items[i].string);
+ else
+ /* prepare for later call to
+ * string_list_clear() */
+ merge_rr.items[i].util = NULL;
+ }
+ } else if (!strcmp(argv[0], "diff"))
for (i = 0; i < merge_rr.nr; i++) {
const char *path = merge_rr.items[i].string;
const char *name = (const char *)merge_rr.items[i].util;