summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4cfeccc)
raw | patch | inline | side by side (parent: 4cfeccc)
author | Eric Wong <normalperson@yhbt.net> | |
Fri, 8 Dec 2006 21:29:55 +0000 (13:29 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 9 Dec 2006 19:09:27 +0000 (11:09 -0800) |
git-am and git-rebase will be updated to use 'clear', and
diff/status can be used to aid the user in tracking progress in
the resolution process.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff/status can be used to aid the user in tracking progress in
the resolution process.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-rerere.txt | patch | blob | history | |
git-rerere.perl | patch | blob | history |
index 8b6b6512371fd67fbb56d06cf29e826d3ef69d56..22494b2b2e83c2f51178f74843488de6f31493ed 100644 (file)
SYNOPSIS
--------
-'git-rerere'
-
+'git-rerere' [clear|diff|status]
DESCRIPTION
-----------
`git-rerere` is run by `git rebase` to help you resolve this
conflict.
+COMMANDS
+--------
+
+Normally, git-rerere is run without arguments or user-intervention.
+However, it has several commands that allow it to interact with
+its working state.
+
+'clear'::
+
+This resets the metadata used by rerere if a merge resolution is to be
+is aborted. Calling gitlink:git-am[1] --skip or gitlink:git-rebase[1]
+[--skip|--abort] will automatcally invoke this command.
+
+'diff'::
+
+This displays diffs for the current state of the resolution. It is
+useful for tracking what has changed while the user is resolving
+conflicts. Additional arguments are passed directly to the system
+diff(1) command installed in PATH.
+
+'status'::
+
+Like diff, but this only prints the filenames that will be tracked
+for resolutions.
Author
------
diff --git a/git-rerere.perl b/git-rerere.perl
index d3664ff491fe73d8a6acf6e2c4da5806c5753ce1..b2550bb2ef8ec04c34ab6c3207de3e88f6b63608 100755 (executable)
--- a/git-rerere.perl
+++ b/git-rerere.perl
-d "$rr_dir" || exit(0);
read_rr();
+
+if (@ARGV) {
+ my $arg = shift @ARGV;
+ if ($arg eq 'clear') {
+ for my $path (keys %merge_rr) {
+ my $name = $merge_rr{$path};
+ if (-d "$rr_dir/$name" &&
+ ! -f "$rr_dir/$name/postimage") {
+ rmtree(["$rr_dir/$name"]);
+ }
+ }
+ unlink $merge_rr;
+ }
+ elsif ($arg eq 'status') {
+ for my $path (keys %merge_rr) {
+ print $path, "\n";
+ }
+ }
+ elsif ($arg eq 'diff') {
+ for my $path (keys %merge_rr) {
+ my $name = $merge_rr{$path};
+ system('diff', ((@ARGV == 0) ? ('-u') : @ARGV),
+ '-L', "a/$path", '-L', "b/$path",
+ "$rr_dir/$name/preimage", $path);
+ }
+ }
+ else {
+ die "$0 unknown command: $arg\n";
+ }
+ exit 0;
+}
+
my %conflict = map { $_ => 1 } find_conflict();
# MERGE_RR records paths with conflicts immediately after merge