git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFE/RFC] format-patch/diff via path
@ 2018-01-20  6:26 Randall S. Becker
  2018-01-20  7:14 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Randall S. Becker @ 2018-01-20  6:26 UTC (permalink / raw)
  To: 'git mailing list'

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----/

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.  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.

What 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

I may be just missing something obvious (new to format-patch operations myself). 

Cheers,
Randall
P.S. Bad ideas happen when tests run for a long time 😉


-- Brief whoami:
  NonStop developer since approximately NonStop(211288444200000000)
  UNIX developer since approximately 421664400
-- In my real life, I talk too much.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFE/RFC] format-patch/diff via path
  2018-01-20  6:26 [RFE/RFC] format-patch/diff via path Randall S. Becker
@ 2018-01-20  7:14 ` Junio C Hamano
  2018-01-20  7:41   ` Randall S. Becker
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2018-01-20  7:14 UTC (permalink / raw)
  To: Randall S. Becker; +Cc: 'git mailing list'

"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.

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

> 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).

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [RFE/RFC] format-patch/diff via path
  2018-01-20  7:14 ` Junio C Hamano
@ 2018-01-20  7:41   ` Randall S. Becker
  0 siblings, 0 replies; 3+ messages in thread
From: Randall S. Becker @ 2018-01-20  7:41 UTC (permalink / raw)
  To: 'Junio C Hamano'; +Cc: 'git mailing list'

On January 20, 2018 2:15 AM, Junio C Hamano wrote:
> "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. 
> 
> 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.

> > 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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-20  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-20  6:26 [RFE/RFC] format-patch/diff via path Randall S. Becker
2018-01-20  7:14 ` Junio C Hamano
2018-01-20  7:41   ` Randall S. Becker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).