git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [RFE/RFC] format-patch/diff via path

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Jan 20, 2018, 07:41 UTC
Message-ID
<018c01d391c2$164eeaf0$42ecc0d0$@nexbridge.com>
In-Reply-To
<xmqqinbxngra.fsf@gitster.mtv.corp.google.com>
On January 20, 2018 2:15 AM, Junio C Hamano wrote:
Show 16 quoted lines
> "Randall S. Becker" <rsbecker@nexbridge.com> writes:
> 
> > 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
> >
> > A---B---C---D---E
> > \      \               /
> >   \----F—G----/
> >
> 
> An ASCII art that is not drawn for fixed-width font is by definition
> understandable only by the person who drew it X-<.  I am guessing that F is a
> child of both A and B (but I am not sure, as I do not see a reason why it
> should even be a merge to begin with, so my guess is likely to be wrong), and
> E is a merge between D and G.
My bad... outlook... and user. 
Show 7 quoted lines
> 
> IOW, I am guessing that the below is the equivalent of what you drew for
> those who look at the picture in fixed-width font:
> 
>     A---B---C---D---E
>      \   \         /
>       .---F-------G
As unintelligible, X-<, but you are probably correct.
Show 13 quoted lines
> > When 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.
> 
> Assuming that E is a merge, format-patch output should not show E anyway
> (i.e. think in terms of "git log --no-merges --reverse", instead of fearing that
> format-patch is somehow more magical---it is not).  So if you want to show
> the comit B, C and D (meaning three patches, i.e. "diff A B", "diff B C", and
> "diff C D"), then you would do "format-patch A..D", not "format-patch A..E".
> If you meant that you are not interested in the change between A and B,
> then the range would be "B..D" instead of "A..D".  Ending the range at "E"
> means you want to see what is reachable from E, and unless you say you are
> not interested in G, you would get G, if you only say you are not interested in
> A (or B), as G is not reachable from A (or B).
While 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.
> It is unclear how you told format-patch when "trying to perform a format-
> patch from B to E" from your description, but if you said "format-patch
> A^..E", it is likely that you would have seen all commits in the depicted part
> of the graph except for merge commits.
That 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?
Previous: Junio C Hamano
Message 3 of 3 in “[RFE/RFC] format-patch/diff via path”
  1. Randall S. BeckerJan 20, 2018
  2. Junio C HamanoJan 20, 2018
  3. Randall S. BeckerJan 20, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.