2005-05-10 23:32:30 +02:00
|
|
|
git-rev-list(1)
|
|
|
|
===============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
git-rev-list - Lists commit objects in reverse chronological order
|
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2005-12-31 18:37:15 +01:00
|
|
|
[verse]
|
2010-10-08 19:31:15 +02:00
|
|
|
'git rev-list' [ \--max-count=<number> ]
|
|
|
|
[ \--skip=<number> ]
|
|
|
|
[ \--max-age=<timestamp> ]
|
|
|
|
[ \--min-age=<timestamp> ]
|
2005-12-31 18:37:15 +01:00
|
|
|
[ \--sparse ]
|
2009-07-13 17:11:44 +02:00
|
|
|
[ \--merges ]
|
2005-12-31 18:37:15 +01:00
|
|
|
[ \--no-merges ]
|
2011-03-23 10:38:51 +01:00
|
|
|
[ \--min-parents=<number> ]
|
|
|
|
[ \--no-min-parents ]
|
|
|
|
[ \--max-parents=<number> ]
|
|
|
|
[ \--no-max-parents ]
|
2007-12-27 01:04:05 +01:00
|
|
|
[ \--first-parent ]
|
2006-01-27 10:39:24 +01:00
|
|
|
[ \--remove-empty ]
|
2007-06-16 21:03:43 +02:00
|
|
|
[ \--full-history ]
|
2006-07-02 01:29:37 +02:00
|
|
|
[ \--not ]
|
2005-12-31 18:37:15 +01:00
|
|
|
[ \--all ]
|
2010-10-08 19:31:15 +02:00
|
|
|
[ \--branches[=<pattern>] ]
|
|
|
|
[ \--tags[=<pattern>] ]
|
|
|
|
[ \--remotes[=<pattern>] ]
|
|
|
|
[ \--glob=<glob-pattern> ]
|
2011-05-19 03:08:09 +02:00
|
|
|
[ \--ignore-missing ]
|
2006-09-06 06:39:02 +02:00
|
|
|
[ \--stdin ]
|
2007-11-11 08:29:41 +01:00
|
|
|
[ \--quiet ]
|
2006-03-01 00:07:20 +01:00
|
|
|
[ \--topo-order ]
|
2005-12-31 18:37:15 +01:00
|
|
|
[ \--parents ]
|
2007-06-16 21:03:42 +02:00
|
|
|
[ \--timestamp ]
|
2007-04-05 16:53:07 +02:00
|
|
|
[ \--left-right ]
|
2011-02-21 17:09:12 +01:00
|
|
|
[ \--left-only ]
|
|
|
|
[ \--right-only ]
|
2011-03-07 13:31:41 +01:00
|
|
|
[ \--cherry-mark ]
|
2007-04-11 00:28:32 +02:00
|
|
|
[ \--cherry-pick ]
|
2013-08-03 00:16:40 +02:00
|
|
|
[ \--encoding=<encoding> ]
|
2006-09-18 02:23:20 +02:00
|
|
|
[ \--(author|committer|grep)=<pattern> ]
|
2008-09-30 19:27:10 +02:00
|
|
|
[ \--regexp-ignore-case | -i ]
|
|
|
|
[ \--extended-regexp | -E ]
|
|
|
|
[ \--fixed-strings | -F ]
|
2014-08-29 18:58:42 +02:00
|
|
|
[ \--date=(local|relative|default|iso|iso-strict|rfc|short) ]
|
2014-12-25 00:05:39 +01:00
|
|
|
[ [ \--objects | \--objects-edge | \--objects-edge-aggressive ]
|
|
|
|
[ \--unpacked ] ]
|
2005-12-31 18:37:15 +01:00
|
|
|
[ \--pretty | \--header ]
|
|
|
|
[ \--bisect ]
|
2007-03-22 06:15:54 +01:00
|
|
|
[ \--bisect-vars ]
|
2007-10-22 07:48:11 +02:00
|
|
|
[ \--bisect-all ]
|
2006-08-04 10:11:15 +02:00
|
|
|
[ \--merge ]
|
2007-01-20 23:04:02 +01:00
|
|
|
[ \--reverse ]
|
2007-01-20 09:51:41 +01:00
|
|
|
[ \--walk-reflogs ]
|
2007-07-24 01:38:40 +02:00
|
|
|
[ \--no-walk ] [ \--do-walk ]
|
rev-list: add bitmap mode to speed up object lists
The bitmap reachability index used to speed up the counting objects
phase during `pack-objects` can also be used to optimize a normal
rev-list if the only thing required are the SHA1s of the objects during
the list (i.e., not the path names at which trees and blobs were found).
Calling `git rev-list --objects --use-bitmap-index [committish]` will
perform an object iteration based on a bitmap result instead of actually
walking the object graph.
These are some example timings for `torvalds/linux` (warm cache,
best-of-five):
$ time git rev-list --objects master > /dev/null
real 0m34.191s
user 0m33.904s
sys 0m0.268s
$ time git rev-list --objects --use-bitmap-index master > /dev/null
real 0m1.041s
user 0m0.976s
sys 0m0.064s
Likewise, using `git rev-list --count --use-bitmap-index` will speed up
the counting operation by building the resulting bitmap and performing a
fast popcount (number of bits set on the bitmap) on the result.
Here are some sample timings of different ways to count commits in
`torvalds/linux`:
$ time git rev-list master | wc -l
399882
real 0m6.524s
user 0m6.060s
sys 0m3.284s
$ time git rev-list --count master
399882
real 0m4.318s
user 0m4.236s
sys 0m0.076s
$ time git rev-list --use-bitmap-index --count master
399882
real 0m0.217s
user 0m0.176s
sys 0m0.040s
This also respects negative refs, so you can use it to count
a slice of history:
$ time git rev-list --count v3.0..master
144843
real 0m1.971s
user 0m1.932s
sys 0m0.036s
$ time git rev-list --use-bitmap-index --count v3.0..master
real 0m0.280s
user 0m0.220s
sys 0m0.056s
Though note that the closer the endpoints, the less it helps. In the
traversal case, we have fewer commits to cross, so we take less time.
But the bitmap time is dominated by generating the pack revindex, which
is constant with respect to the refs given.
Note that you cannot yet get a fast --left-right count of a symmetric
difference (e.g., "--count --left-right master...topic"). The slow part
of that walk actually happens during the merge-base determination when
we parse "master...topic". Even though a count does not actually need to
know the real merge base (it only needs to take the symmetric difference
of the bitmaps), the revision code would require some refactoring to
handle this case.
Additionally, a `--test-bitmap` flag has been added that will perform
the same rev-list manually (i.e. using a normal revwalk) and using
bitmaps, and verify that the results are the same. This can be used to
exercise the bitmap code, and also to verify that the contents of the
.bitmap file are sane.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-21 15:00:12 +01:00
|
|
|
[ \--use-bitmap-index ]
|
2005-12-31 18:37:15 +01:00
|
|
|
<commit>... [ \-- <paths>... ]
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2006-09-01 00:37:15 +02:00
|
|
|
|
2009-08-05 18:42:33 +02:00
|
|
|
List commits that are reachable by following the `parent` links from the
|
|
|
|
given commit(s), but exclude commits that are reachable from the one(s)
|
|
|
|
given with a '{caret}' in front of them. The output is given in reverse
|
|
|
|
chronological order by default.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2009-08-05 18:42:33 +02:00
|
|
|
You can think of this as a set operation. Commits given on the command
|
|
|
|
line form a set of commits that are reachable from any of them, and then
|
|
|
|
commits reachable from any of the ones given with '{caret}' in front are
|
|
|
|
subtracted from that set. The remaining commits are what comes out in the
|
|
|
|
command's output. Various other options and paths parameters can be used
|
|
|
|
to further limit the result.
|
|
|
|
|
|
|
|
Thus, the following command:
|
2006-09-01 00:37:15 +02:00
|
|
|
|
|
|
|
-----------------------------------------------------------------------
|
2008-06-30 08:09:04 +02:00
|
|
|
$ git rev-list foo bar ^baz
|
2006-09-01 00:37:15 +02:00
|
|
|
-----------------------------------------------------------------------
|
|
|
|
|
2009-08-05 18:42:33 +02:00
|
|
|
means "list all the commits which are reachable from 'foo' or 'bar', but
|
|
|
|
not from 'baz'".
|
2005-07-29 20:10:46 +02:00
|
|
|
|
2006-09-01 00:37:15 +02:00
|
|
|
A special notation "'<commit1>'..'<commit2>'" can be used as a
|
|
|
|
short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
|
|
|
|
the following may be used interchangeably:
|
2005-10-30 10:03:45 +01:00
|
|
|
|
2006-09-01 00:37:15 +02:00
|
|
|
-----------------------------------------------------------------------
|
2008-06-30 08:09:04 +02:00
|
|
|
$ git rev-list origin..HEAD
|
|
|
|
$ git rev-list HEAD ^origin
|
2006-09-01 00:37:15 +02:00
|
|
|
-----------------------------------------------------------------------
|
|
|
|
|
|
|
|
Another special notation is "'<commit1>'...'<commit2>'" which is useful
|
|
|
|
for merges. The resulting set of commits is the symmetric difference
|
2006-07-02 01:29:37 +02:00
|
|
|
between the two operands. The following two commands are equivalent:
|
|
|
|
|
2006-09-01 00:37:15 +02:00
|
|
|
-----------------------------------------------------------------------
|
2008-06-30 08:09:04 +02:00
|
|
|
$ git rev-list A B --not $(git merge-base --all A B)
|
|
|
|
$ git rev-list A...B
|
2006-09-01 00:37:15 +02:00
|
|
|
-----------------------------------------------------------------------
|
|
|
|
|
2013-01-21 20:17:53 +01:00
|
|
|
'rev-list' is a very essential Git command, since it
|
2006-09-01 00:37:15 +02:00
|
|
|
provides the ability to build and traverse commit ancestry graphs. For
|
|
|
|
this reason, it has a lot of different options that enables it to be
|
2010-01-10 00:33:00 +01:00
|
|
|
used by commands as different as 'git bisect' and
|
|
|
|
'git repack'.
|
2005-10-30 10:03:45 +01:00
|
|
|
|
2005-10-03 19:16:30 +02:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2006-09-01 00:37:15 +02:00
|
|
|
|
2008-01-18 23:58:57 +01:00
|
|
|
:git-rev-list: 1
|
|
|
|
include::rev-list-options.txt[]
|
2007-05-14 01:25:45 +02:00
|
|
|
|
|
|
|
include::pretty-formats.txt[]
|
|
|
|
|
2005-05-10 23:32:30 +02:00
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 09:07:32 +02:00
|
|
|
Part of the linkgit:git[1] suite
|