{"thread":{"id":"47652","subject":"[RFE/RFC] format-patch/diff via path","startedAt":"2018-01-20T06:26:12Z","lastAt":"2018-01-20T07:41:49Z","messageCount":3,"participants":["Randall S. Becker","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"336969","messageId":"018601d391b7$8e8686a0$ab9393e0$@nexbridge.com","threadId":"47652","inReplyTo":null,"subject":"[RFE/RFC] format-patch/diff via path","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2018-01-20T06:26:02Z","receivedAt":"2018-01-20T06:26:12Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"I’m still a bit perplexed by some behaviour seen today, and am looking for a clean way to deal with it that the documentation does not make clear. So, I’m asking in a different way. Suppose a graph of\n\nA---B---C---D---E\n\\      \\               /\n  \\----F—G----/\n\nWhen trying to perform a format-patch from B to E, I was seeing commits B-A-F-G-E rather than what I wanted B-C-D-E.  F and G were younger commits than C and D, which I assume (very likely wrongly) is why diff was giving preferential treatment to that path.\n\nWhat I am trying to figure out is whether there is a clean way to force format-patch along the B-C-D-E path. If not, would it be worth starting up a small project to make this possible (not knowing exactly where to start), but I would envision something like: git format-patch –via=C B..E\n\nI may be just missing something obvious (new to format-patch operations myself). \n\nCheers,\nRandall\nP.S. Bad ideas happen when tests run for a long time 😉\n\n\n-- Brief whoami:\n  NonStop developer since approximately NonStop(211288444200000000)\n  UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n\n\n"},{"id":"336971","messageId":"xmqqinbxngra.fsf@gitster.mtv.corp.google.com","threadId":"47652","inReplyTo":"018601d391b7$8e8686a0$ab9393e0$@nexbridge.com","subject":"Re: [RFE/RFC] format-patch/diff via path","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-01-20T07:14:49Z","receivedAt":"2018-01-20T07:14:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n\n> I’m still a bit perplexed by some behaviour seen today, and am looking for a clean way to deal with it that the documentation does not make clear. So, I’m asking in a different way. Suppose a graph of\n>\n> A---B---C---D---E\n> \\      \\               /\n>   \\----F—G----/\n>\n\nAn ASCII art that is not drawn for fixed-width font is by definition\nunderstandable only by the person who drew it X-<.  I am guessing\nthat F is a child of both A and B (but I am not sure, as I do not\nsee a reason why it should even be a merge to begin with, so my\nguess is likely to be wrong), and E is a merge between D and G.\n\nIOW, I am guessing that the below is the equivalent of what you drew\nfor those who look at the picture in fixed-width font:\n\n    A---B---C---D---E\n     \\   \\         /\n      .---F-------G\n\n> When trying to perform a format-patch from B to E, I was seeing\n> commits B-A-F-G-E rather than what I wanted B-C-D-E.\n\nAssuming that E is a merge, format-patch output should not show E\nanyway (i.e. think in terms of \"git log --no-merges --reverse\",\ninstead of fearing that format-patch is somehow more magical---it is\nnot).  So if you want to show the comit B, C and D (meaning three\npatches, i.e. \"diff A B\", \"diff B C\", and \"diff C D\"), then you\nwould do \"format-patch A..D\", not \"format-patch A..E\".  If you meant\nthat you are not interested in the change between A and B, then the\nrange would be \"B..D\" instead of \"A..D\".  Ending the range at \"E\"\nmeans you want to see what is reachable from E, and unless you say\nyou are not interested in G, you would get G, if you only say you\nare not interested in A (or B), as G is not reachable from A (or B).\n\nIt is unclear how you told format-patch when \"trying to perform a\nformat-patch from B to E\" from your description, but if you said\n\"format-patch A^..E\", it is likely that you would have seen all\ncommits in the depicted part of the graph except for merge commits.\n"},{"id":"336972","messageId":"018c01d391c2$164eeaf0$42ecc0d0$@nexbridge.com","threadId":"47652","inReplyTo":"xmqqinbxngra.fsf@gitster.mtv.corp.google.com","subject":"RE: [RFE/RFC] format-patch/diff via path","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2018-01-20T07:41:25Z","receivedAt":"2018-01-20T07:41:49Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 20, 2018 2:15 AM, Junio C Hamano wrote:\n> \"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n> \n> > I’m still a bit perplexed by some behaviour seen today, and am looking\n> > for a clean way to deal with it that the documentation does not make\n> > clear. So, I’m asking in a different way. Suppose a graph of\n> >\n> > A---B---C---D---E\n> > \\      \\               /\n> >   \\----F—G----/\n> >\n> \n> An ASCII art that is not drawn for fixed-width font is by definition\n> understandable only by the person who drew it X-<.  I am guessing that F is a\n> child of both A and B (but I am not sure, as I do not see a reason why it\n> should even be a merge to begin with, so my guess is likely to be wrong), and\n> E is a merge between D and G.\n\nMy bad... outlook... and user. \n> \n> IOW, I am guessing that the below is the equivalent of what you drew for\n> those who look at the picture in fixed-width font:\n> \n>     A---B---C---D---E\n>      \\   \\         /\n>       .---F-------G\n\nAs unintelligible, X-<, but you are probably correct.\n\n> > When trying to perform a format-patch from B to E, I was seeing\n> > commits B-A-F-G-E rather than what I wanted B-C-D-E.\n> \n> Assuming that E is a merge, format-patch output should not show E anyway\n> (i.e. think in terms of \"git log --no-merges --reverse\", instead of fearing that\n> format-patch is somehow more magical---it is not).  So if you want to show\n> the comit B, C and D (meaning three patches, i.e. \"diff A B\", \"diff B C\", and\n> \"diff C D\"), then you would do \"format-patch A..D\", not \"format-patch A..E\".\n> If you meant that you are not interested in the change between A and B,\n> then the range would be \"B..D\" instead of \"A..D\".  Ending the range at \"E\"\n> means you want to see what is reachable from E, and unless you say you are\n> not interested in G, you would get G, if you only say you are not interested in\n> A (or B), as G is not reachable from A (or B).\n\nWhile the end point, E was the same regardless of which path, I was interested in submitting the patches along B..E. A is the parent of B and F and was included in the format-patch, which then forward through F and G then E.\n\n> It is unclear how you told format-patch when \"trying to perform a format-\n> patch from B to E\" from your description, but if you said \"format-patch\n> A^..E\", it is likely that you would have seen all commits in the depicted part\n> of the graph except for merge commits.\n\nThat seems to be the case. I used format-patch B..E with no other args. A was not specified but got drawn in. D-E was a merge so is that why that path wasn't selected? I'd still like to be able to include merges - is that a dream?\n\n"}]}