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

Re: [PATCH] cherry-pick -x: add newline before pick note

From
Oswald Buddenhagen <ossi@kde.org>
Date
Mar 8, 2011, 12:54 UTC
Message-ID
<loom.20110308T134920-72@post.gmane.org>
In-Reply-To
<d0318dcd2b52f2e818888003e3dd81c7b713fec6.1289920242.git.git@drmicha.warpmail.net>
Michael J Gruber <git <at> drmicha.warpmail.net> writes:
Show 27 quoted lines
> Currently, cherry-pick -x sticks the pick note immediately after the
> existing commit message. This
> 
> * is bad for commits with 1 line subject (it makes a 2 line subject)
> * is different from git-svn, e.g., which leaves an empty line before.
> 
> Make cherry-pick always insert an empty line before the pick note.
> 
> Reported-by: Martin Svensson <martin.k.svensson <at> netinsight.se>
> Signed-off-by: Michael J Gruber <git <at> drmicha.warpmail.net>
> ---
>  builtin/revert.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin/revert.c b/builtin/revert.c
> index 57b51e4..9251257 100644
> --- a/builtin/revert.c
> +++ b/builtin/revert.c
> @@ -485,7 +485,7 @@ static int do_pick_commit(void)
>  		set_author_ident_env(msg.message);
>  		add_message_to_msg(&msgbuf, msg.message);
>  		if (no_replay) {
> -			strbuf_addstr(&msgbuf, "(cherry picked from commit ");
> +			strbuf_addstr(&msgbuf, "\n(cherry picked from commit ");
>  			strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));
>  			strbuf_addstr(&msgbuf, ")\n");
>  		}

so while everybody is apparently thinking about totally over-engineering things as much as possible, could we please have this patch applied so we have a solution for the time being? i really hate to tell my coworkers that they have to amend the cherry-picks just to make them comply with git's own guidelines for well-formed commit messages (and thus have them pass our pre-receive hook).

regards
Previous: Jay SoffianNext: Jonathan Nieder
Message 10 of 13 in “cherry-pick -x: add newline before pick note”
  1. cherry-pick -x: add newline before pick noteMichael J Gruber, Nov 16, 2010
  2. Jeff KingNov 16, 2010
  3. commit -s: allow "(cherry picked " lines in sign-off sectionJonathan Nieder, Nov 16, 2010
  4. Jonathan NiederNov 16, 2010
  5. Junio C HamanoNov 16, 2010
  6. Jonathan NiederNov 16, 2010
  7. Junio C HamanoNov 17, 2010
  8. Jay SoffianNov 17, 2010
  9. Jay SoffianNov 17, 2010
  10. Oswald BuddenhagenMar 8, 2011
  11. Jonathan NiederMar 8, 2011
  12. Oswald BuddenhagenMar 8, 2011
  13. Jonathan NiederMar 8, 2011

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.