{"thread":{"id":"2616","subject":"Re: Diffs \"from\" working directory","startedAt":"2005-11-20T17:43:59Z","lastAt":"2005-11-22T18:32:54Z","messageCount":12,"participants":["J. Bruce Fields","Linus Torvalds","Chuck Lever","Catalin Marinas","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12378","messageId":"20051120174359.GA24177@fieldses.org","threadId":"2616","inReplyTo":"200511201817.15780.blaisorblade@yahoo.it","subject":"Re: Diffs \"from\" working directory","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2005-11-20T17:43:59Z","receivedAt":"2005-11-20T17:43:59Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Sun, Nov 20, 2005 at 06:17:15PM +0100, Blaisorblade wrote:\n> I've given a look at commit fcc1ad70be5ff89996358b6d770cd229fec2a3ba, and \n> while it may or may not be the right thing to do, there's a misunderstanding \n> at the base.\n\nWhat misunderstanding?  Could you quote it?\n\n> For instance, in the stg tree, before that patch, I can do:\n> \n> $ echo ciao >> README\n> $ stg diff -r HEAD:\n> $ stg diff -r HEAD\n> diff --git a/README b/README\n> index 184ded8..adb3970 100644\n> --- a/README\n> +++ b/README\n> @@ -12,3 +12,4 @@ StGIT commands.\n> \n>  For the latest version see http://www.procode.org/stgit/\n>  For a tutorial see http://wiki.procode.org/cgi-bin/wiki.cgi/StGIT_Tutorial\n> +ciao\n\nThat's a diff *to* the working directory.  My complaint was that there\nwasn't a convenient way to get a diff *from* the working directory.\n\nIt's nice to have a convenient shorthand for the current working\ndirectory, and since there's already a shorthand for the HEAD (\"HEAD\")\nit seemed more sensible to make \"\" the current working directory.\n\nIt's a minor point, but it seems convenient.\n\n--b.\n"},{"id":"12381","messageId":"Pine.LNX.4.64.0511201010490.13959@g5.osdl.org","threadId":"2616","inReplyTo":"20051120174359.GA24177@fieldses.org","subject":"Re: Diffs \"from\" working directory","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-20T18:13:32Z","receivedAt":"2005-11-20T18:13:32Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 20 Nov 2005, J. Bruce Fields wrote:\n> \n> That's a diff *to* the working directory.  My complaint was that there\n> wasn't a convenient way to get a diff *from* the working directory.\n\nSomething like\n\n\tgit diff -R -M -p\n\nshould do it, no?\n\n(\"git diff\" has the strange property that if you give it any diff flags at \nall, it forgets all the default ones. So it defaults to \"-M -p\", but if \nyou just say \"-R\", it will drop its own defaults, and use _just_ \"-R\").\n\n[ Which is almost certainly not what most users want, but it's practical \n  when you want to get the internal git format. Whether that is important \n  enough to confuse users or not, I dunno ]\n\n\t\tLinus\n"},{"id":"12392","messageId":"20051120205855.GA30346@fieldses.org","threadId":"2616","inReplyTo":"Pine.LNX.4.64.0511201010490.13959@g5.osdl.org","subject":"Re: Diffs \"from\" working directory","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2005-11-20T20:58:55Z","receivedAt":"2005-11-20T20:58:55Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Sun, Nov 20, 2005 at 10:13:32AM -0800, Linus Torvalds wrote:\n> On Sun, 20 Nov 2005, J. Bruce Fields wrote:\n> > \n> > That's a diff *to* the working directory.  My complaint was that there\n> > wasn't a convenient way to get a diff *from* the working directory.\n> \n> Something like\n> \n> \tgit diff -R -M -p\n>\n> should do it, no?\n\nA \"-R\" option to \"stg diff\" would be convenient, sure.--b.\n"},{"id":"12406","messageId":"4381287F.5080402@citi.umich.edu","threadId":"2616","inReplyTo":"20051120205855.GA30346@fieldses.org","subject":"Re: Diffs \"from\" working directory","fromName":"Chuck Lever","fromEmail":"cel@citi.umich.edu","sentAt":"2005-11-21T01:53:03Z","receivedAt":"2005-11-21T01:53:03Z","isPatch":false,"sender":{"key":"cel@citi.umich.edu","avatar":null},"body":"J. Bruce Fields wrote:\n> On Sun, Nov 20, 2005 at 10:13:32AM -0800, Linus Torvalds wrote:\n> \n>>On Sun, 20 Nov 2005, J. Bruce Fields wrote:\n>>\n>>>That's a diff *to* the working directory.  My complaint was that there\n>>>wasn't a convenient way to get a diff *from* the working directory.\n>>\n>>Something like\n>>\n>>\tgit diff -R -M -p\n>>\n>>should do it, no?\n> \n> \n> A \"-R\" option to \"stg diff\" would be convenient, sure.--b.\n\nthat might be an even more intuitive way to dig out what is wanted.\n\nbtw, catalin, this was bruce's patch.  i'm not sure why i was listed as \nthe author (probably a mistake of mine when i imported his patch into my \nrepository).  ah well.\n\n\nbegin:vcard\nfn:Chuck Lever\nn:Lever;Charles\norg:Network Appliance, Incorporated;Linux NFS Client Development\nadr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA\nemail;internet:cel@citi.umich.edu\ntitle:Member of Technical Staff\ntel;work:+1 734 763-4415\ntel;fax:+1 734 763 4434\ntel;home:+1 734 668-1089\nx-mozilla-html:FALSE\nurl:http://www.monkey.org/~cel/\nversion:2.1\nend:vcard\n\n"},{"id":"12474","messageId":"b0943d9e0511211328j7c062c07s@mail.gmail.com","threadId":"2616","inReplyTo":"4381287F.5080402@citi.umich.edu","subject":"Re: Diffs \"from\" working directory","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2005-11-21T21:28:53Z","receivedAt":"2005-11-21T21:28:53Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 21/11/05, Chuck Lever <cel@citi.umich.edu> wrote:\n> J. Bruce Fields wrote:\n> > A \"-R\" option to \"stg diff\" would be convenient, sure.--b.\n>\n> that might be an even more intuitive way to dig out what is wanted.\n\nI also like the idea of having a -R option (--reverse the long\nversion). This would mean reversing the commit that changed the diff\n-r option.\n\n> btw, catalin, this was bruce's patch.  i'm not sure why i was listed as\n> the author (probably a mistake of mine when i imported his patch into my\n> repository).  ah well.\n\nMy import command sets the author to the e-mail sender, which was you.\nMaybe this should be changed but I don't know which option is better.\nIn the meantime, you can change the default e-mail template to set the\nFrom: line with to the author of the patch and maybe add a Reply-to:\nwith your address.\n\n--\nCatalin\n"},{"id":"12480","messageId":"7vhda5of1r.fsf@assigned-by-dhcp.cox.net","threadId":"2616","inReplyTo":"b0943d9e0511211328j7c062c07s@mail.gmail.com","subject":"Re: Diffs \"from\" working directory","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-21T21:40:32Z","receivedAt":"2005-11-21T21:40:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Catalin Marinas <catalin.marinas@gmail.com> writes:\n\n> My import command sets the author to the e-mail sender, which was you.\n> Maybe this should be changed but I don't know which option is better.\n> In the meantime, you can change the default e-mail template to set the\n> From: line with to the author of the patch and maybe add a Reply-to:\n> with your address.\n\n... and Sender: perhaps?\n\nThe first lines in the commit log message sent over e-mail can\nhave \"Subject: \" (or \"[PATCH] \"), \"From: \", and \"Date: \" to\noverride what is slurped from e-mail headers if you use mailinfo,\nso that might be a better alternative to suggest.\n"},{"id":"12482","messageId":"b0943d9e0511211345p41fcca6eu@mail.gmail.com","threadId":"2616","inReplyTo":"7vhda5of1r.fsf@assigned-by-dhcp.cox.net","subject":"Re: Diffs \"from\" working directory","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2005-11-21T21:45:49Z","receivedAt":"2005-11-21T21:45:49Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 21/11/05, Junio C Hamano <junkio@cox.net> wrote:\n> Catalin Marinas <catalin.marinas@gmail.com> writes:\n>\n> > My import command sets the author to the e-mail sender, which was you.\n> > Maybe this should be changed but I don't know which option is better.\n> > In the meantime, you can change the default e-mail template to set the\n> > From: line with to the author of the patch and maybe add a Reply-to:\n> > with your address.\n>\n> ... and Sender: perhaps?\n\nYes.\n\n> The first lines in the commit log message sent over e-mail can\n> have \"Subject: \" (or \"[PATCH] \"), \"From: \", and \"Date: \" to\n> override what is slurped from e-mail headers if you use mailinfo,\n> so that might be a better alternative to suggest.\n\nThanks for the suggestion. It is indeed a good idea to parse the\ncommit log and override the information from the headers.\n\n--\nCatalin\n"},{"id":"12513","messageId":"4382A972.1010801@citi.umich.edu","threadId":"2616","inReplyTo":"b0943d9e0511211328j7c062c07s@mail.gmail.com","subject":"Re: Diffs \"from\" working directory","fromName":"Chuck Lever","fromEmail":"cel@citi.umich.edu","sentAt":"2005-11-22T05:15:30Z","receivedAt":"2005-11-22T05:15:30Z","isPatch":false,"sender":{"key":"cel@citi.umich.edu","avatar":null},"body":"Catalin Marinas wrote:\n>>btw, catalin, this was bruce's patch.  i'm not sure why i was listed as\n>>the author (probably a mistake of mine when i imported his patch into my\n>>repository).  ah well.\n> \n> \n> My import command sets the author to the e-mail sender, which was you.\n> Maybe this should be changed but I don't know which option is better.\n> In the meantime, you can change the default e-mail template to set the\n> From: line with to the author of the patch and maybe add a Reply-to:\n> with your address.\n\nfor some reason i was under the impression that it would parse the \nSigned-off-by: fields in the patch description, and take the first one \nas the patch author.\n\n\nbegin:vcard\nfn:Chuck Lever\nn:Lever;Charles\norg:Network Appliance, Incorporated;Linux NFS Client Development\nadr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA\nemail;internet:cel@citi.umich.edu\ntitle:Member of Technical Staff\ntel;work:+1 734 763-4415\ntel;fax:+1 734 763 4434\ntel;home:+1 734 668-1089\nx-mozilla-html:FALSE\nurl:http://www.monkey.org/~cel/\nversion:2.1\nend:vcard\n\n"},{"id":"12517","messageId":"Pine.LNX.4.64.0511212124160.13959@g5.osdl.org","threadId":"2616","inReplyTo":"4382A972.1010801@citi.umich.edu","subject":"Re: Diffs \"from\" working directory","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-22T05:33:41Z","receivedAt":"2005-11-22T05:33:41Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 22 Nov 2005, Chuck Lever wrote:\n> \n> for some reason i was under the impression that it would parse the\n> Signed-off-by: fields in the patch description, and take the first one as the\n> patch author.\n\nThe first sign-off really isn't necessarily the author.\n\nIt might be a company sign-off (many companies don't want any random \nengineer to send out patches), but much more commonly it's a trivial patch \nthat somebody else signs off on, even if the original patcher didn't (see \ncase (b) in the sign-off-rules: you can sign of on somebody elses work if \nyou know it's under the GPL).\n\nSo the fact that there was a sign-off procedure doesn't automatically mean \nthat the author will be the first sign-off person, although in _practice_ \nthat obviously would likely always be the most common case by far.\n\n(Another reason is that some people actually add the sign-offs above \nprevious ones. It happens, although if I notice, I try to point it out).\n\nSo authorship really is totally separate from sign-off, and all _my_ tools \ntake the authorship from the first \"From:\" line at the top of the message \nbody or from the email itself.\n\n\t\t\tLinus\n"},{"id":"12532","messageId":"b0943d9e0511220235kf314b5dy@mail.gmail.com","threadId":"2616","inReplyTo":"4382A972.1010801@citi.umich.edu","subject":"Re: Diffs \"from\" working directory","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2005-11-22T10:35:34Z","receivedAt":"2005-11-22T10:35:34Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 22/11/05, Chuck Lever <cel@citi.umich.edu> wrote:\n> Catalin Marinas wrote:\n> > My import command sets the author to the e-mail sender, which was you.\n>\n> for some reason i was under the impression that it would parse the\n> Signed-off-by: fields in the patch description, and take the first one\n> as the patch author.\n\nIf you import a patch file and don't specify an author (and the patch\nis not an e-mail), the first Signed-off-by: line is used. As Linus\nmentioned, we could get rid of this assumption entirely and just\nreport an error if no author information is given.\n\n--\nCatalin\n"},{"id":"12552","messageId":"43835D8E.60109@citi.umich.edu","threadId":"2616","inReplyTo":"Pine.LNX.4.64.0511212124160.13959@g5.osdl.org","subject":"Re: Diffs \"from\" working directory","fromName":"Chuck Lever","fromEmail":"cel@citi.umich.edu","sentAt":"2005-11-22T18:03:58Z","receivedAt":"2005-11-22T18:03:58Z","isPatch":false,"sender":{"key":"cel@citi.umich.edu","avatar":null},"body":"Linus Torvalds wrote:\n> \n> On Tue, 22 Nov 2005, Chuck Lever wrote:\n> \n>>for some reason i was under the impression that it would parse the\n>>Signed-off-by: fields in the patch description, and take the first one as the\n>>patch author.\n> \n> \n> The first sign-off really isn't necessarily the author.\n> \n> It might be a company sign-off (many companies don't want any random \n> engineer to send out patches), but much more commonly it's a trivial patch \n> that somebody else signs off on, even if the original patcher didn't (see \n> case (b) in the sign-off-rules: you can sign of on somebody elses work if \n> you know it's under the GPL).\n\nheh.  in fact that is what my company (NetApp) requires.\n\n> So the fact that there was a sign-off procedure doesn't automatically mean \n> that the author will be the first sign-off person, although in _practice_ \n> that obviously would likely always be the most common case by far.\n> \n> (Another reason is that some people actually add the sign-offs above \n> previous ones. It happens, although if I notice, I try to point it out).\n> \n> So authorship really is totally separate from sign-off, and all _my_ tools \n> take the authorship from the first \"From:\" line at the top of the message \n> body or from the email itself.\n\nthen perhaps the problem is that the \"stg mail\" tool should place the \nauthor in the From: field automatically?  (ie change the tool, or \npermanently modify the default template that comes with StGIT to do \nthis, as Catalin suggested earlier).\n\nthat seems a little twisty to me; you're overloading the SMTP header \nfield instead of explicitly specifying patch authorship.  seems like a \nlayering violation.\n\n\nbegin:vcard\nfn:Chuck Lever\nn:Lever;Charles\norg:Network Appliance, Incorporated;Linux NFS Client Development\nadr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA\nemail;internet:cel@citi.umich.edu\ntitle:Member of Technical Staff\ntel;work:+1 734 763-4415\ntel;fax:+1 734 763 4434\ntel;home:+1 734 668-1089\nx-mozilla-html:FALSE\nurl:http://www.monkey.org/~cel/\nversion:2.1\nend:vcard\n\n"},{"id":"12555","messageId":"Pine.LNX.4.64.0511221025580.13959@g5.osdl.org","threadId":"2616","inReplyTo":"43835D8E.60109@citi.umich.edu","subject":"Re: Diffs \"from\" working directory","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-22T18:32:54Z","receivedAt":"2005-11-22T18:32:54Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 22 Nov 2005, Chuck Lever wrote:\n> \n> then perhaps the problem is that the \"stg mail\" tool should place the author\n> in the From: field automatically?  (ie change the tool, or permanently modify\n> the default template that comes with StGIT to do this, as Catalin suggested\n> earlier).\n> \n> that seems a little twisty to me; you're overloading the SMTP header field\n> instead of explicitly specifying patch authorship.  seems like a layering\n> violation.\n\nNo, I only use the actual SMTP header field if the _body_ of the email \ndoesn't contain the \"From:\".\n\nSo there's really two different \"From:\" lines: there's the SMTP header \none, which is just a default fallback one, and there's the first non-empty \nline of the email body itself, which is the preferred one. No layering \nviolation, just two different layers that have the same format for the \nline.\n\nSee \"The Perfect Patch\" by Andrew, and bullet (4): Attribution:\n\n\thttp://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt\n\nTo quote:\n\n   'If someone else wrote the patch, they should be credited (and blamed) \n    for it. To communicate this, add a line:\n\n    From: John Doe <jdoe@wherever.com>\n\n    as the very first line of the email.  Downstream tools will pick this \n    up and jdoe will get the git \"Author\" line.'\n\nand I'd be even more anal about it: I would seriously suggest to people \nthat they just _always_ add the \"From:\" line at the head of the email, \neven if it just is exactly the same as what will be in the SMTP header.\n\nWhy? Simple. It makes is less likely that somebody who just forwards the \npatch will forget to add that line for you. So you are really helping \npeople out - and making sure the attribution stays correct - by adding \nthat extra \"From:\" line at the top of your email body, even if it is \n\"unnecessary\" in the sense that it's also in your SMTP header.\n\n\t\tLinus\n"}]}