{"thread":{"id":"4082","subject":"[PATCH] fmt-patch: understand old <his> notation","startedAt":"2006-05-06T20:56:38Z","lastAt":"2006-05-07T01:31:38Z","messageCount":7,"participants":["Johannes Schindelin","Junio C Hamano","Linus Torvalds","Olivier Galibert"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19614","messageId":"Pine.LNX.4.63.0605062252530.4155@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4082","inReplyTo":null,"subject":"[PATCH] fmt-patch: understand old <his> notation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-06T20:56:38Z","receivedAt":"2006-05-06T20:56:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen calling \"git fmt-patch HEAD~5\", you now get the same as if you would\nhave said \"git fmt-patch HEAD~5..\". This makes it easier for my fingers\nwhich are so used to the old syntax.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tI wonder: would it make sense to make add_pending_object() and \n\tget_reference() in revision.c non-static?\n\n builtin-diff.c |    2 +-\n builtin-log.c  |    8 ++++++++\n 2 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-diff.c b/builtin-diff.c\nindex 636edbf..2087316 100644\n--- a/builtin-diff.c\n+++ b/builtin-diff.c\n@@ -232,7 +232,7 @@ static int builtin_diff_combined(struct \n \treturn 0;\n }\n \n-static void add_head(struct rev_info *revs)\n+void add_head(struct rev_info *revs)\n {\n \tunsigned char sha1[20];\n \tstruct object *obj;\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 0027998..d5bbc1c 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -11,6 +11,9 @@ #include \"revision.h\"\n #include \"log-tree.h\"\n #include \"builtin.h\"\n \n+/* this is in builtin-diff.c */\n+void add_head(struct rev_info *revs);\n+\n static int cmd_log_wc(int argc, const char **argv, char **envp,\n \t\t      struct rev_info *rev)\n {\n@@ -185,6 +188,11 @@ int cmd_format_patch(int argc, const cha\n \tif (argc > 1)\n \t\tdie (\"unrecognized argument: %s\", argv[1]);\n \n+\tif (rev.pending_objects && rev.pending_objects->next == NULL) {\n+\t\trev.pending_objects->item->flags |= UNINTERESTING;\n+\t\tadd_head(&rev);\n+\t}\n+\n \tif (!use_stdout)\n \t\trealstdout = fdopen(dup(1), \"w\");\n \n-- \n1.3.1.g9ba6-dirty\n"},{"id":"19618","messageId":"7viroirfur.fsf@assigned-by-dhcp.cox.net","threadId":"4082","inReplyTo":"Pine.LNX.4.63.0605062252530.4155@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] fmt-patch: understand old <his> notation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-06T21:41:16Z","receivedAt":"2006-05-06T21:41:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> When calling \"git fmt-patch HEAD~5\", you now get the same as if you would\n> have said \"git fmt-patch HEAD~5..\". This makes it easier for my fingers\n> which are so used to the old syntax.\n\nWhile this would be easier on _my_ fingers as well, I have a\nsuspicion that it might make more sense to make this \"single\nref\" case to mean \"HEAD~5^..HEAD~5\" (if we _were_ designing a\nnew command that is called format-patch today, that would be\nmore natural).  But probably it is too late to break it by now.\n\n> \tI wonder: would it make sense to make add_pending_object() and \n> \tget_reference() in revision.c non-static?\n\nI'd rather not expose such revision.c internals too much.  An\nalternative approach would be to give instruction to revision.c\n(read: another flag like rev.no_walk) to tell it to do something\nspecial when the user has only one commit, but I think what you\ndid in your patch is cleaner and sufficient.\n\nAlso we probably would want to default the diff options to show\nthe root commit diff (rev.show_root_diff).\n"},{"id":"19621","messageId":"Pine.LNX.4.63.0605062358280.6357@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"4082","inReplyTo":"7viroirfur.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] fmt-patch: understand old <his> notation","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-05-06T22:01:16Z","receivedAt":"2006-05-06T22:01:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 6 May 2006, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > When calling \"git fmt-patch HEAD~5\", you now get the same as if you would\n> > have said \"git fmt-patch HEAD~5..\". This makes it easier for my fingers\n> > which are so used to the old syntax.\n> \n> While this would be easier on _my_ fingers as well, I have a\n> suspicion that it might make more sense to make this \"single\n> ref\" case to mean \"HEAD~5^..HEAD~5\" (if we _were_ designing a\n> new command that is called format-patch today, that would be\n> more natural).  But probably it is too late to break it by now.\n\nNo, it is not too late. I did this patch only to prevent cluttering my \ndirectory with millions of patches, only because I forgot _again_ to type \nthe two dots.\n\n> > \tI wonder: would it make sense to make add_pending_object() and \n> > \tget_reference() in revision.c non-static?\n> \n> I'd rather not expose such revision.c internals too much.  An\n> alternative approach would be to give instruction to revision.c\n> (read: another flag like rev.no_walk) to tell it to do something\n> special when the user has only one commit, but I think what you\n> did in your patch is cleaner and sufficient.\n\nI just stole the function add_head() from builtin-diff.c, but that feels \nwrong. I think adding a pending object should not be internal to \nrevision.c.\n\n> Also we probably would want to default the diff options to show\n> the root commit diff (rev.show_root_diff).\n\nI gather this is needed for git-am/git-rebase to continue working?\n\nCiao,\nDscho\n"},{"id":"19624","messageId":"Pine.LNX.4.64.0605061527030.16343@g5.osdl.org","threadId":"4082","inReplyTo":"7viroirfur.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] fmt-patch: understand old <his> notation","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-05-06T22:30:38Z","receivedAt":"2006-05-06T22:30:38Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sat, 6 May 2006, Junio C Hamano wrote:\n> \n> While this would be easier on _my_ fingers as well, I have a\n> suspicion that it might make more sense to make this \"single\n> ref\" case to mean \"HEAD~5^..HEAD~5\" (if we _were_ designing a\n> new command that is called format-patch today, that would be\n> more natural).\n\nCareful, that \"X^..X\" thing does entirely the wrong thing for merges. Not \nwhat you want at all, I think.\n\n> But probably it is too late to break it by now.\n\nMaybe not. I've actually cursed the fact that I made \"git diff X\" mean \n\"diff from X to current working tree\", because it almost never makes any \nsense at all when X is anything but \"HEAD\".\n\nI probably _should_ have made \"git diff X\" mean basically \"git show X\", \nand not what it means now.\n\nOh, well.\n\n\t\t\tLinus\n"},{"id":"19628","messageId":"20060506231901.GB45996@dspnet.fr.eu.org","threadId":"4082","inReplyTo":"Pine.LNX.4.64.0605061527030.16343@g5.osdl.org","subject":"Re: [PATCH] fmt-patch: understand old <his> notation","fromName":"Olivier Galibert","fromEmail":"galibert@pobox.com","sentAt":"2006-05-06T23:19:01Z","receivedAt":"2006-05-06T23:19:01Z","isPatch":true,"sender":{"key":"galibert@pobox.com","avatar":null},"body":"On Sat, May 06, 2006 at 03:30:38PM -0700, Linus Torvalds wrote:\n> Maybe not. I've actually cursed the fact that I made \"git diff X\" mean \n> \"diff from X to current working tree\", because it almost never makes any \n> sense at all when X is anything but \"HEAD\".\n> \n> I probably _should_ have made \"git diff X\" mean basically \"git show X\", \n> and not what it means now.\n\nFunny, when tracking other projects I use (sometimes path-filtered)\n\"git diff origin\" often, but I find \"git show origin\" utterly\nuninteresting.\n\n  OG.\n"},{"id":"19632","messageId":"7vd5eqr5bt.fsf@assigned-by-dhcp.cox.net","threadId":"4082","inReplyTo":"Pine.LNX.4.63.0605062358280.6357@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] fmt-patch: understand old <his> notation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-07T01:28:38Z","receivedAt":"2006-05-07T01:28:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> No, it is not too late. I did this patch only to prevent cluttering my \n> directory with millions of patches, only because I forgot _again_ to type \n> the two dots.\n\nI did that as well, and the thing is, this is _so_ fast that\nwhen I noticed and typed ^C, it already has done 400 or so\ncommits starting from the epoch (which was empty by the way).\n\nI am already working on adjusting in-tree format-patch users not\nto use <his> syntax but to use <his>.. syntax, so this should not\nbe a problem either way.\n\n>> Also we probably would want to default the diff options to show\n>> the root commit diff (rev.show_root_diff).\n\n> I gather this is needed for git-am/git-rebase to continue working?\n\nNo, but people want to export the whole history sometimes.\n"},{"id":"19633","messageId":"7v8xper56t.fsf@assigned-by-dhcp.cox.net","threadId":"4082","inReplyTo":"Pine.LNX.4.64.0605061527030.16343@g5.osdl.org","subject":"Re: [PATCH] fmt-patch: understand old <his> notation","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-07T01:31:38Z","receivedAt":"2006-05-07T01:31:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> Maybe not. I've actually cursed the fact that I made \"git diff X\" mean \n> \"diff from X to current working tree\", because it almost never makes any \n> sense at all when X is anything but \"HEAD\".\n\nActually, I do \"git diff next\" all the time while on the tip of\nmy topic branches, and also when merging a topic branch into\n\"master\".  This \"a different tree with the current working\nfiles\" is probably the second most frequently used form for me\n(the first one is of course HEAD vs working files). \n"}]}