<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-diff.txt, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-07-13T19:47:38Z</updated>
<entry>
<title>git-diff.txt: reorder possible usages</title>
<updated>2020-07-13T19:47:38Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2020-07-13T19:10:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78b76d310f3e9c0cc1e990ed93f58711e48d9ab2'/>
<id>urn:sha1:78b76d310f3e9c0cc1e990ed93f58711e48d9ab2</id>
<content type='text'>
The description of `git diff` goes through several different invocations
(numbering added by me):

  1. git diff [&lt;options&gt;] [--] [&lt;path&gt;...]
  2. git diff [&lt;options&gt;] --no-index [--] &lt;path&gt; &lt;path&gt;
  3. git diff [&lt;options&gt;] --cached [&lt;commit&gt;] [--] [&lt;path&gt;...]
  4. git diff [&lt;options&gt;] &lt;commit&gt; [--] [&lt;path&gt;...]
  5. git diff [&lt;options&gt;] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;...]
  6. git diff [&lt;options&gt;] &lt;commit&gt;..&lt;commit&gt; [--] [&lt;path&gt;...]
  7. git diff [&lt;options&gt;] &lt;commit&gt; &lt;commit&gt;... &lt;commit&gt; [--] [&lt;path&gt;...]
  8. git diff [&lt;options&gt;] &lt;commit&gt;...&lt;commit&gt; [--] [&lt;path&gt;...]

It then goes on to say that "all of the &lt;commit&gt; in the above
description, except in the last two forms that use '..' notations, can
be any &lt;tree&gt;". The "last two" actually refers to 6 and 8. This got out
of sync in commit b7e10b2ca2 ("Documentation: usage for diff combined
commits", 2020-06-12) which added item 7 to the mix.

As a further complication, after b7e10b2ca2 we also have some potential
confusion around "the '..' notation". The "..[.]" in items 6 and 8 are
part of the rev notation, whereas the "..." in item 7 is manpage
language for "one or more".

Move item 6 down, i.e., to between 7 and 8, to restore the ordering.
Because 6 refers to 5 ("synonymous to the previous form") we need to
tweak the language a bit.

An added bonus of this commit is that we're trying to steer users away
from `git diff &lt;commit&gt;..&lt;commit&gt;` and moving it further down probably
doesn't hurt.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-diff.txt: don't mark required argument as optional</title>
<updated>2020-07-13T19:47:36Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2020-07-13T19:10:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc5482e9db9bbecbfcd3a45793af78d7e0a6a638'/>
<id>urn:sha1:bc5482e9db9bbecbfcd3a45793af78d7e0a6a638</id>
<content type='text'>
Commit b7e10b2ca2 ("Documentation: usage for diff combined commits",
2020-06-12) modified the synopsis by adding an optional "[&lt;commit&gt;...]"
to

  'git diff' [&lt;options&gt;] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;...]

to effectively add

  'git diff' [&lt;options&gt;] &lt;commit&gt; &lt;commit&gt;... &lt;commit&gt; [--] [&lt;path&gt;...]

as another valid invocation. Which makes sense.

Further down, in the description, it left the existing entry for

  'git diff' [&lt;options&gt;] &lt;commit&gt; &lt;commit&gt; [--] [&lt;path&gt;...]

intact and added a new entry on

  'git diff' [&lt;options&gt;] &lt;commit&gt; [&lt;commit&gt;...] &lt;commit&gt; [--] [&lt;path&gt;...]

where it says that "[t]his form is to view the results of a merge
commit" and details how "the first listed commit must be the merge
itself". But one possible instantiation of this form is `git diff
&lt;commit&gt; &lt;commit&gt;` for which the added text doesn't really apply.

Remove the brackets so that we lose this overlap between the two
descriptions. We can still use the more compact representation in the
synopsis.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Documentation: usage for diff combined commits</title>
<updated>2020-06-12T17:53:44Z</updated>
<author>
<name>Chris Torek</name>
<email>chris.torek@gmail.com</email>
</author>
<published>2020-06-12T16:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7e10b2ca210d6a3647910fdecea33581e4eaf0d'/>
<id>urn:sha1:b7e10b2ca210d6a3647910fdecea33581e4eaf0d</id>
<content type='text'>
Document the usage for producing combined commits with "git diff".
This includes updating the synopsis section.

While here, add the three-dot notation to the synopsis.

Make "git diff -h" print the same usage summary as the manual
page synopsis, minus the "A..B" form, which is now discouraged.

Signed-off-by: Chris Torek &lt;chris.torek@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-diff.txt: document return code of `--no-index`</title>
<updated>2019-11-02T04:16:41Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-10-29T16:54:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0115e5d929d06ad41eff83742a3e6a1e91ecc0c4'/>
<id>urn:sha1:0115e5d929d06ad41eff83742a3e6a1e91ecc0c4</id>
<content type='text'>
Within diff_no_index(), we have the following:

	revs-&gt;diffopt.flags.exit_with_status = 1;

	...

	/*
	 * The return code for --no-index imitates diff(1):
	 * 0 = no changes, 1 = changes, else error
	 */
	return diff_result_code(&amp;revs-&gt;diffopt, 0);

Which means when `git diff` is run in `--no-index` mode, `--exit-code`
is implied. However, the documentation for this is missing in
git-diff.txt.

Add a note about how `--exit-code` is implied in the `--no-index`
documentation to cover this documentation blindspot.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: tidy asciidoc style</title>
<updated>2019-01-23T19:37:29Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2019-01-22T20:16:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba170517be039a04b1914ebe9b492d4139c707df'/>
<id>urn:sha1:ba170517be039a04b1914ebe9b492d4139c707df</id>
<content type='text'>
This mainly refers to enforcing indentation on additional lines of
items of lists.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: fix a typo and clarify a sentence</title>
<updated>2018-10-11T00:39:15Z</updated>
<author>
<name>Mihir Mehta</name>
<email>mihir@cs.utexas.edu</email>
</author>
<published>2018-10-10T22:26:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca8ed443a5c4bcfdc0b89d418f4ea34fef8a9c97'/>
<id>urn:sha1:ca8ed443a5c4bcfdc0b89d418f4ea34fef8a9c97</id>
<content type='text'>
I noticed that git-merge-base was unlikely to actually be a git command,
and tried it in my shell. Seeing that it doesn't work, I cleaned up two
places in the docs where it appears.

Signed-off-by: Mihir Mehta &lt;mihir@cs.utexas.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use proper syntax for replaceables in command docs</title>
<updated>2018-05-25T08:16:47Z</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2018-05-24T20:11:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de613050efec781e8380a0267879a25b2d489513'/>
<id>urn:sha1:de613050efec781e8380a0267879a25b2d489513</id>
<content type='text'>
The standard for command documentation synopses appears to be:

  [...] means optional
  &lt;...&gt; means replaceable
  [&lt;...&gt;] means both optional and replaceable

So fix a number of doc pages that use incorrect variations of the
above.

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: normalize [--options] to [options] in git-diff</title>
<updated>2018-05-06T09:38:43Z</updated>
<author>
<name>Andreas Heiduk</name>
<email>asheiduk@gmail.com</email>
</author>
<published>2018-05-03T18:48:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5356a3c3542774f05684b5c3999060492dce2e8d'/>
<id>urn:sha1:5356a3c3542774f05684b5c3999060492dce2e8d</id>
<content type='text'>
SYNOPSIS and other manuals use [options] but DESCRIPTION
used [--options].

Signed-off-by: Andreas Heiduk &lt;asheiduk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: align 'diff --no-index' in text and synopsis</title>
<updated>2018-05-06T09:38:43Z</updated>
<author>
<name>Andreas Heiduk</name>
<email>asheiduk@gmail.com</email>
</author>
<published>2018-05-03T18:48:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e78e0f728eb043dc99de10fb3b4d58575f2df0c9'/>
<id>urn:sha1:e78e0f728eb043dc99de10fb3b4d58575f2df0c9</id>
<content type='text'>
Make the two '&lt;path&gt;' parameters in DESCRIPTION mandatory and
move the `--options` part to the same place where the other
variants show them. And finally make `--no-index` in SYNOPSIS
as mandatory as in DESCRIPTION.

Signed-off-by: Andreas Heiduk &lt;asheiduk@gmail.com&gt;
Reviewed-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-files: document --ours etc.</title>
<updated>2017-04-13T23:15:25Z</updated>
<author>
<name>Andreas Heiduk</name>
<email>asheiduk@gmail.com</email>
</author>
<published>2017-04-11T14:39:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47242cd1037483896bb2b042e6a02c66b65b07d6'/>
<id>urn:sha1:47242cd1037483896bb2b042e6a02c66b65b07d6</id>
<content type='text'>
git-diff understands "--ours", "--theirs" and "--base" for files with
conflicts. But so far they were not documented for the central diff
command but only for diff-files.

Signed-off-by: Andreas Heiduk &lt;asheiduk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
