Re: can I get only the list of merges?
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jul 10, 2006, 18:09 UTC
- Message-ID
- <Pine.LNX.4.64.0607101103160.5623@g5.osdl.org>
- In-Reply-To
- <E1FzzlS-0003JE-9C@moooo.ath.cx>
On Mon, 10 Jul 2006, Matthias Lederhofer wrote:
Show 11 quoted lines
> Diego Calleja <diegocg@gmail.com> wrote:
> > Hi, git-log and git-rev-list and friends have a --no-merges option. However,
> > I need the contrary functionality: a sort of "--only-merges" way of getting
> > the log? (that is, without parsing manually the git-log output)
>
> Perhaps something like this? It finds all commits with more than one
> parent (I dunno if there are any other commits that have more than one
> parent)
> git-rev-list --parents HEAD | \
> grep -E '^([a-z0-9]{40} ){2}[a-z0-9]{40}' | \
> cut -d ' ' -f 1Well, the above is the "proper" way of doing things, and is efficient and gives the right answer. However, if you want a _sneaky_ way of doing it, and want a graphical result, and have a recent version of git, you can also just do something like
gitk --full-history -- %%nonexistant-file%%
which will give you each commit that changes that nonexistant file (there should be none ;), and the full commit history for those (ie all the merges).
(If you use "git log", you also need to add "--parents" while gitk will do it for you).
Linus