git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Walking children commits?
@ 2015-03-30 23:02 Mike Hommey
  2015-03-30 23:35 ` Mike Hommey
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2015-03-30 23:02 UTC (permalink / raw)
  To: git

Hi,

I am trying to get all the children commits of a set of commits. To do
that, I'm using this:

  git rev-list --topo-order --ancestry-path --boundary <all heads> ^A ^B ...

where A, B, and following are those commits I want the children of. From
the gitrevisions documentation, it seems that should get me what I want,
but if I build a dag manually (from the output of rev-list --parents)
and get all the children of those commits, I get more results than what
the command above returns (and that command also gives false positives).

Am I doing something wrong, or am I hitting a bug in --ancestry-path
walking? In the latter case, I'll try to find a reduced test case,
because currently, this involves a 260k commit, 1.5GB repository with
close to 2k heads and a set of 153 commits to find the children of.

Cheers,

Mike

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

* Re: Walking children commits?
  2015-03-30 23:02 Walking children commits? Mike Hommey
@ 2015-03-30 23:35 ` Mike Hommey
  2015-03-30 23:44   ` Mike Hommey
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2015-03-30 23:35 UTC (permalink / raw)
  To: git

On Tue, Mar 31, 2015 at 08:02:09AM +0900, Mike Hommey wrote:
> Hi,
> 
> I am trying to get all the children commits of a set of commits. To do
> that, I'm using this:
> 
>   git rev-list --topo-order --ancestry-path --boundary <all heads> ^A ^B ...
> 
> where A, B, and following are those commits I want the children of. From
> the gitrevisions documentation, it seems that should get me what I want,
> but if I build a dag manually (from the output of rev-list --parents)
> and get all the children of those commits, I get more results than what
> the command above returns (and that command also gives false positives).

The false positives are actually boundaries other than A, B, etc. so I'd
actually need to remove --boundary and add A, B to the result manually.
That still leaves the missing results, though.

Mike

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

* Re: Walking children commits?
  2015-03-30 23:35 ` Mike Hommey
@ 2015-03-30 23:44   ` Mike Hommey
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Hommey @ 2015-03-30 23:44 UTC (permalink / raw)
  To: git

On Tue, Mar 31, 2015 at 08:35:52AM +0900, Mike Hommey wrote:
> On Tue, Mar 31, 2015 at 08:02:09AM +0900, Mike Hommey wrote:
> > Hi,
> > 
> > I am trying to get all the children commits of a set of commits. To do
> > that, I'm using this:
> > 
> >   git rev-list --topo-order --ancestry-path --boundary <all heads> ^A ^B ...
> > 
> > where A, B, and following are those commits I want the children of. From
> > the gitrevisions documentation, it seems that should get me what I want,
> > but if I build a dag manually (from the output of rev-list --parents)
> > and get all the children of those commits, I get more results than what
> > the command above returns (and that command also gives false positives).
> 
> The false positives are actually boundaries other than A, B, etc. so I'd
> actually need to remove --boundary and add A, B to the result manually.
> That still leaves the missing results, though.

Ah, the missing results are commits that both are part of the set of
commits and are heads...
So all in all --ancestry-path works for my use case, but I need
post-processing.

Mike

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

end of thread, other threads:[~2015-03-30 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 23:02 Walking children commits? Mike Hommey
2015-03-30 23:35 ` Mike Hommey
2015-03-30 23:44   ` Mike Hommey

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 NNTP newsgroup(s).