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

Re: [PATCH v2] cherry-pick: don't forget -s on failure

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2012, 17:04 UTC
Message-ID
<7vd31pam6t.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120913073324.GA14383@suse.cz>
Miklos Vajna <vmiklos@suse.cz> writes:
Show 17 quoted lines
> In case 'git cherry-pick -s <commit>' failed, the user had to use 'git
> commit -s' (i.e. state the -s option again), which is easy to forget
> about.  Instead, write the signed-off-by line early, so plain 'git
> commit' will have the same result.
>
> Also update 'git commit -s', so that in case there is already a relevant
> Signed-off-by line before the Conflicts: line, it won't add one more at
> the end of the message.
>
> Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
> ---
>
> On Wed, Sep 12, 2012 at 03:45:10PM -0700, Junio C Hamano <gitster@pobox.com> wrote:
>>  - The additional S-o-b should come immediately after the existing
>>    block of footers.
>
> This was trivial to fix.

Indeed. Just inserting before starting to add "Oh, there were conflicts, and add the info on them" before doing it at the end is all it takes. Simple and straightforward---I like it.

Show 15 quoted lines
> --- a/t/test-lib-functions.sh
> +++ b/t/test-lib-functions.sh
> @@ -149,6 +149,12 @@ test_commit () {
>  		notick=yes
>  		shift
>  	fi &&
> +	signoff= &&
> +	if test "z$1" = "z--signoff"
> +	then
> +		signoff="$1"
> +		shift
> +	fi &&
>  	file=${2:-"$1.t"} &&
>  	echo "${3-$1}" > "$file" &&
>  	git add "$file" &&
This is somewhat iffy.  Shouldn't "test_commit --signoff --notick" work?
Show 8 quoted lines
> @@ -156,7 +162,7 @@ test_commit () {
>  	then
>  		test_tick
>  	fi &&
> -	git commit -m "$1" &&
> +	git commit $signoff -m "$1" &&
>  	git tag "$1"
>  }
Thanks.
Previous: Miklos VajnaNext: Junio C Hamano
Message 5 of 9 in “cherry-pick: don't forget -s on failure”
  1. cherry-pick: don't forget -s on failureMiklos Vajna, Sep 12, 2012
  2. Junio C HamanoSep 12, 2012
  3. Junio C HamanoSep 12, 2012
  4. cherry-pick: don't forget -s on failureMiklos Vajna, Sep 13, 2012
  5. Junio C HamanoSep 13, 2012
  6. Junio C HamanoSep 13, 2012
  7. cherry-pick: don't forget -s on failureMiklos Vajna, Sep 13, 2012
  8. Junio C HamanoSep 13, 2012
  9. cherry-pick: don't forget -s on failureMiklos Vajna, Sep 14, 2012

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.