<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-diff.txt, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2021-07-12T20:55:29Z</updated>
<entry>
<title>git-diff: fix missing --merge-base docs</title>
<updated>2021-07-12T20:55:29Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2021-07-10T09:28:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=eb448631fb541239d91709d812b92bf2b57bc733'/>
<id>urn:sha1:eb448631fb541239d91709d812b92bf2b57bc733</id>
<content type='text'>
When `git diff --merge-base` was introduced at around Git 2.30, the
documentation included a few errors.

In the example given for `git diff --cached --merge-base`, the
`--cached` flag was omitted for the `--merge-base` example. Add the
missing flag.

In the `git diff &lt;commit&gt;` case, we failed to mention that
`--merge-base` is an available option. Give the usage of `--merge-base`
as an option there.

Finally, there are two errors in the usage of `git diff`. Firstly, we do
not mention `--merge-base` in the `git diff --cached` case. Mention it
so that it's consistent with the documentation. Secondly, we put the
`[--merge-base]` in between `&lt;commit&gt;` and `[&lt;commit&gt;...]`. Move the
`[--merge-base]` so that it's beside `[&lt;options&gt;]` which is a more
logical grouping.

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>builtin/diff-tree: learn --merge-base</title>
<updated>2020-09-21T20:37:03Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-14T18:36:52Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=3d09c22869a7bd47f1683031937af0ed93b2fa3b'/>
<id>urn:sha1:3d09c22869a7bd47f1683031937af0ed93b2fa3b</id>
<content type='text'>
The previous commit introduced ---merge-base a way to take the diff
between the working tree or index and the merge base between an arbitrary
commit and HEAD. It makes sense to extend this option to support the
case where two commits are given too and behave in a manner identical to
`git diff A...B`.

Introduce the --merge-base flag as an alternative to triple-dot
notation. Thus, we would be able to write the above as
`git diff --merge-base A B`.

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>builtin/diff-index: learn --merge-base</title>
<updated>2020-09-21T04:30:26Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-20T11:22:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0f5a1d449b9538c2765de9d6683abbb83a7fb4e2'/>
<id>urn:sha1:0f5a1d449b9538c2765de9d6683abbb83a7fb4e2</id>
<content type='text'>
There is currently no easy way to take the diff between the working tree
or index and the merge base between an arbitrary commit and HEAD. Even
diff's `...` notation doesn't allow this because it only works between
commits. However, the ability to do this would be desirable to a user
who would like to see all the changes they've made on a branch plus
uncommitted changes without taking into account changes made in the
upstream branch.

Teach diff-index and diff (with one commit) the --merge-base option
which allows a user to use the merge base of a commit and HEAD as the
"before" side.

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>git-diff.txt: backtick quote command text</title>
<updated>2020-09-17T16:38:47Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-09-17T07:44:07Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a8fa6a08f4ff3ab99f99dd7ae989bd825071def3'/>
<id>urn:sha1:a8fa6a08f4ff3ab99f99dd7ae989bd825071def3</id>
<content type='text'>
The modern way to quote commands in the documentation is to use
backticks instead of double-quotes as this renders the text with the
code style. Convert double-quoted command text to backtick-quoted
commands. While we're at it, quote one instance of `^@`.

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>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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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='http://git.kilabit.info/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>
</feed>
