author | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Oct 2011 19:36:19 +0000 (12:36 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Oct 2011 19:36:19 +0000 (12:36 -0700) |
* rr/revert-cherry-pick-continue:
builtin/revert.c: make commit_list_append() static
revert: Propagate errors upwards from do_pick_commit
revert: Introduce --continue to continue the operation
revert: Don't implicitly stomp pending sequencer operation
revert: Remove sequencer state when no commits are pending
reset: Make reset remove the sequencer state
revert: Introduce --reset to remove sequencer state
revert: Make pick_commits functionally act on a commit list
revert: Save command-line options for continuing operation
revert: Save data for continuing after conflict resolution
revert: Don't create invalid replay_opts in parse_args
revert: Separate cmdline parsing from functional code
revert: Introduce struct to keep command-line options
revert: Eliminate global "commit" variable
revert: Rename no_replay to record_origin
revert: Don't check lone argument in get_encoding
revert: Simplify and inline add_message_to_msg
config: Introduce functions to write non-standard file
advice: Introduce error_resolve_conflict
builtin/revert.c: make commit_list_append() static
revert: Propagate errors upwards from do_pick_commit
revert: Introduce --continue to continue the operation
revert: Don't implicitly stomp pending sequencer operation
revert: Remove sequencer state when no commits are pending
reset: Make reset remove the sequencer state
revert: Introduce --reset to remove sequencer state
revert: Make pick_commits functionally act on a commit list
revert: Save command-line options for continuing operation
revert: Save data for continuing after conflict resolution
revert: Don't create invalid replay_opts in parse_args
revert: Separate cmdline parsing from functional code
revert: Introduce struct to keep command-line options
revert: Eliminate global "commit" variable
revert: Rename no_replay to record_origin
revert: Don't check lone argument in get_encoding
revert: Simplify and inline add_message_to_msg
config: Introduce functions to write non-standard file
advice: Introduce error_resolve_conflict
1 | 2 | |||
---|---|---|---|---|
Documentation/git-cherry-pick.txt | patch | | diff1 | | diff2 | | blob | history |
Documentation/git-revert.txt | patch | | diff1 | | diff2 | | blob | history |
Makefile | patch | | diff1 | | diff2 | | blob | history |
branch.c | patch | | diff1 | | diff2 | | blob | history |
builtin/revert.c | patch | | diff1 | | diff2 | | blob | history |
cache.h | patch | | diff1 | | diff2 | | blob | history |
config.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/git-cherry-pick.txt
index 7cfa3d92ac8dc7a90068311c0047c667f98515a8,663186bda747ce02af4b5ca1732254a0e2425369..2660a842fc2ac76660963bc65c95ca47cb0e97cb
SYNOPSIS
--------
+[verse]
'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...
+ 'git cherry-pick' --reset
+ 'git cherry-pick' --continue
DESCRIPTION
-----------
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 cherry-pick master::
+`git cherry-pick master`::
Apply the change introduced by the commit at the tip of the
master branch and create a new commit with this change.
diff --cc Documentation/git-revert.txt
index b311d59c7c06dd696e3c667c97a5982137bdd87a,9be2fe2b2fe8a00941490e476f672280ae6eccd5..f3519413e7e8704deee0197df6876eaed97e28b0
SYNOPSIS
--------
+[verse]
'git revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] <commit>...
+ 'git revert' --reset
+ 'git revert' --continue
DESCRIPTION
-----------
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::
+`git revert HEAD~3`::
Revert the changes specified by the fourth last commit in HEAD
and create a new commit with the reverted changes.
diff --cc Makefile
Simple merge
diff --cc branch.c
Simple merge
diff --cc builtin/revert.c
index 3117776c2c030bec03563f043c4dc8bb34eb17cd,8409f4c886aeb23b4d0d5d000661eb3e2c278558..ba27cf15ee5478981a0a9a53493f41b67fcf9440
--- 1/builtin/revert.c
--- 2/builtin/revert.c
+++ b/builtin/revert.c
static struct tree *empty_tree(void)
{
- struct tree *tree = xcalloc(1, sizeof(struct tree));
-
- tree->object.parsed = 1;
- tree->object.type = OBJ_TREE;
- pretend_sha1_file(NULL, 0, OBJ_TREE, tree->object.sha1);
- return tree;
+ return lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN);
}
- static NORETURN void die_dirty_index(const char *me)
+ static int error_dirty_index(struct replay_opts *opts)
{
- if (read_cache_unmerged()) {
- die_resolve_conflict(me);
- } else {
- if (advice_commit_before_merge) {
- if (action == REVERT)
- die(_("Your local changes would be overwritten by revert.\n"
- "Please, commit your changes or stash them to proceed."));
- else
- die(_("Your local changes would be overwritten by cherry-pick.\n"
- "Please, commit your changes or stash them to proceed."));
- } else {
- if (action == REVERT)
- die(_("Your local changes would be overwritten by revert.\n"));
- else
- die(_("Your local changes would be overwritten by cherry-pick.\n"));
- }
- }
+ if (read_cache_unmerged())
+ return error_resolve_conflict(action_name(opts));
+
+ /* Different translation strings for cherry-pick and revert */
+ if (opts->action == CHERRY_PICK)
+ error(_("Your local changes would be overwritten by cherry-pick."));
+ else
+ error(_("Your local changes would be overwritten by revert."));
+
+ if (advice_commit_before_merge)
+ advise(_("Commit your changes or stash them to proceed."));
+ return -1;
}
static int fast_forward_to(const unsigned char *to, const unsigned char *from)
diff --cc cache.h
Simple merge
diff --cc config.c
Simple merge