Finding a branch point in git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

When discussing git vs. mercurial, and what can mercurial do that git
can't, I inevitably see somebody mention that mercurial branches can
be used to find the branch point (the point at which a branch started;
even if it's a long-lived one that has been merged to 'master'
multiple times).

There have been a few solutions in stackoverflow[1], but none that
work in all cases.

But I think I've found an ad-hoc one that uses the commit messages to
find the first merge of a branch, and then the merge-base.

For reference, if somebody is interested:

---
[alias]
    branch-point = !sh -c 'merge=$(git rev-list --min-parents=2
--grep="Merge.*$1" --all | tail -1) && git merge-base $merge^1
$merge^2'
---

Cheers.

[1] http://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git/

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]