1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-10 01:46:15 +02:00
Commit Graph

237 Commits

Author SHA1 Message Date
Jeff King 2aea7a51a1 rev-list: make it obvious that we do not support notes
The rev-list command does not have the internal
infrastructure to display notes. Running:

  git rev-list --notes HEAD

will silently ignore the "--notes" option. Running:

  git rev-list --notes --grep=. HEAD

will crash on an assert. Running:

  git rev-list --format=%N HEAD

will place a literal "%N" in the output (it does not even
expand to an empty string).

Let's have rev-list tell the user that it cannot fill the
user's request, rather than silently producing wrong data.
Likewise, let's remove mention of the notes options from the
rev-list documentation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-24 10:33:15 -07:00
Jeff King aa1462cc3d introduce "format" date-mode
This feeds the format directly to strftime. Besides being a
little more flexible, the main advantage is that your system
strftime may know more about your locale's preferred format
(e.g., how to spell the days of the week).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-29 11:39:10 -07:00
Junio C Hamano 3f5872603d Merge branch 'mg/show-notes-doc'
Documentation fix.

* mg/show-notes-doc:
  rev-list-options.txt: complete sentence about notes matching
2015-04-28 13:00:20 -07:00
Michael J Gruber 7348cdeb6c rev-list-options.txt: complete sentence about notes matching
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-04-17 10:30:51 -07:00
Junio C Hamano dbd04eba01 Merge branch 'dj/log-graph-with-no-walk'
"git log --graph --no-walk A B..." is a otcnflicting request that
asks nonsense; no-walk tells us show discrete points in the
history, while graph asks to draw connections between these
discrete points. Forbid the combination.

* dj/log-graph-with-no-walk:
  revision: forbid combining --graph and --no-walk
2015-03-25 12:54:22 -07:00
Junio C Hamano 257b204f25 Merge branch 'kd/rev-list-bisect-first-parent'
"git rev-list --bisect --first-parent" does not work (yet) and can
even cause SEGV; forbid it.  "git log --bisect --first-parent"
would not be useful until "git bisect --first-parent" materializes,
so it is also forbidden for now.

* kd/rev-list-bisect-first-parent:
  rev-list: refuse --first-parent combined with --bisect
2015-03-25 12:54:21 -07:00
Kevin Daudt f88851c637 rev-list: refuse --first-parent combined with --bisect
rev-list --bisect is used by git bisect, but never together with
--first-parent. Because rev-list --bisect together with --first-parent
is not handled currently, and even leads to segfaults, refuse to use
both options together.

Because this is not supported, it makes little sense to use git log
--bisect --first parent either, because refs/heads/bad is not limited to
the first parent chain.

Helped-by: Junio C. Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-19 15:26:21 -07:00
Dongcan Jiang 695985f483 revision: forbid combining --graph and --no-walk
Because "--graph" is about connected history while --no-walk is
about discrete points, it does not make sense to allow these two
options at the same time. [1]

This change makes a few calls to "show --graph" fail in t4052, but
asking to show one commit with graph is a nonsensical thing to do.
Thus, tests on "show --graph" in t4052 have been removed [2,3].
Same tests on "show" without --graph option have already been tested
in 4052.

3 testcases have been added to test this patch.

[1]: http://article.gmane.org/gmane.comp.version-control.git/216083
[2]: http://article.gmane.org/gmane.comp.version-control.git/264950
[3]: http://article.gmane.org/gmane.comp.version-control.git/265107

Helped-By: Eric Sunshine <sunshine@sunshineco.com>
Helped-By: René Scharfe <l.s.r@web.de>
Helped-By: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Dongcan Jiang <dongcan.jiang@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-19 11:07:51 -07:00
Junio C Hamano a23069ce04 Merge branch 'jc/doc-log-rev-list-options'
"git log --help" used to show rev-list options that are irrelevant
to the "log" command.

* jc/doc-log-rev-list-options:
  Documentation: what does "git log --indexed-objects" even mean?
2015-02-17 10:15:22 -08:00
Junio C Hamano 1ba6e860b9 Merge branch 'cj/log-invert-grep'
"git log --invert-grep --grep=WIP" will show only commits that do
not have the string "WIP" in their messages.

* cj/log-invert-grep:
  log: teach --invert-grep option
2015-02-11 13:42:39 -08:00
Junio C Hamano 3cab02de50 Documentation: what does "git log --indexed-objects" even mean?
4fe10219 (rev-list: add --indexed-objects option, 2014-10-16) adds
"--indexed-objects" option to "rev-list", and it is only useful in
the context of "git rev-list" and not "git log".  There are other
object traversal options that do not make sense for "git log" that
are shown in the manual page.

Move the description of "--indexed-objects" to the object traversal
section so that it sits together with its friends "--objects",
"--objects-edge", etc. and then show them only in "git rev-list"
documentation.

Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-23 15:06:24 -08:00
Christoph Junghans 22dfa8a23d log: teach --invert-grep option
"git log --grep=<string>" shows only commits with messages that
match the given string, but sometimes it is useful to be able to
show only commits that do *not* have certain messages (e.g. "show
me ones that are not FIXUP commits").

Originally, we had the invert-grep flag in grep_opt, but because
"git grep --invert-grep" does not make sense except in conjunction
with "--files-with-matches", which is already covered by
"--files-without-matches", it was moved it to revisions structure.
To have the flag there expresses the function to the feature better.

When the newly inserted two tests run, the history would have commits
with messages "initial", "second", "third", "fourth", "fifth", "sixth"
and "Second", committed in this order.  The commits that does not match
either "th" or "Sec" is "second" and "initial". For the case insensitive
case only "initial" matches.

Signed-off-by: Christoph Junghans <ottxor@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-13 10:20:32 -08:00
brian m. carlson 2dacf26d09 pack-objects: use --objects-edge-aggressive for shallow repos
When fetching into or pushing from a shallow repository, we want to
aggressively mark edges as uninteresting, since this decreases the pack
size.  However, aggressively marking edges can negatively affect
performance on large non-shallow repositories with lots of refs.

Teach pack-objects a --shallow option to indicate that we're pushing
from or fetching into a shallow repository.  Use
--objects-edge-aggressive only for shallow repositories and otherwise
use --objects-edge, which performs better in the general case.  Update
the callers to pass the --shallow option when they are dealing with a
shallow repository.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-12-29 09:58:25 -08:00
brian m. carlson 1684c1b219 rev-list: add an option to mark fewer edges as uninteresting
In commit fbd4a70 (list-objects: mark more commits as edges in
mark_edges_uninteresting - 2013-08-16), we marked an increasing number
of edges uninteresting.  This change, and the subsequent change to make
this conditional on --objects-edge, are used by --thin to make much
smaller packs for shallow clones.

Unfortunately, they cause a significant performance regression when
pushing non-shallow clones with lots of refs (23.322 seconds vs.
4.785 seconds with 22400 refs).  Add an option to git rev-list,
--objects-edge-aggressive, that preserves this more aggressive behavior,
while leaving --objects-edge to provide more performant behavior.
Preserve the current behavior for the moment by using the aggressive
option.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-12-29 09:57:55 -08:00
brian m. carlson 8297643fcd Documentation: add missing article in rev-list-options.txt
Add the missing article "a".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-12-22 12:08:46 -08:00
Thomas Ackermann f745acb028 Documentation: typofixes
In addition to fixing trivial and obvious typos, be careful about
the following points:

 - Spell ASCII, URL and CRC in ALL CAPS;
 - Spell Linux as Capitalized;
 - Do not omit periods in "i.e." and "e.g.".

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-04 13:14:44 -08:00
Jeff King 4fe10219bc rev-list: add --indexed-objects option
There is currently no easy way to ask the revision traversal
machinery to include objects reachable from the index (e.g.,
blobs and trees that have not yet been committed). This
patch adds an option to do so.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-19 15:07:07 -07:00
Jeff King 41d018d146 rev-list: document --reflog option
This is mostly used internally, but it does not hurt to
explain it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-19 15:07:07 -07:00
Beat Bolli 466fb6742d pretty: provide a strict ISO 8601 date format
Git's "ISO" date format does not really conform to the ISO 8601
standard due to small differences, and it cannot be parsed by ISO
8601-only parsers, e.g. those of XML toolchains.

The output from "--date=iso" deviates from ISO 8601 in these ways:

  - a space instead of the `T` date/time delimiter
  - a space between time and time zone
  - no colon between hours and minutes of the time zone

Add a strict ISO 8601 date format for displaying committer and
author dates.  Use the '%aI' and '%cI' format specifiers and add
'--date=iso-strict' or '--date=iso8601-strict' date format names.

See http://thread.gmane.org/gmane.comp.version-control.git/255879 and
http://thread.gmane.org/gmane.comp.version-control.git/52414/focus=52585
for discussion.

Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-08-29 12:37:02 -07:00
Junio C Hamano d59c12d7ad Merge branch 'jl/nor-or-nand-and'
Eradicate mistaken use of "nor" (that is, essentially "nor" used
not in "neither A nor B" ;-)) from in-code comments, command output
strings, and documentations.

* jl/nor-or-nand-and:
  code and test: fix misuses of "nor"
  comments: fix misuses of "nor"
  contrib: fix misuses of "nor"
  Documentation: fix misuses of "nor"
2014-04-08 12:00:28 -07:00
Junio C Hamano b407d40933 Merge branch 'nd/log-show-linear-break'
Attempts to show where a single-strand-of-pearls break in "git log"
output.

* nd/log-show-linear-break:
  log: add --show-linear-break to help see non-linear history
  object.h: centralize object flag allocation
2014-04-03 12:38:11 -07:00
Justin Lebar a58088abe2 Documentation: fix misuses of "nor"
Signed-off-by: Justin Lebar <jlebar@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-31 15:16:22 -07:00
Nguyễn Thái Ngọc Duy 1b32decefd log: add --show-linear-break to help see non-linear history
Option explanation is in rev-list-options.txt. The interaction with -z
is left undecided.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-03-25 15:09:49 -07:00
Junio C Hamano 0f9e62e084 Merge branch 'jk/pack-bitmap'
Borrow the bitmap index into packfiles from JGit to speed up
enumeration of objects involved in a commit range without having to
fully traverse the history.

* jk/pack-bitmap: (26 commits)
  ewah: unconditionally ntohll ewah data
  ewah: support platforms that require aligned reads
  read-cache: use get_be32 instead of hand-rolled ntoh_l
  block-sha1: factor out get_be and put_be wrappers
  do not discard revindex when re-preparing packfiles
  pack-bitmap: implement optional name_hash cache
  t/perf: add tests for pack bitmaps
  t: add basic bitmap functionality tests
  count-objects: recognize .bitmap in garbage-checking
  repack: consider bitmaps when performing repacks
  repack: handle optional files created by pack-objects
  repack: turn exts array into array-of-struct
  repack: stop using magic number for ARRAY_SIZE(exts)
  pack-objects: implement bitmap writing
  rev-list: add bitmap mode to speed up object lists
  pack-objects: use bitmaps when packing objects
  pack-objects: split add_object_entry
  pack-bitmap: add support for bitmap indexes
  documentation: add documentation for the bitmap format
  ewah: compressed bitmap implementation
  ...
2014-02-27 14:01:48 -08:00
Vicent Marti aa32939fea 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-30 12:19:22 -08:00
Junio C Hamano 10167eb251 Merge branch 'jc/ref-excludes'
People often wished a way to tell "git log --branches" (and "git
log --remotes --not --branches") to exclude some local branches
from the expansion of "--branches" (similarly for "--tags", "--all"
and "--glob=<pattern>").  Now they have one.

* jc/ref-excludes:
  rev-parse: introduce --exclude=<glob> to tame wildcards
  rev-list --exclude: export add/clear-ref-exclusion and ref-excluded API
  rev-list --exclude: tests
  document --exclude option
  revision: introduce --exclude=<glob> to tame wildcards
2013-12-05 12:59:09 -08:00
Junio C Hamano a8cb37fb39 Merge branch 'jj/rev-list-options-doc'
Mark-up and grammo fixes.

* jj/rev-list-options-doc:
  Documentation/rev-list-options.txt: fix some grammatical issues and typos
  Documentation/rev-list-options.txt: fix mark-up
2013-12-03 11:41:37 -08:00
Jason St. John 19d6eb412c Documentation/rev-list-options.txt: fix some grammatical issues and typos
Various fixes:

 - fix typos (e.g. "show" -> "shown")
 - use "regular expression(s)" instead of "regexp" where appropriate
 - reword some sentences for easier reading
 - fix/improve some grammatical issues (e.g. comma usage)
 - add missing articles (e.g. "the")
 - change "E-mail" to "email"

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18 13:38:43 -08:00
Jason St. John 4528aa1aaf Documentation/rev-list-options.txt: fix mark-up
Some the labeled list entries have a blank line between the label
and the body text, and some don't.  Use the latter style for
consistency; incidentally, syntax highlighting in Vim works better
if there is no blank line there.

Typeset literal options, commands, and path names in monospace.
When using `literal string` mark-up to do so, there is no need to
escape AsciiDoc special characters with backslashes, so make sure we
don't do so.

Replace some double quotes with proper AsciiDoc quotes
(e.g. ``foo'').

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-18 13:33:55 -08:00
Jason St. John 0ffa154b5b Correct word usage of "timezone" in "Documentation" directory
"timezone" is two words, not one (i.e. "time zone" is correct).

Correct this in these files:
-- date-formats.txt
-- git-blame.txt
-- git-cvsimport.txt
-- git-fast-import.txt
-- git-svn.txt
-- gitweb.conf.txt
-- rev-list-options.txt

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-12 10:47:17 -08:00
Johannes Sixt 574d370b06 document --exclude option
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-01 13:09:19 -07:00
Junio C Hamano fb56570821 Sync with maint to grab trivial doc fixes
* maint:
  fix typo in documentation of git-svn
  Documentation/rev-list-options: add missing word in --*-parents
  log doc: the argument to --encoding is not optional
2013-08-05 13:00:20 -07:00
Torstein Hegge 5104d21fbd Documentation/rev-list-options: add missing word in --*-parents
A commit has "parent commits" or "parents", not "commits".

Signed-off-by: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05 08:47:06 -07:00
Ondřej Bílka 17b83d71d5 typofix: documentation
Signed-off-by: Ondřej Bílka <neleai@seznam.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-22 16:06:48 -07:00
Junio C Hamano e2ecd252b5 Merge branch 'mm/diff-no-patch-synonym-to-s'
"git show -s" was less discoverable than it should be.

* mm/diff-no-patch-synonym-to-s:
  Documentation/git-log.txt: capitalize section names
  Documentation: move description of -s, --no-patch to diff-options.txt
  Documentation/git-show.txt: include common diff options, like git-log.txt
  diff: allow --patch & cie to override -s/--no-patch
  diff: allow --no-patch as synonym for -s
  t4000-diff-format.sh: modernize style
2013-07-22 11:23:27 -07:00
Matthieu Moy 7b02c83463 Documentation: move description of -s, --no-patch to diff-options.txt
Technically, "-s, --no-patch" is implemented in diff.c ("git diff
--no-patch" is essentially useless, but valid). From the user point of
view, this allows the documentation to show up in "git show --help",
which is one of the most useful use of the option.

While we're there, add a sentence explaining why the option can be
useful.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Matthieu Moy d09cd15d19 diff: allow --no-patch as synonym for -s
This follows the usual convention of having a --no-foo option to negate
--foo.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Junio C Hamano 534f0e0996 Merge branch 'jc/topo-author-date-sort'
"git log" learned the "--author-date-order" option, with which the
output is topologically sorted and commits in parallel histories
are shown intermixed together based on the author timestamp.

* jc/topo-author-date-sort:
  t6003: add --author-date-order test
  topology tests: teach a helper to set author dates as well
  t6003: add --date-order test
  topology tests: teach a helper to take abbreviated timestamps
  t/lib-t6000: style fixes
  log: --author-date-order
  sort-in-topological-order: use prio-queue
  prio-queue: priority queue of pointers to structs
  toposort: rename "lifo" field
2013-07-01 12:41:23 -07:00
Junio C Hamano 81c6b38b67 log: --author-date-order
Sometimes people would want to view the commits in parallel
histories in the order of author dates, not committer dates.

Teach "topo-order" sort machinery to do so, using a commit-info slab
to record the author dates of each commit, and prio-queue to sort
them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11 15:15:21 -07:00
Kevin Bracey 143f1eafdb simplify-merges: drop merge from irrelevant side branch
Reimplement commit 4b7f53da on top of the new simplify-merges
infrastructure, tightening the condition to only consider root parents;
the original version incorrectly dropped parents that were TREESAME to
anything.

Original log message follows.

The merge simplification rule stated in 6546b59 (revision traversal:
show full history with merge simplification, 2008-07-31) still
treated merge commits too specially.  Namely, in a history with this
shape:

	---o---o---M
	          /
         x---x---x

where three 'x' were on a history completely unrelated to the main
history 'o' and do not touch any of the paths we are following, we
still said that after simplifying all of the parents of M, 'x'
(which is the leftmost 'x' that rightmost 'x simplifies down to) and
'o' (which would be the last commit on the main history that touches
the paths we are following) are independent from each other, and
both need to be kept.

That is incorrect; when the side branch 'x' never touches the paths,
it should be removed to allow M to simplify down to the last commit
on the main history that touches the paths.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey 9c129eab99 simplify-merges: never remove all TREESAME parents
When simplifying an odd merge, such as one that used "-s ours", we may
find ourselves TREESAME to apparently redundant parents. Prevent
simplify_merges() from removing every TREESAME parent; if this would
happen reinstate the first TREESAME parent - the one that the default
log would have followed.

This avoids producing a totally disjoint history from the default log
when the default log is a better explanation of the end result, and aids
visualisation of odd merges.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey d0af663e42 revision.c: Make --full-history consider more merges
History simplification previously always treated merges as TREESAME
if they were TREESAME to any parent.

While this was consistent with the default behaviour, this could be
extremely unhelpful when searching detailed history, and could not be
overridden. For example, if a merge had ignored a change, as if by "-s
ours", then:

  git log -m -p --full-history -Schange file

would successfully locate "change"'s addition but would not locate the
merge that resolved against it.

Futher, simplify_merges could drop the actual parent that a commit
was TREESAME to, leaving it as a normal commit marked TREESAME that
isn't actually TREESAME to its remaining parent.

Now redefine a commit's TREESAME flag to be true only if a commit is
TREESAME to _all_ of its parents. This doesn't affect either the default
simplify_history behaviour (because partially TREESAME merges are turned
into normal commits), or full-history with parent rewriting (because all
merges are output). But it does affect other modes. The clearest
difference is that --full-history will show more merges - sufficient to
ensure that -m -p --full-history log searches can really explain every
change to the file, including those changes' ultimate fate in merges.

Also modify simplify_merges to recalculate TREESAME after removing
a parent. This is achieved by storing per-parent TREESAME flags on the
initial scan, so the combined flag can be easily recomputed.

This fixes some t6111 failures, but creates a couple of new ones -
we are now showing some merges that don't need to be shown.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey e32db66d7a Documentation: avoid "uninteresting"
The documentation of --boundary uses the term "uninteresting", which is
not used or defined anywhere else in the documentation. This is
unhelpful and confusing to anyone who hasn't seen the UNINTERESTING
flag in the source code.

Change to use "excluded", as per revisions.txt.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:09 -07:00
Kevin Bracey 617f50cbfd rev-list-options.txt: correct TREESAME for P
In the example given, P is not TREESAME to E. This doesn't affect the
current result, but it will matter when we change behaviour.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16 11:51:08 -07:00
Thomas Ackermann 2de9b71138 Documentation: the name of the system is 'Git', not 'git'
Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-01 13:53:33 -08:00
Junio C Hamano 727b6fc3ed log --grep: accept --basic-regexp and --perl-regexp
When we added the "--perl-regexp" option (or "-P") to "git grep", we
should have done the same for the commands in the "git log" family,
but somehow we forgot to do so.  This corrects it, but we will
reserve the short-and-sweet "-P" option for something else for now.

Also introduce the "--basic-regexp" option for completeness, so that
the "last one wins" principle can be used to defeat an earlier -E
option, e.g. "git log -E --basic-regexp --grep='<bre>'".  Note that
it cannot have the short "-G" option as the option is to grep in the
patch text in the context of "log" family.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-10-09 23:21:30 -07:00
Nguyễn Thái Ngọc Duy 38cfe915bf revision: make --grep search in notes too if shown
Notes are shown after commit body. From user perspective it looks
pretty much like commit body and they may assume --grep would search
in that part too.

Make it so.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-29 12:15:05 -07:00
Junio C Hamano baa6378ff2 log --grep-reflog: reject the option without -g
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-29 12:07:04 -07:00
Nguyễn Thái Ngọc Duy 72fd13f71c revision: add --grep-reflog to filter commits by reflog messages
Similar to --author/--committer which filters commits by author and
committer header fields. --grep-reflog adds a fake "reflog" header to
commit and a grep filter to search on that line.

All rules to --author/--committer apply except no timestamp stripping.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-29 11:41:14 -07:00
Junio C Hamano 3d7535e424 Merge branch 'jc/maint-log-grep-all-match'
Fix a long-standing bug in "git log --grep" when multiple "--grep"
are used together with "--all-match" and "--author" or "--committer".

* jc/maint-log-grep-all-match:
  t7810-grep: test --all-match with multiple --grep and --author options
  t7810-grep: test interaction of multiple --grep and --author options
  t7810-grep: test multiple --author with --all-match
  t7810-grep: test multiple --grep with and without --all-match
  t7810-grep: bring log --grep tests in common form
  grep.c: mark private file-scope symbols as static
  log: document use of multiple commit limiting options
  log --grep/--author: honor --all-match honored for multiple --grep patterns
  grep: show --debug output only once
  grep: teach --debug option to dump the parse tree
2012-09-18 14:37:54 -07:00
Junio C Hamano a23e3138cb log: document use of multiple commit limiting options
Generally speaking, using more options will further narrow the
selection, but there are a few exceptions.  Document them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-14 10:23:47 -07:00
Junio C Hamano 2cdfb602a4 Merge branch 'nd/log-n-doc'
* nd/log-n-doc:
  doc: move rev-list option -<n> from git-log.txt to rev-list-options.txt
2012-09-12 14:21:55 -07:00
Junio C Hamano c2b927932d Merge branch 'mz/cherry-pick-cmdline-order'
"git cherry-pick A C B" used to replay changes in A and then B and
then C if these three commits had committer timestamps in that
order, which is not what the user who said "A C B" naturally expects.

* mz/cherry-pick-cmdline-order:
  cherry-pick/revert: respect order of revisions to pick
  demonstrate broken 'git cherry-pick three one two'
  teach log --no-walk=unsorted, which avoids sorting
2012-09-10 15:42:55 -07:00
Nguyễn Thái Ngọc Duy 70c2a258c6 doc: move rev-list option -<n> from git-log.txt to rev-list-options.txt
rev-list-options.txt is included in git-rev-list.txt. This makes sure
rev-list man page also shows that, and at one place, together with
equivalent options -n and --max-count.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-06 13:26:50 -07:00
Martin von Zweigbergk ca92e59e30 teach log --no-walk=unsorted, which avoids sorting
When 'git log' is passed the --no-walk option, no revision walk takes
place, naturally. Perhaps somewhat surprisingly, however, the provided
revisions still get sorted by commit date. So e.g 'git log --no-walk
HEAD HEAD~1' and 'git log --no-walk HEAD~1 HEAD' give the same result
(unless the two revisions share the commit date, in which case they
will retain the order given on the command line). As the commit that
introduced --no-walk (8e64006 (Teach revision machinery about
--no-walk, 2007-07-24)) points out, the sorting is intentional, to
allow things like

 git log --abbrev-commit --pretty=oneline --decorate --all --no-walk

to show all refs in order by commit date.

But there are also other cases where the sorting is not wanted, such
as

 <command producing revisions in order> |
       git log --oneline --no-walk --stdin

To accomodate both cases, leave the decision of whether or not to sort
up to the caller, by allowing --no-walk={sorted,unsorted}, defaulting
to 'sorted' for backward-compatibility reasons.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-30 12:26:50 -07:00
Junio C Hamano 4def968e14 Merge branch 'jc/maint-rev-list-topo-doc'
It was unclear what "--topo-order" was really about in the
documentation. It is not just about "children before parent", but
also about "don't mix lineages".

* jc/maint-rev-list-topo-doc:
  rev-list docs: clarify --topo-order description
2012-08-22 11:53:20 -07:00
Junio C Hamano 3f0350ccd5 rev-list docs: clarify --topo-order description
It was unclear what "--topo-order" was really about in the
documentation.  It is not just about "children before parent", but
also about "don't mix lineages".

Reword the description for both "--date-order" and "--topo-order",
and add an illustration to it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-08-15 13:04:20 -07:00
Štěpán Němec edfbbf7eea doc: A few minor copy edits.
- (glossary) the quotes around the Wikipedia URL prevented its
  linkification in frontends that support it; remove them

- (manual) newer version (SHA-1) == following, older == preceding, not
  the other way around

- trivial typo and wording fixes

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-14 22:32:28 -07:00
Junio C Hamano a913b56fcb Merge branch 'cn/cherry-pick-range-docs'
The command line argument of "git cherry-pick maint master..next" is
just an ordinary revision range, which is unintuitive and at least
deserves documentation.

* cn/cherry-pick-range-docs:
  git-cherry-pick.txt: clarify the use of revision range notation
  Documentation: --no-walk is no-op if range is specified
2012-06-25 11:25:38 -07:00
Carlos Martín Nieto 42939f1a24 Documentation: --no-walk is no-op if range is specified
The existing description can be misleading and cause the reader to
think that --no-walk will do something if they specify a range in the
command line instead of a set of revs.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-15 10:41:37 -07:00
Jeff King 6cf378f0cb docs: stop using asciidoc no-inline-literal
In asciidoc 7, backticks like `foo` produced a typographic
effect, but did not otherwise affect the syntax. In asciidoc
8, backticks introduce an "inline literal" inside which markup
is not interpreted. To keep compatibility with existing
documents, asciidoc 8 has a "no-inline-literal" attribute to
keep the old behavior. We enabled this so that the
documentation could be built on either version.

It has been several years now, and asciidoc 7 is no longer
in wide use. We can now decide whether or not we want
inline literals on their own merits, which are:

  1. The source is much easier to read when the literal
     contains punctuation. You can use `master~1` instead
     of `master{tilde}1`.

  2. They are less error-prone. Because of point (1), we
     tend to make mistakes and forget the extra layer of
     quoting.

This patch removes the no-inline-literal attribute from the
Makefile and converts every use of backticks in the
documentation to an inline literal (they must be cleaned up,
or the example above would literally show "{tilde}" in the
output).

Problematic sites were found by grepping for '`.*[{\\]' and
examined and fixed manually. The results were then verified
by comparing the output of "html2text" on the set of
generated html pages. Doing so revealed that in addition to
making the source more readable, this patch fixes several
formatting bugs:

  - HTML rendering used the ellipsis character instead of
    literal "..." in code examples (like "git log A...B")

  - some code examples used the right-arrow character
    instead of '->' because they failed to quote

  - api-config.txt did not quote tilde, and the resulting
    HTML contained a bogus snippet like:

      <tt><sub></tt> foo <tt></sub>bar</tt>

    which caused some parsers to choke and omit whole
    sections of the page.

  - git-commit.txt confused ``foo`` (backticks inside a
    literal) with ``foo'' (matched double-quotes)

  - mentions of `A U Thor <author@example.com>` used to
    erroneously auto-generate a mailto footnote for
    author@example.com

  - the description of --word-diff=plain incorrectly showed
    the output as "[-removed-] and {added}", not "{+added+}".

  - using "prime" notation like:

      commit `C` and its replacement `C'`

    confused asciidoc into thinking that everything between
    the first backtick and the final apostrophe were meant
    to be inside matched quotes

  - asciidoc got confused by the escaping of some of our
    asterisks. In particular,

      `credential.\*` and `credential.<url>.\*`

    properly escaped the asterisk in the first case, but
    literally passed through the backslash in the second
    case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-26 13:19:06 -07:00
Carlos Martín Nieto e34bb2e7fd Documentation: use {asterisk} in rev-list-options.txt when needed
Text between two '*' is emphasized in AsciiDoc and makes explanations in
rev-list-options.txt on glob-related options very confusing, as the
rendered text would be missing two asterisks and the text between them
would be emphasized instead.

Use '{asterisk}' where needed to make them show up as asterisks in the
rendered text.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28 13:17:14 -08:00
Junio C Hamano ed16d0dbf1 Merge branch 'maint'
* maint:
  doc/fast-import: clarify notemodify command
  Documentation: minor grammatical fix in rev-list-options.txt
  Documentation: git-filter-branch honors replacement refs
  remote-curl: Add a format check to parsing of info/refs
  git-config: Remove extra whitespaces
2011-07-22 13:58:46 -07:00
Jack Nagel df6b0cad5f Documentation: minor grammatical fix in rev-list-options.txt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-07-22 10:38:59 -07:00
Junio C Hamano 347231f735 Merge branch 'jn/maint-doc-dashdash' into jn/doc-dashdash
* jn/maint-doc-dashdash:
  Documentation: quote double-dash for AsciiDoc
2011-06-29 09:25:51 -07:00
Jonathan Nieder 565e135a1e Documentation: quote double-dash for AsciiDoc
AsciiDoc versions since 5.0.6 treat a double-dash surrounded by spaces
(outside of verbatim environments) as a request to insert an em dash.
Such versions also treat the three-character sequence "\--", when not
followed by another dash, as a request to insert two literal minus
signs.  Thus from time to time there have been patches to add
backslashes to AsciiDoc markup to escape double-dashes that are meant
to be represent '--' characters used literally on the command line;
see v1.4.0-rc1~174, Fix up docs where "--" isn't displayed correctly,
2006-05-05, for example.

AsciiDoc 6.0.3 (2005-04-20) made life harder by also treating
double-dashes without surrounding whitespace as markup for an em dash,
though only when formatting for backends other than the manpages
(e.g., HTML).  Many pages needed to be changed to use a backslash
before the "--" in names of command-line flags like "--add" (see
v0.99.6~37, Update tutorial, 2005-08-30).

AsciiDoc 8.3.0 (2008-11-29) refined the em-dash rule to avoid that
requirement.  Double-dashes without surrounding spaces are not
rendered as em dashes any more unless bordered on both sides by
alphanumeric characters.  The unescaped markup for option names (e.g.,
"--add") works fine, and many instances of this style have leaked into
Documentation/; git's HTML documentation contains many spurious em
dashes when formatted by an older toolchain.  (This patch will not
change that.)

The upshot: "--" as an isolated word and in phrases like "git
web--browse" must be escaped if it is not to be rendered as an em dash
by current asciidoc.  Use "\--" to avoid such misformatting in
sentences in which "--" represents a literal double-minus command line
argument that separates options and revs from pathspecs, and use
"{litdd}" in cases where the double-dash is embedded in the command
name.  The latter is just for consistency with v1.7.3-rc0~13^2 (Work
around em-dash handling in newer AsciiDoc, 2010-08-23).

List of lines to fix found by grepping manpages for "(em".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-29 09:24:26 -07:00
Junio C Hamano cc243c3ceb show: --ignore-missing
Instead of barfing, simply ignore bad object names seen in the
input. This is useful when reading from "git notes list" output
that may refer to objects that have already been garbage collected.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-19 10:55:54 -07:00
Michael J Gruber b388e14b89 rev-list --count: separate count for --cherry-mark
When --count is used with --cherry-mark, omit the patch equivalent
commits from the count for left and right commits and print the count of
equivalent commits separately.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 13:13:20 -07:00
Junio C Hamano 2c320e71bf Merge branch 'jc/rev-list-options-fix'
* jc/rev-list-options-fix:
  "log --cherry-pick" documentation regression fix
2011-04-04 10:55:38 -07:00
Junio C Hamano 3add01bbf1 "log --cherry-pick" documentation regression fix
Earlier f98fd43 (git-log.txt,rev-list-options.txt: put option blocks in
proper order, 2011-03-08) moved the text around in the documentation for
options in the rev-list family of commands such as "log".  Consequently,
the description of the --cherry-pick option appears way above the
description of the --left-right option now.

But the description of the --cherry-pick option still refers to the
example for the --left-right option, like this:

    ... with --left-right, like the example ABOVE in the description of
    that option.

Rephrase it to clarify that we are making a forward reference.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-01 15:14:38 -07:00
Junio C Hamano bf0c5bbe25 Merge branch 'mg/rev-list-n-parents'
* mg/rev-list-n-parents:
  tests: avoid nonportable {foo,bar} glob
  rev-list --min-parents,--max-parents: doc, test and completion
  revision.c: introduce --min-parents and --max-parents options
  t6009: use test_commit() from test-lib.sh
2011-03-26 20:13:17 -07:00
Michael J Gruber 6a6ebded7f rev-list --min-parents,--max-parents: doc, test and completion
This also adds test for "--merges" and "--no-merges" which we did not
have so far.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-23 10:20:24 -07:00
Junio C Hamano aeb2aaa771 Merge branch 'mg/rev-list-one-side-only'
* mg/rev-list-one-side-only:
  git-log: put space after commit mark
  t6007: test rev-list --cherry
  log --cherry: a synonym
  rev-list: documentation and test for --cherry-mark
  revision.c: introduce --cherry-mark
  rev-list/log: factor out revision mark generation
  rev-list: --left/right-only are mutually exclusive
  rev-list: documentation and test for --left/right-only
  t6007: Make sure we test --cherry-pick
  revlist.c: introduce --left/right-only for unsymmetric picking
2011-03-22 21:38:50 -07:00
Michael J Gruber f98fd43675 git-log.txt,rev-list-options.txt: put option blocks in proper order
Match the order of the description to the one in which they get applied:

  commit limiting
  commit ordering
  commit formatting
  diff options

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 15:15:52 -08:00
Michael J Gruber 94f605ec07 log --cherry: a synonym
At the porcelain level, because by definition there are many more contributors
than integrators, it makes sense to give a handy short-hand for --right-only
used with --cherry-mark and --no-merges.  Make it so.

In other words, this provides "git cherry with rev-list interface".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 13:50:54 -08:00
Michael J Gruber cb56e3093a rev-list: documentation and test for --cherry-mark
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09 13:50:54 -08:00
Michael J Gruber 190767f6c1 git-log.txt,rev-list-options.txt: -n/--max-count is commit limiting
They are applied after commit ordering and formatting options, in
particular --reverse.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-08 11:59:43 -08:00
Michael J Gruber 841d81180e rev-list-options.txt: typo fix
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-08 11:56:37 -08:00
Michael J Gruber 59c8afdf47 rev-list: documentation and test for --left/right-only
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21 16:34:05 -08:00
Junio C Hamano 786f174dab Merge branch 'mm/phrase-remote-tracking'
* mm/phrase-remote-tracking:
  git-branch.txt: mention --set-upstream as a way to change upstream configuration
  user-manual: remote-tracking can be checked out, with detached HEAD
  user-manual.txt: explain better the remote(-tracking) branch terms
  Change incorrect "remote branch" to "remote tracking branch" in C code
  Change incorrect uses of "remote branch" meaning "remote-tracking"
  Change "tracking branch" to "remote-tracking branch"
  everyday.txt: change "tracking branch" to "remote-tracking branch"
  Change remote tracking to remote-tracking in non-trivial places
  Replace "remote tracking" with "remote-tracking"
  Better "Changed but not updated" message in git-status
2010-11-24 15:55:05 -08:00
Yann Dirson 6a6c54bafe Document that rev-list --graph triggers parent rewriting.
This may help to understand why --graph causes more comments to
be selected.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:16:48 -08:00
Jonathan Nieder 60aa9cf8f3 Documentation: document show -s
Git's diff machinery has supported a -s (silence diff output) option
as far back as v0.99~900 (Silent flag for show-diff, 2005-04-13), but
the option is only advertised in an odd corner of the git diff-tree
manual.

The main use is to retrieve basic metadata about a commit:

	git show -s rev

Explain this in the 'git log' manual and provide an example in the
'git show' examples section.  This is kind of a cop-out, since it
would be more useful to explain it in the 'git show' manual proper,
which says:

	The command takes options applicable to the git
	diff-tree command to control how the changes the
	commit introduces are shown.

	This manual page describes only the most frequently
	used options.

Fixing that is a larger task for another day.

Reported-by: Will Hall <will@gnatter.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-09 09:42:57 -08:00
Matthieu Moy 0e615b252f Replace "remote tracking" with "remote-tracking"
"remote-tracking" branch makes it explicit that the branch is "tracking a
remote", as opposed to "remote, and tracking something".

See discussion in e.g.
http://mid.gmane.org/8835ADF9-45E5-4A26-9F7F-A72ECC065BB2@gmail.com
for more details.

This patch is a straightforward application of

  perl -pi -e 's/remote tracking branch/remote-tracking branch/'

except in the RelNotes directory.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-03 09:19:04 -07:00
Štěpán Němec 0adda9362a Use parentheses and `...' where appropriate
Remove some stray usage of other bracket types and asterisks for the
same purpose.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-08 12:31:07 -07:00
Štěpán Němec 62b4698e55 Use angles for placeholders consistently
Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-08 12:29:52 -07:00
Michael J Gruber e14712c9e6 rev-list-options: clarify --parents and --children
Make it clearer that --parents resp. --children list the parent resp.
child commits next to each commit, so that I understand next time.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-30 09:38:47 -07:00
Jonathan Nieder b9190e7913 Documentation: do not convert ... operator to ellipses
The symmetric difference or merge-base operator ... as used by
rev-list and diff is actually three period characters.  If it
gets replaced by an ellipsis glyph in the manual, that would
stop readers from copying and pasting it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-20 14:16:51 -07:00
Junio C Hamano 6296062285 Merge branch 'tr/rev-list-count'
* tr/rev-list-count:
  bash completion: Support "divergence from upstream" messages in __git_ps1
  rev-list: introduce --count option

Conflicts:
	contrib/completion/git-completion.bash
2010-06-30 11:55:38 -07:00
Thomas Rast f69c501832 rev-list: introduce --count option
Add a --count option that, instead of actually listing the commits,
merely counts them.

This is mostly geared towards script use, and to this end it acts
specially when used with --left-right: it outputs the left and right
counts separately.  Previously, scripts would have to run a shell loop
or small inline script over to achieve the same.  (Without
--left-right, a simple |wc -l does the job.)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-12 09:39:06 -07:00
Johan Herland 57456ef459 Documentation/rev-list-options.txt: Explain --ancestry-path
Add a short paragraph explaining --ancestry-path, followed by a more
detailed example. This mirrors how the other history simplification options
are documented.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-06 10:16:31 -07:00
Johan Herland f70d0586d6 Documentation/rev-list-options.txt: Fix missing line in example history graph
In the detailed explanation of how the revision machinery does history
simplification, the current text presents an example history and explains
how various options of the revision machinery affect the resulting list
of commits. The first simplification mode mentioned is the default mode,
in which a number of commits is omitted from the example graph according
to the history simplification rules. The text states (among other things)
that commit "C was considered via N, but is TREESAME", and therefore
omitted. However, the accompanying graph does not list the effect on the
implicit parentage, i.e. that commit I takes C's place as a parent of N.

Running 'git rev-list --parents P' does indeed list I as a second parent
of N, and the accompanying graph should therefore also show this line.

Signed-off-by: Johan Herland <johan@herland.net>
Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-06 10:16:30 -07:00
Junio C Hamano 797d44343c Merge branch 'pb/log-first-parent-p-m'
* pb/log-first-parent-p-m:
  show --first-parent/-m: do not default to --cc
  show -c: show patch text
  revision: introduce setup_revision_opt
  t4013: add tests for log -p -m --first-parent
  git log -p -m: document -m and honor --first-parent
2010-03-24 16:25:39 -07:00
Jeff King cc1b8d8bc6 docs: don't talk about $GIT_DIR/refs/ everywhere
It is misleading to say that we pull refs from $GIT_DIR/refs/*, because we
may also consult the packed refs mechanism. These days we tend to treat
the "refs hierarchy" as more of an abstract namespace that happens to be
represented as $GIT_DIR/refs. At best, this is a minor inaccuracy, but at
worst it can confuse users who then look in $GIT_DIR/refs and find that it
is missing some of the refs they expected to see.

This patch drops most uses of "$GIT_DIR/refs/*", changing them into just
"refs/*", under the assumption that users can handle the concept of an
abstract refs namespace. There are a few things to note:

  - most cases just dropped the $GIT_DIR/ portion. But for cases where
    that left _just_ the word "refs", I changed it to "refs/" to help
    indicate that it was a hierarchy.  I didn't do the same for longer
    paths (e.g., "refs/heads" remained, instead of becoming
    "refs/heads/").

  - in some cases, no change was made, as the text was explicitly about
    unpacked refs (e.g., the discussion in git-pack-refs).

  - In some cases it made sense instead to note the existence of packed
    refs (e.g., in check-ref-format and rev-parse).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 21:40:09 -08:00
Petr Baudis 88d9d45d07 git log -p -m: document -m and honor --first-parent
git log -p -m is used to show one merge entry per parent, with an
appropriate diff; this can be useful when examining histories where
full set of changes introduced by a merged branch is interesting, not
only the conflicts.

This patch properly documents the -m switch, which has so far been
mentioned only as a fairly special diff-tree flag.

It also makes the code show full patch entry only for the first parent
when --first-parent is used. Thus:

	git log -p -m --first-parent

will show the history from the "main branch perspective", while also
including full diff of changes introduced by other merged in branches.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 11:32:23 -08:00
Ralf Wildenhues 6a5d0b0a90 Fix typos in technical documentation.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-31 10:24:53 -08:00
Ilari Liusvaara b09fe971de rev-parse --branches/--tags/--remotes=pattern
Since local branch, tags and remote tracking branch namespaces are
most often used, add shortcut notations for globbing those in
manner similar to --glob option.

With this, one can express the "what I have but origin doesn't?"
as:

'git log --branches --not --remotes=origin'

Original-idea-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20 12:30:25 -08:00
Ilari Liusvaara d08bae7e22 rev-parse --glob
Add --glob=<glob-pattern> option to rev-parse and everything that
accepts its options. This option matches all refs that match given
shell glob pattern (complete with some DWIM logic).

Example:

'git log --branches --not --glob=remotes/origin'

To show what you have that origin doesn't.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20 12:29:05 -08:00
Christian Couder af06e93a3e Documentation: update descriptions of revision options related to '--bisect'
In commit ad3f9a7 (Add '--bisect' revision machinery argument) the
'--bisect' option was added to easily pass bisection refs to commands
using the revision machinery.

This patch updates the documentation of the related options to describe
the new behavior.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-24 01:00:34 -08:00
Junio C Hamano 60da8b15c1 Make --stdin option to "log" family read also pathspecs
Similar to the command line arguments, after giving zero or more revs, you can
feed a line "--" and then feed pathspecs one at a time.

With this

	(
		echo ^maint
		echo --
		echo Documentation
	) | git log --stat --oneline --stdin master -- t

lists commits that touch Documentation/ or t/ between maint and master.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-20 15:10:47 -08:00
Junio C Hamano 8b3dce5650 Teach --stdin option to "log" family
Move the logic to read revs from standard input that rev-list knows about
from it to revision machinery, so that all the users of setup_revisions()
can feed the list of revs from the standard input when "--stdin" is used
on the command line.

Allow some users of the revision machinery that want different semantics
from the "--stdin" option to disable it by setting an option in the
rev_info structure.

This also cleans up the kludge made to bundle.c via cut and paste.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-20 15:10:29 -08:00
SZEDER Gábor 2657420d9e Document 'git (rev-list|log) --merges'
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-13 11:09:41 -07:00
Matthieu Moy 982962ce24 git-rev-list.txt: make ascii markup uniform with other pages.
Other pages use --option=<argument>, not --option='argument', do the
same here.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:08:13 -07:00
Christian Couder 3d2d4f96d2 Documentation: fix badly indented paragraphs in "--bisect-all" description
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-07 11:21:41 -08:00
Linus Torvalds 7dff9b30ea Support 'raw' date format
Talking about --date, one thing I wanted for the 1234567890 date was to
get things in the raw format. Sure, you get them with --pretty=raw, but it
felt a bit sad that you couldn't just ask for the date in raw format.

So here's a throw-away patch (meaning: I won't be re-sending it, because I
really don't think it's a big deal) to add "--date=raw". It just prints
out the internal raw git format - seconds since epoch plus timezone (put
another way: 'date +"%s %z"' format)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-20 21:45:42 -08:00
Mark Burton c2e6385da5 Documentation: rev-list-options.txt: added --branches, --tags & --remotes.
Added simple descriptions of these options (based on description of --all).

Signed-off-by: Mark Burton <markb@ordern.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-18 16:09:08 -08:00
Junio C Hamano b2b80c107f Merge branch 'lt/decorate'
* lt/decorate:
  rev-list documentation: clarify the two parts of history simplification
  Document "git log --simplify-by-decoration"
  Document "git log --source"
  revision traversal: '--simplify-by-decoration'
  Make '--decorate' set an explicit 'show_decorations' flag
  revision: make tree comparison functions take commits rather than trees
  Add a 'source' decorator for commits

Conflicts:
	Documentation/rev-list-options.txt
2008-11-12 21:51:19 -08:00
Santi Béjar 7bc2508bfe rev-list documentation: clarify the two parts of history simplification
One set of options and parameters determine what commits are involved in
the simplification process, and another set of options determine how the
simplification is done.  Clarify their distinction at the beginning.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12 14:28:16 -08:00
Nanako Shiraishi 3fcfd662dc Document "git log --simplify-by-decoration"
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-12 14:23:11 -08:00
Junio C Hamano a9645b780b Merge branch 'maint'
* maint:
  Documentation: bisect: change a few instances of "git-cmd" to "git cmd"
  Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"
  checkout: Don't crash when switching away from an invalid branch.
2008-11-09 10:56:26 -08:00
Christian Couder 6514aa36d2 Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09 10:19:38 -08:00
Junio C Hamano 84cdd3c635 Merge branch 'maint'
* maint:
  Add reference for status letters in documentation.
  Document that git-log takes --all-match.
  Update draft 1.6.0.4 release notes
2008-11-02 16:36:40 -08:00
Mikael Magnusson 7756ba74c0 Document that git-log takes --all-match.
Signed-off-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02 15:51:37 -08:00
Junio C Hamano 01914577ed Merge branch 'tr/filter-branch'
* tr/filter-branch:
  revision --simplify-merges: make it a no-op without pathspec
  revision --simplify-merges: do not leave commits unprocessed
  revision --simplify-merges: use decoration instead of commit->util field
  Documentation: rev-list-options: move --simplify-merges documentation
  filter-branch: use --simplify-merges
  filter-branch: fix ref rewriting with --subdirectory-filter
  filter-branch: Extend test to show rewriting bug
  Topo-sort before --simplify-merges
  revision traversal: show full history with merge simplification
  revision.c: whitespace fix
2008-09-02 17:47:13 -07:00
Junio C Hamano fc721b699b Merge branch 'maint'
* maint:
  Do not talk about "diff" in rev-list documentation.
2008-08-12 22:46:22 -07:00
Junio C Hamano 9612e74342 Do not talk about "diff" in rev-list documentation.
Since 8c02eee (git-rev-list(1): group options; reformat; document more
options, 2006-09-01), git-rev-list documentation talks as if it supports
any kind of diff output.  It doesn't.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-12 22:40:44 -07:00
Thomas Rast d266a98845 Documentation: rev-list-options: move --simplify-merges documentation
Fits --simplify-merges documentation into the 'History Simplification'
section, including example.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-12 21:40:20 -07:00
Junio C Hamano 00b718e02d Merge branch 'jc/post-simplify' into tr/rev-list-docs
* jc/post-simplify:
  Topo-sort before --simplify-merges
  revision traversal: show full history with merge simplification
  revision.c: whitespace fix

Conflicts:
	Documentation/rev-list-options.txt
2008-08-12 21:40:05 -07:00
Thomas Rast 70d9895ebc Documentation: rev-list-options: Rewrite simplification descriptions for clarity
This completely rewrites the documentation of --full-history with lots
of examples.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-12 17:54:06 -07:00
Thomas Rast d777af86d8 Documentation: rev-list-options: Fix a typo
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-11 17:13:57 -07:00
Junio C Hamano ac39efbdf3 Merge branch 'maint'
* maint:
  Re-fix rev-list-options documentation
2008-08-11 14:28:35 -07:00
Junio C Hamano e534735a4c Re-fix rev-list-options documentation
18a2197 (Documentation: rev-list-options: Fix -g paragraph formatting,
2008-08-10) introduced the third paragraph that is continued, but it seems
to confuse docbook toolchain on FC9 machines.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-11 14:24:51 -07:00
Junio C Hamano 10d9d887ec Merge branch 'maint'
* maint:
  Documentation: fix invalid reference to 'mybranch' in user manual
  Fix deleting reflog entries from HEAD reflog
  reflog test: add more tests for 'reflog delete'
  Documentation: rev-list-options: Fix -g paragraph formatting

Conflicts:
	Documentation/user-manual.txt
2008-08-11 00:53:31 -07:00
Thomas Rast 18a2197e6d Documentation: rev-list-options: Fix -g paragraph formatting
- Add an escape to @{now}.  Without the escape, the brace does
  something magic and eats half the sentence up to the closing brace
  at 'timestamp}'.

- Join the last paragraph with a '+'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-10 23:11:48 -07:00
Junio C Hamano 6546b5931e revision traversal: show full history with merge simplification
The --full-history traversal keeps all merges in addition to non-merge
commits that touch paths in the given pathspec.  This is useful to view
both sides of a merge in a topology like this:

        A---M---o
       /   /
   ---O---B

even when A and B makes identical change to the given paths.  The revision
traversal without --full-history aims to come up with the simplest history
to explain the final state of the tree, and one of the side branches can
be pruned away.

The behaviour to keep all merges however is inconvenient if neither A nor
B touches the paths we are interested in.  --full-history reduces the
topology to:

   ---O---M---o

in such a case, without removing M.

This adds a post processing phase on top of --full-history traversal to
remove needless merges from the resulting history.

The idea is to compute, for each commit in the "full history" result set,
the commit that should replace it in the simplified history.  The commit
to replace it in the final history is determined as follows:

 * In any case, we first figure out the replacement commits of parents of
   the commit we are looking at.  The commit we are looking at is
   rewritten as if the replacement commits of its original parents are its
   parents.  While doing so, we reduce the redundant parents from the
   rewritten parent list by not just removing the identical ones, but also
   removing a parent that is an ancestor of another parent.

 * After the above parent simplification, if the commit is a root commit,
   an UNINTERESTING commit, a merge commit, or modifies the paths we are
   interested in, then the replacement commit of the commit is itself.  In
   other words, such a commit is not dropped from the final result.

The first point above essentially means that the history is rewritten in
the bottom up direction.  We can rewrite the parent list of a commit only
after we know how all of its parents are rewritten.  This means that the
processing needs to happen on the full history (i.e. after limit_list()).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-02 00:33:15 -07:00
Junio C Hamano b1264da863 Documentation: clarify diff --cc
The definition of an "uninteresting" hunk was not in line with reality.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-01 23:00:42 -07:00
Junio C Hamano ea3d988df7 Documentation: clarify diff --cc
The definition of an "uninteresting" hunk was not in line with reality.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23 16:57:13 -07:00
Junio C Hamano 8bb65883d1 Merge branch 'jc/blame' (early part) into HEAD
* 'jc/blame' (early part):
  git-blame --reverse
  builtin-blame.c: allow more than 16 parents
  builtin-blame.c: move prepare_final() into a separate function.
  rev-list --children
  revision traversal: --children option

Conflicts:

	Documentation/rev-list-options.txt
	revision.c
2008-07-08 15:25:44 -07:00
Stephan Beyer 3240240ff4 Docs: Use "-l::\n--long\n" format in OPTIONS sections
The OPTIONS section of a documentation file contains a list
of the options a git command accepts.

Currently there are several variants to describe the case that
different options (almost) do the same in the OPTIONS section.

Some are:

 -f, --foo::
 -f|--foo::
 -f | --foo::

But AsciiDoc has the special form:

 -f::
 --foo::

This patch applies this form to the documentation of the whole git suite,
and removes useless em-dash prevention, so \--foo becomes --foo.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-08 13:46:38 -07:00
Junio C Hamano adf60f1440 Documentation: git-log cannot use rev-list specific options
The log family and git-rev-list share the same set of options that come
from revision walking machinery, but they both have options unique to
them.  Notably, --header, --timestamp, --stdin and --quiet apply only to
rev-list.  Exclude them from the git-log documentation.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-03 23:56:56 -07:00
Junio C Hamano e13067a749 Merge branch 'maint'
* maint:
  rev-parse --symbolic-full-name: don't print '^' if SHA1 is not a ref
  Add missing "short" alternative to --date in rev-list-options.txt
  git-show.txt: Not very stubby these days.
  Clarify repack -n documentation
2008-05-23 16:05:46 -07:00
Heikki Orsila dd0ffd5b31 Add log.date config variable
log.date config variable sets the default date-time mode for the log
command. Setting log.date value is similar to using git log's --date
option.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-23 16:05:42 -07:00
Heikki Orsila 26b4d0039d Add missing "short" alternative to --date in rev-list-options.txt
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-22 23:29:46 -07:00
Adam Simpkins 7fefda5cc7 log and rev-list: add --graph option
This new option causes a text-based representation of the history to be
printed to the left of the normal output.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 18:46:35 -07:00
Junio C Hamano 72276a3ecb rev-list --children
Just like --parents option shows the parents of commits, this shows the
children of commits.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 19:41:29 -07:00
Jakub Narebski 56b6d01d84 Documentation: Remove --{min,max}-age option from git-log(1)
The --max-age=<timestamp> and --min-age=<timestamp> are now shown only
in the git-rev-list manpage (plumbing).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-02 13:52:08 -08:00
Jakub Narebski dc1c0fffd3 Add '--fixed-strings' option to "git log --grep" and friends
Add support for -F | --fixed-strings option to "git log --grep"
and friends: "git log --author", "git log --committer=<pattern>".
Code is based on implementation of this option in "git grep".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-26 23:59:49 -08:00
Miklos Vajna fdcf39e59b Include rev-list options in git-log manpage.
Replace the "This manual page describes only the most frequently used options."
text with the list of rev-list options in git-log manpage. (The git-diff-tree
options are already included.)

Move these options to a separate file and include it from both
git-rev-list.txt and git-log.txt.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-18 15:09:08 -08:00