From 26ae337be11e440420d8ec7ce415425daaabe573 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Thu, 4 Aug 2011 16:09:11 +0530 Subject: revert: Introduce --reset to remove sequencer state To explicitly remove the sequencer state for a fresh cherry-pick or revert invocation, introduce a new subcommand called "--reset" to remove the sequencer state. Take the opportunity to publicly expose the sequencer paths, and a generic function called "remove_sequencer_state" that various git programs can use to remove the sequencer state in a uniform manner; "git reset" uses it later in this series. Introducing this public API is also in line with our long-term goal of eventually factoring out functions from revert.c into a generic commit sequencer. Signed-off-by: Ramkumar Ramachandra Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-revert.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation/git-revert.txt') diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt index ac10cfbb14..783ffb4a68 100644 --- a/Documentation/git-revert.txt +++ b/Documentation/git-revert.txt @@ -8,6 +8,7 @@ git-revert - Revert some existing commits SYNOPSIS -------- 'git revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] ... +'git revert' --reset DESCRIPTION ----------- @@ -90,6 +91,10 @@ effect to your index in a row. Pass the merge strategy-specific option through to the merge strategy. See linkgit:git-merge[1] for details. +SEQUENCER SUBCOMMANDS +--------------------- +include::sequencer.txt[] + EXAMPLES -------- git revert HEAD~3:: -- cgit v1.2.3 From 5a5d80f4ca16fdb1f2577474ad94135839853a3e Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Thu, 4 Aug 2011 16:09:15 +0530 Subject: revert: Introduce --continue to continue the operation Introduce a new "git cherry-pick --continue" command which uses the information in ".git/sequencer" to continue a cherry-pick that stopped because of a conflict or other error. It works by dropping the first instruction from .git/sequencer/todo and performing the remaining cherry-picks listed there, with options (think "-s" and "-X") from the initial command listed in ".git/sequencer/opts". So now you can do: $ git cherry-pick -Xpatience foo..bar ... description conflict in commit moo ... $ git cherry-pick --continue error: 'cherry-pick' is not possible because you have unmerged files. fatal: failed to resume cherry-pick $ echo resolved >conflictingfile $ git add conflictingfile && git commit $ git cherry-pick --continue; # resumes with the commit after "moo" During the "git commit" stage, CHERRY_PICK_HEAD will aid by providing the commit message from the conflicting "moo" commit. Note that the cherry-pick mechanism has no control at this stage, so the user is free to violate anything that was specified during the first cherry-pick invocation. For example, if "-x" was specified during the first cherry-pick invocation, the user is free to edit out the message during commit time. Note that the "--signoff" option specified at cherry-pick invocation time is not reflected in the commit message provided by CHERRY_PICK_HEAD; the user must take care to add "--signoff" during the "git commit" invocation. Helped-by: Christian Couder Signed-off-by: Ramkumar Ramachandra Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-revert.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation/git-revert.txt') diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt index 783ffb4a68..9be2fe2b2f 100644 --- a/Documentation/git-revert.txt +++ b/Documentation/git-revert.txt @@ -9,6 +9,7 @@ SYNOPSIS -------- 'git revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] ... 'git revert' --reset +'git revert' --continue DESCRIPTION ----------- -- cgit v1.2.3