> From: Paul Smith <p...@mad-scientist.net>

> I know about "git branch --contains" but that checks ALL the branches to
> see if the commit is on any them, and with the number of branches we
> have that takes a non-trivial amount of time.  Since this is in a push
> hook I really need it to be as fast as possible, and it seems to me that
> if I could ask for just a specific branch, "is this commit on this
> specific branch" rather than "what are all the branches this commit is
> on", it would be faster.

I think this works:

$ git-rev-list HEAD..commit

The output will be empty if commit is an ancestor of HEAD and
non-empty if not (due to the definition of '..').


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to