git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/8] revert: change help_msg() to take no argument

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 1, 2010, 05:08 UTC
Message-ID
<20100601050815.GB22441@progeny.tock>
In-Reply-To
<20100531194240.28729.49459.chriscool@tuxfamily.org>
Christian Couder wrote:
Show 19 quoted lines
> +++ b/builtin/revert.c
> @@ -239,7 +239,7 @@ static void set_author_ident_env(const char *message)
>  			sha1_to_hex(commit->object.sha1));
>  }
>  
> -static char *help_msg(const char *name)
> +static char *help_msg(void)
>  {
>  	struct strbuf helpbuf = STRBUF_INIT;
>  	char *msg = getenv("GIT_CHERRY_PICK_HELP");
> @@ -255,7 +255,7 @@ static char *help_msg(const char *name)
>  		strbuf_addf(&helpbuf, " with: \n"
>  			"\n"
>  			"        git commit -c %s\n",
> -			name);
> +			    sha1_to_hex(commit->object.sha1));
>  	}
>  	else
>  		strbuf_addch(&helpbuf, '.');
producing a message like
  Automatic cherry-pick failed.
    After resolving the conflicts,
  mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
  and commit the result with: 
  	git commit -c 8a7cdf

Is there any reason not to suggest ‘git commit’ without the -c? This way, the template message includes a helpful Conflicts: string, too.

---
 builtin/revert.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index f0d78e5..bbafc41 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -254,8 +254,7 @@ static char *help_msg(void)
 	if (action == CHERRY_PICK) {
 		strbuf_addf(&helpbuf, " with: \n"
 			"\n"
-			"        git commit -c %s\n",
-			    sha1_to_hex(commit->object.sha1));
+			"        git commit\n");
 	}
 	else
 		strbuf_addch(&helpbuf, '.');
-- 
1.7.1
Previous: Christian CouderNext: Jeff King
Message 8 of 30 in “implement cherry-picking many commits”
  1. 0/8 implement cherry-picking many commitsChristian Couder, May 31, 2010
  2. 1/8 revert: cleanup code for -x optionChristian Couder, May 31, 2010
  3. 2/8 revert: use run_command_v_opt() instead of execv_git_cmd()Christian Couder, May 31, 2010
  4. Jonathan NiederJun 1, 2010
  5. Christian CouderJun 1, 2010
  6. 3/8 revert: refactor code into a do_pick_commit() functionChristian Couder, May 31, 2010
  7. 4/8 revert: change help_msg() to take no argumentChristian Couder, May 31, 2010
  8. Jonathan NiederJun 1, 2010
  9. Jeff KingJun 1, 2010
  10. Jonathan NiederJun 1, 2010
  11. 5/8 revert: allow cherry-picking more than one commitChristian Couder, May 31, 2010
  12. Sverre RabbelierJun 1, 2010
  13. Jonathan NiederJun 1, 2010
  14. Junio C HamanoJun 2, 2010
  15. Christian CouderJun 3, 2010
  16. Jonathan NiederJun 1, 2010
  17. Christian CouderJun 2, 2010
  18. 6/8 revert: add tests to check cherry-picking many commitsChristian Couder, May 31, 2010
  19. 7/8 Documentation/cherry-pick: describe passing more than one commitChristian Couder, May 31, 2010
  20. Ramkumar RamachandraJun 1, 2010
  21. Christian CouderJun 2, 2010
  22. Jonathan NiederJun 1, 2010
  23. Ramkumar RamachandraJun 1, 2010
  24. Christian CouderJun 2, 2010
  25. Christian CouderJun 2, 2010
  26. Jonathan NiederJun 2, 2010
  27. Christian CouderJun 14, 2010
  28. 8/8 Documentation/revert: describe passing more than one commitChristian Couder, May 31, 2010
  29. Antriksh PanyJun 1, 2010
  30. Christian CouderJun 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.