Find out on which branch a commit was originally made

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

 



I'm trying to pursuade my co-workers to switch from Subversion to Git;
some of them prefer Mercurial.

One concern that they are raising is that in Git there doesn't seem to
be an easy way to find out on which branch a given commit was originally
made, after the branch is merged back and deleted. They consider this a
show-stopper.  In Mercurial, branch information is meta data attached to
each commit, so you can easily get this information even after a branch
is closed.

Three questions:

1) Is this not something that Git users miss sometimes?  Why not?

2) Is there an easy way to get this information that I might have
missed?  (Typical use-case: you blame a line of code with git gui blame,
choose "Show history context" to show the changeset in gitk, and from
there you want to go up to the next merge commit to see if the merge
commit message mentions the name of the branch. I can't seem to figure
out how to find this merge commit in gitk, and besides, "Show history
context" shows me only 7 days of context by default, so the merge commit
is likely not to be in my current list anyway.)

3) As a possible work-around, they suggest to require encoding the
branch information in some format in the commit messages, maybe
automatically with a commit-msg hook.  Does this sound like a feasible
idea?  One drawback would be that it becomes awkward when you
accidentally make a commit on the wrong branch, and want to rebase it
onto the correct one.

Any insights and thoughts about this are much appreciated.

Thanks,
   Stefan


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
--
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]