[cmake-developers] Good way to track whether a branch has been merged into master ?

Michael Wild themiwi at gmail.com
Sun Sep 19 13:07:09 EDT 2010


On 19. Sep, 2010, at 18:52 , David Cole wrote:

> On Sun, Sep 19, 2010 at 5:15 AM, Michael Wild <themiwi at gmail.com> wrote:
> 
>> 
>> On 19. Sep, 2010, at 11:03 , Alexander Neundorf wrote:
>> 
>>> Hi,
>>> 
>>> I'm currently cleaning up my local CMake branches.
>>> What is a good way to find out whether some branch has been merged into
>>> master ? Right now I was looking through "git log" to see whether the
>> commits
>>> are in master.
>>> 
>>> Alex
>> 
>> Many options come to mind:
>> 
>> 1. just try to delete the branch with 'git branch -d <branch>'. Git will
>> refuse to delete it if the branch hasn't been merged.
>> 2. 'git merge-base <branch1> <branch2>' shows the last merge point, or if
>> that doesn't exist the branching point.
>> 3. 'git show-branch <branch1> <branch2>' shows the history of both branches
>> since the last merge (that's the default, you can show more if you want).
>> 4. 'git log <branch1>..<branch2>' shows all commits in <branch2> that are
>> not in <branch1>.
>> 
>> HTH
>> 
>> Michael
>> 
>> --
>> There is always a well-known solution to every human problem -- neat,
>> plausible, and wrong.
>> H. L. Mencken
>> 
>> 
>> _______________________________________________
>> cmake-developers mailing list
>> cmake-developers at cmake.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>> 
>> 
> I would use:
> git branch --contains <commit>
> 
> to find out if a given commit is reachable from a given branch.


Ahh, very useful. There's always something new to discover with git. Sometimes I think that git really has an issue with the enormous size of it's UI ;-)

--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100919/73f22660/attachment.sig>


More information about the cmake-developers mailing list