Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know if a branch has already been merged in SVN/Mercurial/Git?

Is there any way of easily deciphering (i.e. at a glance) whether or not a branch has already previously been merged with the another branch or the trunk? The nearest I've been able to figure out is by looking at the commit notes and displaying the merged commit notes. The disadvantage with this seems to be that unless you know which branch the commit notes are imported from, there's no way to decipher which branches have already been merged or not.

Edit: Is Mercurial or Git any more intuitive than SVN for this?

like image 451
BobTheBuilder Avatar asked Oct 25 '09 15:10

BobTheBuilder


1 Answers

Is Mercurial or Git any more intuitive than SVN for this?

Yes, very much so:

sjl at ecgtheow in ~/src/hg-review on webui at tip
[10] $ hg glog
@  changeset: 113:c5debb475273 Steve Losh tip webui
|  summary:   Add file folding.
|
o  changeset: 112:a3ad66636756 Steve Losh  webui
|  summary:   Show skipped-line comments.
|
o  changeset: 111:2e65351af702 Steve Losh  webui
|  summary:   Rough cut of line-level comments.
|
| o  changeset: 110:b599ca22418d Steve Losh  
|/|  summary:   Merge the bug fix.
| |
o |  changeset: 109:e2ddb8631463 Steve Losh  webui
| |  summary:   Fix the event not defined bug.
| |
| o  changeset: 108:001f5ecfd9bc Steve Losh  
|/|  summary:   Merge the webui skipped line counts -- too important to leave in the
| |             branch.
| |
o |  changeset: 107:1cc8e18b1b43 Steve Losh  webui
| |  summary:   Add skipped line counts to diffs.
| |

EDIT: Git has a git log --graph option that's pretty much the same as Mercurial's, except without the helpful you-are-here @ character.

like image 179
Steve Losh Avatar answered Nov 15 '22 06:11

Steve Losh