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