Skip to contentSkip to conversation

cherry-pick -x formats the message incorrectly

DISCUSSION Martin Svensson 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I have a problem with the commit message format for "cherry-pick -x":
Given a commit with the message:

foo

, i.e. with only a summary part, I do "git cherry-pick -x the_commit". The result is a new commit with message

foo
(cherry picked from commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886)

Now that's not good, because it is a two-line summary. In my opinion, the parentheses should _always_ end up in the detailed part.
It should be:

foo

(cherry picked from commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886)

Am I right?

/Martin Svensson, SW Developer

#1 lore raw
Quoted 9 lines · Martin Svensson

Now that's not good, because it is a two-line summary. In my opinion, the parentheses should _always_ end up in the detailed part.
It should be:

foo

(cherry picked from commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886)

Am I right?

I tend to agree (modulo s/summary/subject/ would be the wording I would have used).

This falls into "patches welcome" category, though. I do not think anybody sane is still using cherry-pick with -x option these days after
http://thread.gmane.org/gmane.comp.version-control.git/28378

#2 lore raw
Quoted 8 lines · Junio C Hamano
Quoted 6 lines · Martin Svensson

It should be:

foo

(cherry picked from commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886)

Quoted 8 lines
Quoted 1 line

Am I right?

I tend to agree (modulo s/summary/subject/ would be the wording I would have used).

This falls into "patches welcome" category, though. I do not think anybody sane is still using cherry-pick with -x option these days after
http://thread.gmane.org/gmane.comp.version-control.git/28378

Mm, I use it and do not agree; I think the rule should rather be:

- if there is a Signed-off chain, quietly integrate into that (no added newline)

- if there is not a Signed-off chain, add the extra newline.

Patch for a related issue in a few minutes.

#3 lore raw
Quoted 13 lines · Jonathan Nieder
Quoted 12 lines · Junio C Hamano
Quoted 7 lines · Martin Svensson

It should be:

foo

(cherry picked from commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886)

Am I right?

I tend to agree (modulo s/summary/subject/ would be the wording I would have used).

[...]

Quoted 6 lines

Mm, I use it and do not agree; I think the rule should rather be:

- if there is a Signed-off chain, quietly integrate into that (no added newline)

- if there is not a Signed-off chain, add the extra newline.

Hmm, probably it is obvious, but I sent this reply to the wrong message. Sorry for the nonsense.

Martin, I do agree with you and would be happy to see cherry-pick -x respecting the

One-line subject

Possibly multi-line, detailed description.

Signed-off-by chain

format.