* can I get only the list of merges?
@ 2006-07-10 17:26 Diego Calleja
2006-07-10 17:41 ` Matthias Lederhofer
2006-07-10 17:57 ` [PATCH] git-rev-list: add documentation for --parents, --no-merges Matthias Lederhofer
0 siblings, 2 replies; 6+ messages in thread
From: Diego Calleja @ 2006-07-10 17:26 UTC (permalink / raw)
To: git
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)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: can I get only the list of merges?
2006-07-10 17:26 can I get only the list of merges? Diego Calleja
@ 2006-07-10 17:41 ` Matthias Lederhofer
2006-07-10 18:09 ` Linus Torvalds
2006-07-10 22:37 ` Johannes Schindelin
2006-07-10 17:57 ` [PATCH] git-rev-list: add documentation for --parents, --no-merges Matthias Lederhofer
1 sibling, 2 replies; 6+ messages in thread
From: Matthias Lederhofer @ 2006-07-10 17:41 UTC (permalink / raw)
To: Diego Calleja; +Cc: git
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 1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: can I get only the list of merges?
2006-07-10 17:41 ` Matthias Lederhofer
@ 2006-07-10 18:09 ` Linus Torvalds
2006-07-10 18:51 ` Linus Torvalds
2006-07-10 22:37 ` Johannes Schindelin
1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2006-07-10 18:09 UTC (permalink / raw)
To: Matthias Lederhofer; +Cc: Diego Calleja, git
On Mon, 10 Jul 2006, Matthias Lederhofer wrote:
> 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 1
Well, 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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: can I get only the list of merges?
2006-07-10 18:09 ` Linus Torvalds
@ 2006-07-10 18:51 ` Linus Torvalds
0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2006-07-10 18:51 UTC (permalink / raw)
To: Matthias Lederhofer; +Cc: Diego Calleja, git
On Mon, 10 Jul 2006, Linus Torvalds wrote:
>
> 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).
Btw, a better way to do the same is probably
gitk --full-history -- a//b
which is guaranteed to not match any files and doesn't depend on just an
_unlikely_ filename. Instead, it depends on the fact that a name with a
double slash should not exist in a git archive.
(There are other possibilities too - instead of "a//a", you can just use
the filename ".git", for the same reasons - it definitely won't be tracked
by git).
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: can I get only the list of merges?
2006-07-10 17:41 ` Matthias Lederhofer
2006-07-10 18:09 ` Linus Torvalds
@ 2006-07-10 22:37 ` Johannes Schindelin
1 sibling, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2006-07-10 22:37 UTC (permalink / raw)
To: Matthias Lederhofer; +Cc: Diego Calleja, git
Hi,
On Mon, 10 Jul 2006, Matthias Lederhofer wrote:
> git-rev-list --parents HEAD | \
> grep -E '^([a-z0-9]{40} ){2}[a-z0-9]{40}' | \
Since the output of git-rev-list is well-defined, you could say
grep '.{121}'
instead. (Instead of 121, you could take any number between 83 and 122.)
Ciao,
Dscho
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] git-rev-list: add documentation for --parents, --no-merges
2006-07-10 17:26 can I get only the list of merges? Diego Calleja
2006-07-10 17:41 ` Matthias Lederhofer
@ 2006-07-10 17:57 ` Matthias Lederhofer
1 sibling, 0 replies; 6+ messages in thread
From: Matthias Lederhofer @ 2006-07-10 17:57 UTC (permalink / raw)
To: git
---
Btw: grep -E ' .* ' should work too.
Documentation/git-rev-list.txt | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index e220842..f60eacd 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -56,6 +56,9 @@ OPTIONS
Print the contents of the commit in raw-format; each
record is separated with a NUL character.
+--parents::
+ Print the parents of the commit.
+
--objects::
Print the object IDs of any object referenced by the listed commits.
'git-rev-list --objects foo ^bar' thus means "send me all object IDs
@@ -102,6 +105,9 @@ OPTIONS
--remove-empty::
Stop when a given path disappears from the tree.
+--no-merges::
+ Do not print commits with more than one parent.
+
--not::
Reverses the meaning of the '{caret}' prefix (or lack
thereof) for all following revision specifiers, up to
--
1.4.1.gf157-dirty
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-07-10 22:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-10 17:26 can I get only the list of merges? Diego Calleja
2006-07-10 17:41 ` Matthias Lederhofer
2006-07-10 18:09 ` Linus Torvalds
2006-07-10 18:51 ` Linus Torvalds
2006-07-10 22:37 ` Johannes Schindelin
2006-07-10 17:57 ` [PATCH] git-rev-list: add documentation for --parents, --no-merges Matthias Lederhofer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox