login
Header Space

 
 

Re: Rebase/cherry-picking idea

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Sixt <j.sixt@...>
Cc: Benoit Sigoure <tsuna@...>, Git Mailing List <git@...>
Date: Monday, November 26, 2007 - 9:15 am

El 26/11/2007, a las 13:51, Johannes Sixt escribió:


Good idea, quite a bit less cruddy:

diff --git a/builtin-revert.c b/builtin-revert.c
index a0586f9..5a57574 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -229,7 +229,7 @@ static int revert_or_cherry_pick(int argc, const  
char **argv)
  	unsigned char head[20];
  	struct commit *base, *next, *parent;
  	int i;
-	char *oneline, *reencoded_message = NULL;
+	char *oneline, *reencoded_message = NULL, *help_message;
  	const char *message, *encoding;
  	const char *defmsg = xstrdup(git_path("MERGE_MSG"));

@@ -352,11 +352,13 @@ 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);
+		help_message = getenv("_GIT_CHERRY_PICK_HELP");
  		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,
+			help_message ? help_message : "commit the result");
+		if (action == CHERRY_PICK && !help_message) {
  			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..e5f9810 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -117,6 +117,7 @@ pick_one () {
  		sha1=$(git rev-parse --short $sha1)
  		output warn Fast forward to $sha1
  	else
+		export _GIT_CHERRY_PICK_HELP="run 'git rebase --continue'"
  		output git cherry-pick "$@"
  	fi
  }
@@ -187,6 +188,7 @@ pick_one_preserving_merges () {
  			fi
  			;;
  		*)
+			export _GIT_CHERRY_PICK_HELP="run 'git rebase --continue'"
  			output git cherry-pick "$@" ||
  				die_with_patch $sha1 "Could not pick $sha1"
  			;;

-
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Rebase/cherry-picking idea, Wincent Colaiuta, (Mon Nov 26, 5:02 am)
Re: Rebase/cherry-picking idea, Benoit Sigoure, (Mon Nov 26, 5:32 am)
Re: Rebase/cherry-picking idea, Johannes Schindelin, (Mon Nov 26, 9:26 am)
Re: Rebase/cherry-picking idea, Wincent Colaiuta, (Mon Nov 26, 7:27 am)
Re: Rebase/cherry-picking idea, Wincent Colaiuta, (Mon Nov 26, 8:34 am)
Re: Rebase/cherry-picking idea, Johannes Sixt, (Mon Nov 26, 8:51 am)
Re: Rebase/cherry-picking idea, Junio C Hamano, (Mon Nov 26, 1:26 pm)
Re: Rebase/cherry-picking idea, Shawn O. Pearce, (Mon Nov 26, 9:08 pm)
Re: Rebase/cherry-picking idea, Junio C Hamano, (Mon Nov 26, 9:25 pm)
Re: Rebase/cherry-picking idea, Marco Costalba, (Mon Nov 26, 3:12 pm)
Re: Rebase/cherry-picking idea, Wincent Colaiuta, (Mon Nov 26, 9:15 am)
Re: Rebase/cherry-picking idea, Johannes Schindelin, (Mon Nov 26, 9:41 am)
Re: Rebase/cherry-picking idea, Wincent Colaiuta, (Mon Nov 26, 9:55 am)
Re: Rebase/cherry-picking idea, Junio C Hamano, (Wed Nov 28, 4:06 am)
Re: Rebase/cherry-picking idea, Wincent Colaiuta, (Wed Nov 28, 4:52 am)
Re: Rebase/cherry-picking idea, Junio C Hamano, (Wed Nov 28, 5:47 am)
Re: Rebase/cherry-picking idea, Wincent Colaiuta, (Wed Nov 28, 6:04 am)
Re: Rebase/cherry-picking idea, Junio C Hamano, (Wed Nov 28, 2:44 pm)
[PATCH] Replace instances of export VAR=VAL with VAR=VAL; ex..., Johannes Schindelin, (Wed Nov 28, 9:57 am)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Johannes Schindelin, (Wed Nov 28, 10:29 am)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Johannes Schindelin, (Wed Nov 28, 3:03 pm)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Johannes Schindelin, (Wed Nov 28, 7:08 pm)
[PATCH v2] Replace instances of export VAR=VAL with VAR=VAL;..., Johannes Schindelin, (Wed Nov 28, 11:56 am)
Re: [PATCH v2] Replace instances of export VAR=VAL with VAR=..., Johannes Schindelin, (Wed Nov 28, 7:05 pm)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Nguyen Thai Ngoc Duy, (Wed Nov 28, 10:19 am)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Johannes Schindelin, (Wed Nov 28, 10:27 am)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Nguyen Thai Ngoc Duy, (Wed Nov 28, 10:27 am)
Re: [PATCH] Replace instances of export VAR=VAL with VAR=VAL..., Johannes Schindelin, (Wed Nov 28, 10:36 am)
Re: Rebase/cherry-picking idea, Benoit Sigoure, (Mon Nov 26, 8:39 am)
speck-geostationary