{"thread":{"id":"29663","subject":"[PATCH] cherry-pick -x: always insert an empty line","startedAt":"2012-02-18T21:14:50Z","lastAt":"2012-02-23T09:38:14Z","messageCount":5,"participants":["Beat Bolli","Junio C Hamano","Sebastian Schuberth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"184935","messageId":"1329599690-9152-1-git-send-email-bbolli@ewanet.ch","threadId":"29663","inReplyTo":null,"subject":"[PATCH] cherry-pick -x: always insert an empty line","fromName":"Beat Bolli","fromEmail":"bbolli@ewanet.ch","sentAt":"2012-02-18T21:14:50Z","receivedAt":"2012-02-18T21:14:50Z","isPatch":true,"sender":{"key":"bbolli@ewanet.ch","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"When cherry-picking a commit that has only a summary, the -x option\ncreates an invalid commit message because it puts the hash of the commit\nbeing picked on the second line which should be left empty.\n\nThis patch fixes this buglet by always inserting an empty line before\nthe added line.\n\nAside from that, even with a non-trivial commit the generated note\n\"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\"\nseems abrupt when appended directly.\n\nCc: Eric Raible <raible@nextest.com>\nSigned-off-by: Beat Bolli <bbolli@ewanet.ch>\n---\n sequencer.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 5fcbcb8..63fd589 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -382,7 +382,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \t\t}\n \n \t\tif (opts->record_origin) {\n-\t\t\tstrbuf_addstr(&msgbuf, \"(cherry picked from commit \");\n+\t\t\tstrbuf_addstr(&msgbuf, \"\\n(cherry picked from commit \");\n \t\t\tstrbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));\n \t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n \t\t}\n-- \n1.7.9\n"},{"id":"184944","messageId":"7vhaynp605.fsf@alter.siamese.dyndns.org","threadId":"29663","inReplyTo":"1329599690-9152-1-git-send-email-bbolli@ewanet.ch","subject":"Re: [PATCH] cherry-pick -x: always insert an empty line","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-19T08:44:10Z","receivedAt":"2012-02-19T08:44:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Beat Bolli <bbolli@ewanet.ch> writes:\n\n> When cherry-picking a commit that has only a summary, the -x option\n> creates an invalid commit message because it puts the hash of the commit\n> being picked on the second line which should be left empty.\n>\n> This patch fixes this buglet by always inserting an empty line before\n> the added line.\n>\n> Aside from that, even with a non-trivial commit the generated note\n> \"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\"\n> seems abrupt when appended directly.\n>\n> Cc: Eric Raible <raible@nextest.com>\n> Signed-off-by: Beat Bolli <bbolli@ewanet.ch>\n> ---\n>  sequencer.c |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/sequencer.c b/sequencer.c\n> index 5fcbcb8..63fd589 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -382,7 +382,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n>  \t\t}\n>  \n>  \t\tif (opts->record_origin) {\n> -\t\t\tstrbuf_addstr(&msgbuf, \"(cherry picked from commit \");\n> +\t\t\tstrbuf_addstr(&msgbuf, \"\\n(cherry picked from commit \");\n\nDoesn't this need to be conditional?\n\nIf we cherry pick your commit somewhere else with \"-x -s\", the resulting\ncommit log message would end like this:\n\n    Aside from that, even with a non-trivial commit the generated note\n    \"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\"\n    seems abrupt when appended directly.\n\n    Cc: Eric Raible <raible@nextest.com>\n    Signed-off-by: Beat Bolli <bbolli@ewanet.ch>\n\n    (cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\n    Signed-off-by: Frotz Xyzzy <nitfol@example.xz>\n\nwhich clearly is worse-looking with the extra LF you added in this patch.\n\n>  \t\t\tstrbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));\n>  \t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n>  \t\t}\n"},{"id":"185245","messageId":"4F45FB31.4000808@ewanet.ch","threadId":"29663","inReplyTo":"7vhaynp605.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] cherry-pick -x: always insert an empty line","fromName":"Beat Bolli","fromEmail":"bbolli@ewanet.ch","sentAt":"2012-02-23T08:39:13Z","receivedAt":"2012-02-23T08:39:13Z","isPatch":true,"sender":{"key":"bbolli@ewanet.ch","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 2012-02-19 09:44, Junio C Hamano wrote:\n> Beat Bolli <bbolli@ewanet.ch> writes:\n> \n>> When cherry-picking a commit that has only a summary, the -x option\n>> creates an invalid commit message because it puts the hash of the commit\n>> being picked on the second line which should be left empty.\n>>\n>> This patch fixes this buglet by always inserting an empty line before\n>> the added line.\n>>\n>> Aside from that, even with a non-trivial commit the generated note\n>> \"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\"\n>> seems abrupt when appended directly.\n>>\n>> Cc: Eric Raible <raible@nextest.com>\n>> Signed-off-by: Beat Bolli <bbolli@ewanet.ch>\n>> ---\n>>  sequencer.c |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/sequencer.c b/sequencer.c\n>> index 5fcbcb8..63fd589 100644\n>> --- a/sequencer.c\n>> +++ b/sequencer.c\n>> @@ -382,7 +382,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n>>  \t\t}\n>>  \n>>  \t\tif (opts->record_origin) {\n>> -\t\t\tstrbuf_addstr(&msgbuf, \"(cherry picked from commit \");\n>> +\t\t\tstrbuf_addstr(&msgbuf, \"\\n(cherry picked from commit \");\n> \n> Doesn't this need to be conditional?\n> \n> If we cherry pick your commit somewhere else with \"-x -s\", the resulting\n> commit log message would end like this:\n> \n>     Aside from that, even with a non-trivial commit the generated note\n>     \"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\"\n>     seems abrupt when appended directly.\n> \n>     Cc: Eric Raible <raible@nextest.com>\n>     Signed-off-by: Beat Bolli <bbolli@ewanet.ch>\n> \n>     (cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\n>     Signed-off-by: Frotz Xyzzy <nitfol@example.xz>\n> \n> which clearly is worse-looking with the extra LF you added in this patch.\n\nWhat should the condition then be? What is the canonical format for\ncherry-picks with Signed-off-by: and Cc: footer lines?\n\n> \n>>  \t\t\tstrbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));\n>>  \t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n>>  \t\t}\n\n-- \nmail: echo '<bNbolOli@ewaSPnetAM.ch>' | tr -d '[A-S]'\npgp: 0x506A903A; 49D5 794A EA77 F907 764F  D89E 304B 93CF 506A 903A\ngsm: 4.7.7.6.0.7.7.9.7.1.4.e164.arpa\nicbm: 47.0452 N, 7.2715 E\nhttp: www.drbeat.li\n\n\"It takes love over gold, and mind over matter\" -- Dire Straits\n\n"},{"id":"185246","messageId":"4F45FF50.3090009@gmail.com","threadId":"29663","inReplyTo":"1329599690-9152-1-git-send-email-bbolli@ewanet.ch","subject":"Re: [PATCH] cherry-pick -x: always insert an empty line","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2012-02-23T08:56:48Z","receivedAt":"2012-02-23T08:56:48Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On 18.02.2012 22:14, Beat Bolli wrote:\n\n> This patch fixes this buglet by always inserting an empty line before\n> the added line.\n\nThanks for this! Not having an empty line there has annoyed me, too, \nseveral times.\n\n-- \nSebastian Schuberth\n"},{"id":"185248","messageId":"4F460906.8030609@gmail.com","threadId":"29663","inReplyTo":"7vhaynp605.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] cherry-pick -x: always insert an empty line","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2012-02-23T09:38:14Z","receivedAt":"2012-02-23T09:38:14Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On 19.02.2012 09:44, Junio C Hamano wrote:\n\n> If we cherry pick your commit somewhere else with \"-x -s\", the resulting\n> commit log message would end like this:\n>\n>      Aside from that, even with a non-trivial commit the generated note\n>      \"(cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\"\n>      seems abrupt when appended directly.\n>\n>      Cc: Eric Raible<raible@nextest.com>\n>      Signed-off-by: Beat Bolli<bbolli@ewanet.ch>\n>\n>      (cherry picked from commit 555c9864971744abb558796aea28e12a1ac20839)\n>      Signed-off-by: Frotz Xyzzy<nitfol@example.xz>\n>\n> which clearly is worse-looking with the extra LF you added in this patch.\n\nClearly? I would not say so, on the contrary. When using -s together \nwith -x, I'd interpret this as signing off the process of cherry-picking \nitself, and as such, visually grouping the additional \"signed-off\" with \nthe \"cherry picked from\" makes sense to me.\n\n-- \nSebastian Schuberth\n"}]}