{"thread":{"id":"52089","subject":"[BUG] \"--show-current-patch\" return a mail instead of a patch","startedAt":"2019-10-22T10:18:10Z","lastAt":"2019-10-23T12:47:44Z","messageCount":7,"participants":["Jerome Pouiller","Junio C Hamano","Denton Liu"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"384580","messageId":"2154192.LVDMpRDY2h@pc-42","threadId":"52089","inReplyTo":null,"subject":"[BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Jerome Pouiller","fromEmail":"jerome.pouiller@silabs.com","sentAt":"2019-10-22T10:18:03Z","receivedAt":"2019-10-22T10:18:10Z","isPatch":false,"sender":{"key":"jerome.pouiller@silabs.com","avatar":"https://gravatar.com/avatar/baca1631f26bc6d92e49d8581b9d0eb122fde624b5817404704c7399c88da881?d=mp&s=160"},"body":"Hello all,\n\nI try to use \"git am\" to apply a patch sent using \"git send-email\". This\npatch does not apply properly. I try to use \"git am --show-current-patch\"\nto understand the problem. However, since original mail is encoded in quoted-\nprintable, data returned by --show-current-patch is not a valid patch.\n\nI expected that --show-current-patch would return decoded version of original \nmail or something that looks like the output of \"git format-patch\" or at least \na valid patch. Thus, it could be processed with \"git apply\" or \"patch\".\n\nCurrently I run \"git mailinfo\" manually to get the patch, but it is not very \nhandy.\n\n(I use git version 2.20.1 from Debian buster)\n\nThank you,\n\n-- \nJérôme Pouiller\n\n"},{"id":"384665","messageId":"xmqqzhhsi4g5.fsf@gitster-ct.c.googlers.com","threadId":"52089","inReplyTo":"2154192.LVDMpRDY2h@pc-42","subject":"Re: [BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-23T02:24:58Z","receivedAt":"2019-10-23T02:25:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:\n\n> Hello all,\n>\n> I try to use \"git am\" to apply a patch sent using \"git send-email\". This\n> patch does not apply properly. I try to use \"git am --show-current-patch\"\n> to understand the problem. However, since original mail is encoded in quoted-\n> printable, data returned by --show-current-patch is not a valid patch.\n\nI agree that --show-current-patch is a misdesigned feature.  We'd be\ndoing a better service to our users if we documented that the patch\nand log message are found at .git/rebase-apply/{patch,msg} instead\nof trying to hide the path.\n\nUnfortunately, it is likely that those who added that feature have\nbuilt their tooling around it to depend on its output being the full\ne-mail message \"am\" was fed (and split by \"git mailsplit\").  So I do\nnot think we will be changing the output to the patch file only.\n\nBut even then, the documentation can be fixed without any backward\ncompatibility issues.  Perhaps like this?\n\n Documentation/git-am.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 6f6c34b0f4..f63b70325c 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -172,7 +172,7 @@ default.   You can use `--no-utf8` to override this.\n \tuntouched.\n \n --show-current-patch::\n-\tShow the patch being applied when \"git am\" is stopped because\n+\tShow the entire e-mail message \"git am\" has stopped at, because\n \tof conflicts.\n \n DISCUSSION\n\n"},{"id":"384684","messageId":"1791353.RaUiIlXgNR@pc-42","threadId":"52089","inReplyTo":"xmqqzhhsi4g5.fsf@gitster-ct.c.googlers.com","subject":"Re: [BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Jerome Pouiller","fromEmail":"jerome.pouiller@silabs.com","sentAt":"2019-10-23T08:49:41Z","receivedAt":"2019-10-23T08:49:46Z","isPatch":false,"sender":{"key":"jerome.pouiller@silabs.com","avatar":"https://gravatar.com/avatar/baca1631f26bc6d92e49d8581b9d0eb122fde624b5817404704c7399c88da881?d=mp&s=160"},"body":"On Wednesday 23 October 2019 04:24:58 CEST Junio C Hamano wrote:\n> Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:\n> > I try to use \"git am\" to apply a patch sent using \"git send-email\". This\n> > patch does not apply properly. I try to use \"git am --show-current-patch\"\n> > to understand the problem. However, since original mail is encoded in quoted-\n> > printable, data returned by --show-current-patch is not a valid patch.\n> \n> I agree that --show-current-patch is a misdesigned feature.  We'd be\n> doing a better service to our users if we documented that the patch\n> and log message are found at .git/rebase-apply/{patch,msg} instead\n> of trying to hide the path.\n> \n> Unfortunately, it is likely that those who added that feature have\n> built their tooling around it to depend on its output being the full\n> e-mail message \"am\" was fed (and split by \"git mailsplit\").  So I do\n> not think we will be changing the output to the patch file only.\n> \n> But even then, the documentation can be fixed without any backward\n> compatibility issues.  Perhaps like this?\n> \n>  Documentation/git-am.txt | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> index 6f6c34b0f4..f63b70325c 100644\n> --- a/Documentation/git-am.txt\n> +++ b/Documentation/git-am.txt\n> @@ -172,7 +172,7 @@ default.   You can use `--no-utf8` to override this.\n>         untouched.\n> \n>  --show-current-patch::\n> -       Show the patch being applied when \"git am\" is stopped because\n> +       Show the entire e-mail message \"git am\" has stopped at, because\n>         of conflicts.\n\nI agree with you: I think that manpage and/or output of \"git am\" should\nmention \".git/rebase-apply/patch\" (that is exactly what I was looking\nfor).\n\nMaybe documentation of --show-current-patch should be clarified with a\nnote like \"This option is mainly for internal purpose. If you want to\nget current patch, rely on .git/rebase-apply/patch\".\n\n\n-- \nJérôme Pouiller\n\n"},{"id":"384685","messageId":"20191023085503.GA652469@generichostname","threadId":"52089","inReplyTo":"1791353.RaUiIlXgNR@pc-42","subject":"Re: [BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T08:55:03Z","receivedAt":"2019-10-23T08:55:11Z","isPatch":false,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Jerome,\n\nOn Wed, Oct 23, 2019 at 08:49:41AM +0000, Jerome Pouiller wrote:\n> On Wednesday 23 October 2019 04:24:58 CEST Junio C Hamano wrote:\n> > Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:\n> > > I try to use \"git am\" to apply a patch sent using \"git send-email\". This\n> > > patch does not apply properly. I try to use \"git am --show-current-patch\"\n> > > to understand the problem. However, since original mail is encoded in quoted-\n> > > printable, data returned by --show-current-patch is not a valid patch.\n> > \n> > I agree that --show-current-patch is a misdesigned feature.  We'd be\n> > doing a better service to our users if we documented that the patch\n> > and log message are found at .git/rebase-apply/{patch,msg} instead\n> > of trying to hide the path.\n> > \n> > Unfortunately, it is likely that those who added that feature have\n> > built their tooling around it to depend on its output being the full\n> > e-mail message \"am\" was fed (and split by \"git mailsplit\").  So I do\n> > not think we will be changing the output to the patch file only.\n> > \n> > But even then, the documentation can be fixed without any backward\n> > compatibility issues.  Perhaps like this?\n> > \n> >  Documentation/git-am.txt | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> > index 6f6c34b0f4..f63b70325c 100644\n> > --- a/Documentation/git-am.txt\n> > +++ b/Documentation/git-am.txt\n> > @@ -172,7 +172,7 @@ default.   You can use `--no-utf8` to override this.\n> >         untouched.\n> > \n> >  --show-current-patch::\n> > -       Show the patch being applied when \"git am\" is stopped because\n> > +       Show the entire e-mail message \"git am\" has stopped at, because\n> >         of conflicts.\n> \n> I agree with you: I think that manpage and/or output of \"git am\" should\n> mention \".git/rebase-apply/patch\" (that is exactly what I was looking\n> for).\n\nI am currently have a WIP patchset that will print the location of the\nfailed patch file (.git/rebase-apply/patch) in the case of a failure as\nwell as the line number. Will this be sufficient for your purposes?\n\nThanks,\n\nDenton\n\n> \n> Maybe documentation of --show-current-patch should be clarified with a\n> note like \"This option is mainly for internal purpose. If you want to\n> get current patch, rely on .git/rebase-apply/patch\".\n> \n> \n> -- \n> Jérôme Pouiller\n> \n"},{"id":"384689","messageId":"2720546.GJdFeal64i@pc-42","threadId":"52089","inReplyTo":"20191023085503.GA652469@generichostname","subject":"Re: [BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Jerome Pouiller","fromEmail":"jerome.pouiller@silabs.com","sentAt":"2019-10-23T10:15:15Z","receivedAt":"2019-10-23T10:15:19Z","isPatch":false,"sender":{"key":"jerome.pouiller@silabs.com","avatar":"https://gravatar.com/avatar/baca1631f26bc6d92e49d8581b9d0eb122fde624b5817404704c7399c88da881?d=mp&s=160"},"body":"On Wednesday 23 October 2019 10:55:03 CEST Denton Liu wrote:\n> On Wed, Oct 23, 2019 at 08:49:41AM +0000, Jerome Pouiller wrote:\n> > On Wednesday 23 October 2019 04:24:58 CEST Junio C Hamano wrote:\n> > > Jerome Pouiller <Jerome.Pouiller@silabs.com> writes:\n> > > > I try to use \"git am\" to apply a patch sent using \"git send-email\". This\n> > > > patch does not apply properly. I try to use \"git am --show-current-patch\"\n> > > > to understand the problem. However, since original mail is encoded in quoted-\n> > > > printable, data returned by --show-current-patch is not a valid patch.\n> > >\n> > > I agree that --show-current-patch is a misdesigned feature.  We'd be\n> > > doing a better service to our users if we documented that the patch\n> > > and log message are found at .git/rebase-apply/{patch,msg} instead\n> > > of trying to hide the path.\n> > >\n> > > Unfortunately, it is likely that those who added that feature have\n> > > built their tooling around it to depend on its output being the full\n> > > e-mail message \"am\" was fed (and split by \"git mailsplit\").  So I do\n> > > not think we will be changing the output to the patch file only.\n> > >\n> > > But even then, the documentation can be fixed without any backward\n> > > compatibility issues.  Perhaps like this?\n> > >\n> > >  Documentation/git-am.txt | 2 +-\n> > >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > >\n> > > diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> > > index 6f6c34b0f4..f63b70325c 100644\n> > > --- a/Documentation/git-am.txt\n> > > +++ b/Documentation/git-am.txt\n> > > @@ -172,7 +172,7 @@ default.   You can use `--no-utf8` to override this.\n> > >         untouched.\n> > >\n> > >  --show-current-patch::\n> > > -       Show the patch being applied when \"git am\" is stopped because\n> > > +       Show the entire e-mail message \"git am\" has stopped at, because\n> > >         of conflicts.\n> >\n> > I agree with you: I think that manpage and/or output of \"git am\" should\n> > mention \".git/rebase-apply/patch\" (that is exactly what I was looking\n> > for).\n> \n> I am currently have a WIP patchset that will print the location of the\n> failed patch file (.git/rebase-apply/patch) in the case of a failure as\n> well as the line number. Will this be sufficient for your purposes?\n\nIt would be a clear improvement (the perfection would be to be able to\nuse mergetool with git-am :) ).\n\nThank you,\n\n-- \nJérôme Pouiller\n\n"},{"id":"384690","messageId":"20191023110951.GA716725@generichostname","threadId":"52089","inReplyTo":"2720546.GJdFeal64i@pc-42","subject":"Re: [BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T11:09:51Z","receivedAt":"2019-10-23T11:09:57Z","isPatch":false,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"On Wed, Oct 23, 2019 at 10:15:15AM +0000, Jerome Pouiller wrote:\n> On Wednesday 23 October 2019 10:55:03 CEST Denton Liu wrote:\n> > I am currently have a WIP patchset that will print the location of the\n> > failed patch file (.git/rebase-apply/patch) in the case of a failure as\n> > well as the line number. Will this be sufficient for your purposes?\n> \n> It would be a clear improvement (the perfection would be to be able to\n> use mergetool with git-am :) ).\n\nYou should be able to do that with the --3way (-3) flag.\n\n> \n> Thank you,\n> \n> -- \n> Jérôme Pouiller\n> \n"},{"id":"384697","messageId":"2928191.nfgCUvMfDQ@pc-42","threadId":"52089","inReplyTo":"20191023110951.GA716725@generichostname","subject":"Re: [BUG] \"--show-current-patch\" return a mail instead of a patch","fromName":"Jerome Pouiller","fromEmail":"jerome.pouiller@silabs.com","sentAt":"2019-10-23T12:47:39Z","receivedAt":"2019-10-23T12:47:44Z","isPatch":false,"sender":{"key":"jerome.pouiller@silabs.com","avatar":"https://gravatar.com/avatar/baca1631f26bc6d92e49d8581b9d0eb122fde624b5817404704c7399c88da881?d=mp&s=160"},"body":"On Wednesday 23 October 2019 13:09:51 CEST Denton Liu wrote:\n> On Wed, Oct 23, 2019 at 10:15:15AM +0000, Jerome Pouiller wrote:\n> > On Wednesday 23 October 2019 10:55:03 CEST Denton Liu wrote:\n> > > I am currently have a WIP patchset that will print the location of the\n> > > failed patch file (.git/rebase-apply/patch) in the case of a failure as\n> > > well as the line number. Will this be sufficient for your purposes?\n> >\n> > It would be a clear improvement (the perfection would be to be able to\n> > use mergetool with git-am :) ).\n> \n> You should be able to do that with the --3way (-3) flag.\n\nAFAIK, it only works if index is found in local repository, which is\nrarely the case :(\n\n-- \nJérôme Pouiller\n\n"}]}