{"thread":{"id":"13926","subject":"Dubious format-patch options","startedAt":"2008-06-13T01:14:17Z","lastAt":"2008-06-13T06:33:37Z","messageCount":5,"participants":["Jon Loeliger","Junio C Hamano","Linus Torvalds","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"79662","messageId":"E1K6xrt-00033S-2J@jdl.com","threadId":"13926","inReplyTo":null,"subject":"Dubious format-patch options","fromName":"Jon Loeliger","fromEmail":"jdl@jdl.com","sentAt":"2008-06-13T01:14:17Z","receivedAt":"2008-06-13T01:14:17Z","isPatch":false,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"Git-ites,\n\nHmmm... There are a ton of dubious options being accepted\nby the \"git format-patch\" command due to it being a skinny\nfront to \"git log\".  Like, the -S and pick-axe crew:\n\nYeah, this is context-less, but my point is that we get\ntotally different behavior from the -S\"string\" here:\n\n    $ git log -SC alt~1..HEAD\n    commit bca87c386c8868664e64d397108b8e6deda1e574\n    Author: Jon Loeliger <jdl@jdl.com>\n    Date:   Thu Jun 12 17:57:57 2008 -0500\n\n\tC\nversus\n\n    $ git format-patch -SC alt~1..HEAD\n    0001-C.patch\n    0002-D.patch\n    0003-Z.patch\n    0004-F.patch\n\nOh yeah.\n\nAnd --color is a cool thing too.  I mean, I was pleasantly\npleased with:\n\n    $ git format-patch -1 --stdout --color master\n\nBut I seriously doubt that we _really_ want to send a\npatch that has the embedded escape sequences in it:\n\n    From: Jon Loeliger <jdl@jdl.com>\n    Date: Thu, 12 Jun 2008 18:13:10 -0500\n    Subject: [PATCH] F\n\n    ---\n     fileESC[m |    1 ESC[32m+ESC[m\n     1 files changed, 1 insertions(+), 0 deletions(-)ESC[m\n\n    ESC[1mdiff --git a/file b/fileESC[m\n    ESC[1mindex 6ac15b9..65f21da 100644ESC[m\n    ESC[1m--- a/fileESC[m\n    ESC[1m+++ b/fileESC[m\n    ESC[36m@@ -5,3 +5,4 @@ D\n    ESC[m X\n    ESC[m Y\n    ESC[m Z\n    ESC[mESC[32m+ESC[mESC[32mFESC[m\n    -- \n    1.5.6.rc0.46.gd2b3\n\nOh yeah.  Another Vodka Tonic please while git-send-email that...\n\njdl\n"},{"id":"79663","messageId":"7vzlpqxf6y.fsf@gitster.siamese.dyndns.org","threadId":"13926","inReplyTo":"E1K6xrt-00033S-2J@jdl.com","subject":"Re: Dubious format-patch options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-13T02:05:09Z","receivedAt":"2008-06-13T02:05:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jon Loeliger <jdl@jdl.com> writes:\n\n> Git-ites,\n>\n> Hmmm... There are a ton of dubious options being accepted\n> by the \"git format-patch\" command due to it being a skinny\n> front to \"git log\".  Like, the -S and pick-axe crew:\n> ...\n> Oh yeah.\n>\n> And --color is a cool thing too.  I mean, I was pleasantly\n> pleased with:\n\nAmusing ;-).\n"},{"id":"79664","messageId":"alpine.LFD.1.10.0806121923400.2949@woody.linux-foundation.org","threadId":"13926","inReplyTo":"E1K6xrt-00033S-2J@jdl.com","subject":"Re: Dubious format-patch options","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-06-13T02:24:18Z","receivedAt":"2008-06-13T02:24:18Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 12 Jun 2008, Jon Loeliger wrote:\n> \n>     $ git format-patch -1 --stdout --color master\n> \n> But I seriously doubt that we _really_ want to send a\n> patch that has the embedded escape sequences in it:\n\nHey, you asked for it, you got it. I hope you're not complaining.\n\n\t\tLinus\n"},{"id":"79665","messageId":"7vtzfyxckm.fsf@gitster.siamese.dyndns.org","threadId":"13926","inReplyTo":"alpine.LFD.1.10.0806121923400.2949@woody.linux-foundation.org","subject":"Re: Dubious format-patch options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-13T03:01:45Z","receivedAt":"2008-06-13T03:01:45Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> On Thu, 12 Jun 2008, Jon Loeliger wrote:\n>> \n>>     $ git format-patch -1 --stdout --color master\n>> \n>> But I seriously doubt that we _really_ want to send a\n>> patch that has the embedded escape sequences in it:\n>\n> Hey, you asked for it, you got it. I hope you're not complaining.\n\nWell, having said and heard all that, coming back to our more serious\nselves...\n\nI think being able to do\n\n    $ git -p format-patch --stdout --color -2 HEAD\n\nmakes some sense.  Being able to produce an unusable patch by saying\n\n    $ git format-patch --stat old..\n\nat the first glance is of quite dubious value, but even that would make\nsense as a good input source for \"commit log automailer\".\n\nI think I know where Jon is coming from and where he wants to go.  While I\nam somewhat sympathetic to the cause of adding some warning or safety\nvalve to prevent nonsense option combinations from being given, I am not\nsure we can draw a line to classify options into black and white.\n"},{"id":"79683","messageId":"20080613063337.GE26768@sigill.intra.peff.net","threadId":"13926","inReplyTo":"7vtzfyxckm.fsf@gitster.siamese.dyndns.org","subject":"Re: Dubious format-patch options","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-13T06:33:37Z","receivedAt":"2008-06-13T06:33:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 12, 2008 at 08:01:45PM -0700, Junio C Hamano wrote:\n\n> makes some sense.  Being able to produce an unusable patch by saying\n> \n>     $ git format-patch --stat old..\n> \n> at the first glance is of quite dubious value, but even that would make\n> sense as a good input source for \"commit log automailer\".\n> \n> I think I know where Jon is coming from and where he wants to go.  While I\n> am somewhat sympathetic to the cause of adding some warning or safety\n> valve to prevent nonsense option combinations from being given, I am not\n> sure we can draw a line to classify options into black and white.\n\nI am against a safety valve here. For example, I have the following\nalias:\n\n  format-patch --pretty=format:%s%n%n%b\n\nwhich obviously does not generate a valid email, but which I use for\npulling \"how about this?\" patches directly into existing emails\n(otherwise, I have to delete the header cruft myself). Yes, I _could_ do\nthis with git-log, but format-patch has slightly different command line\nsemantics. And it most clearly expresses what I want: the patch\nsubmission format, but with the header bits pretty-printed differently.\n\nMy point being that this flexibility _is_ useful, and I am not sure it\nis worth removing it in favor of people who get confused about why\n\n  git format-patch --pretty=format:%s%n%n%b origin | git send-email\n\ndoesn't work.\n\n-Peff\n"}]}