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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Couder wrote:

> +++ 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]