El 26/11/2007, a las 12:27, Wincent Colaiuta escribió:How about something like this? It would obviously be nice if we could avoid adding another option to builtin-revert; perhaps when/if git- rebase becomes a builtin we can avoid that. The other alternative, and probably one I like I bit more, would be to auto-detect that a rebase is in progress by looking inside the GIT_DIR, although that would also alter the behaviour of manual invocations of git-revert and git-cherry- pick during an interactive rebase (do people actually do that?). What do you think? diff --git a/builtin-revert.c b/builtin-revert.c index a0586f9..36e36c3 100644 --- a/builtin-revert.c +++ b/builtin-revert.c @@ -30,7 +30,7 @@ static const char * const cherry_pick_usage[] = { NULL }; -static int edit, no_replay, no_commit, mainline; +static int edit, no_replay, no_commit, rebasing, mainline; static enum { REVERT, CHERRY_PICK } action; static struct commit *commit; @@ -50,6 +50,7 @@ static void parse_args(int argc, const char **argv) OPT_BOOLEAN('e', "edit", &edit, "edit the commit message"), OPT_BOOLEAN('x', NULL, &no_replay, "append commit name when cherry- picking"), OPT_BOOLEAN('r', NULL, &noop, "no-op (backward compatibility)"), + OPT_BOOLEAN(0, "rebasing", &rebasing, "use rebase mode"), OPT_INTEGER('m', "mainline", &mainline, "parent number"), OPT_END(), }; @@ -352,11 +353,16 @@ static int revert_or_cherry_pick(int argc, const char **argv) } if (close(msg_fd) || commit_lock_file(&msg_file) < 0) die ("Error wrapping up %s", defmsg); + if (rebasing) + message = "run 'git rebase --continue' " + "or 'git rebase --abort'"; + else + message = "commit the result"; fprintf(stderr, "Automatic %s failed. " "After resolving the conflicts,\n" "mark the corrected paths with 'git add <paths>' " - "and commit the result.\n", me); - if (action == CHERRY_PICK) { + "and %s.\n", me, message); + if (action == CHERRY_PICK && !rebasing) { fprintf(stderr, "When commiting, use the option " "'-c %s' to retain authorship and message.\n", find_unique_abbrev(commit->object.sha1, diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index bf44b6a..5afb843 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -117,7 +117,7 @@ pick_one () { sha1=$(git rev-parse --short $sha1) output warn Fast forward to $sha1 else - output git cherry-pick "$@" + output git cherry-pick --rebasing "$@" fi } @@ -187,7 +187,7 @@ pick_one_preserving_merges () { fi ;; *) - output git cherry-pick "$@" || + output git cherry-pick --rebasing "$@" || die_with_patch $sha1 "Could not pick $sha1" ;; esac - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| David Woodhouse | Re: [GIT *] Allow request_firmware() to be satisfied from in-kernel, use it in mor... |
| Stefan Richter | Re: 2.6.22 -mm merge plans |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Dave Hansen | Re: [RFC/PATCH] Documentation of kernel messages |
git: | |
| Johannes Schindelin | Re: git on MacOSX and files with decomposed utf-8 file names |
| Martin Waitz | comparing file contents in is_exact_match? |
| Jon Smirl | Change set based shallow clone |
| Andreas Hildebrandt | CVS-$Id:$ replacement in git? |
| Jon Morby | IPv6 and OpenBGPD - Protocol not available |
| Alex Thurlow | Router performance on OpenBSD and OpenBGPD |
| Denis Doroshenko | Re: This is what Linus Torvalds calls openBSD crowd |
| Edd Barrett | Re: OpenBSD in the webcomic XKCD |
| Linux Kernel Mailing List | ssb: Fix watchdog access for devices without a chipcommon |
| Linux Kernel Mailing List | USB Serial Sierra: clean-up |
| Linux Kernel Mailing List | [ALSA] hda - Fix ALC262 fujitsu model |
| Linux Kernel Mailing List | USB Serial Sierra: Dynamic interface detection |
