<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/diff-options.txt, branch v2.48.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.48.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.48.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-11-19T03:31:04Z</updated>
<entry>
<title>doc: git-diff: apply format changes to diff-options</title>
<updated>2024-11-19T03:31:04Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2024-11-18T22:05:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b552e39c01f6a38158eab78816e8954ec46ccde'/>
<id>urn:sha1:6b552e39c01f6a38158eab78816e8954ec46ccde</id>
<content type='text'>
The format change is only applied to the sections of the file that are
filtered in git-diff.

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>diff: let external diffs report that changes are uninteresting</title>
<updated>2024-06-10T16:20:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-06-09T07:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7b97b7185521e3b9364b3abc6553df2480da173'/>
<id>urn:sha1:d7b97b7185521e3b9364b3abc6553df2480da173</id>
<content type='text'>
The options --exit-code and --quiet instruct git diff to indicate
whether it found any significant changes by exiting with code 1 if it
did and 0 if there were none.  Currently this doesn't work if external
diff programs are involved, as we have no way to learn what they found.

Add that ability in the form of the new configuration options
diff.trustExitCode and diff.&lt;driver&gt;.trustExitCode and the environment
variable GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE.  They pair with the config
options diff.external and diff.&lt;driver&gt;.command and the environment
variable GIT_EXTERNAL_DIFF, respectively.

The new options are off by default, keeping the old behavior.  Enabling
them indicates that the external diff returns exit code 1 if it finds
significant changes and 0 if it doesn't, like diff(1).

The name of the new options is taken from the git difftool and mergetool
options of similar purpose.  (There they enable passing on the exit code
of a diff tool and to infer whether a merge done by a merge tool is
successful.)

The new feature sets the diff flag diff_from_contents in
diff_setup_done() if we need the exit code and are allowed to call
external diffs.  This disables the optimization that avoids calling the
program with --quiet.  Add it back by skipping the call if the external
diff is not able to report empty diffs.  We can only do that check after
evaluating the file-specific attributes in run_external_diff().

If we do run the external diff with --quiet, send its output to
/dev/null.

I considered checking the output of the external diff to check whether
its empty.  It was added as 11be65cfa4 (diff: fix --exit-code with
external diff, 2024-05-05) and quickly reverted, as it does not work
with external diffs that do not write to stdout.  There's no reason why
a graphical diff tool would even need to write anything there at all.

I also considered using a non-zero exit code for empty diffs, which
could be done without adding new configuration options.  We'd need to
disable the optimization that allows git diff --quiet to skip calling
external diffs, though -- that might be quite surprising if graphical
diff programs are involved.  And assigning the opposite meaning of the
exit codes compared to diff(1) and git diff --exit-code to the external
diff can cause unnecessary confusion.

Suggested-by: Phillip Wood &lt;phillip.wood123@gmail.com&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t4020: test exit code with external diffs</title>
<updated>2024-06-10T16:19:20Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2024-06-09T07:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33be6cf51acf74e623fb3c4e287f7aebbedf5c09'/>
<id>urn:sha1:33be6cf51acf74e623fb3c4e287f7aebbedf5c09</id>
<content type='text'>
Add tests to check the exit code of git diff with its options --quiet
and --exit-code when using an external diff program.  Currently we
cannot tell whether it found significant changes or not.

While at it, document briefly that --quiet turns off execution of
external diff programs because that behavior surprised me for a moment
while writing the tests.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/doc-diff-name-only'</title>
<updated>2024-05-28T18:17:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-28T18:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e95dce712f1ec7cda64faf9348ff2daf903f538'/>
<id>urn:sha1:6e95dce712f1ec7cda64faf9348ff2daf903f538</id>
<content type='text'>
The documentation for "git diff --name-only" has been clarified
that it is about showing the names in the post-image tree.

* jc/doc-diff-name-only:
  diff: document what --name-only shows
</content>
</entry>
<entry>
<title>diff: document what --name-only shows</title>
<updated>2024-05-17T18:03:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-17T17:14:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4986662cbc2c366d1db9207ff53dfc0d01f8b4dd'/>
<id>urn:sha1:4986662cbc2c366d1db9207ff53dfc0d01f8b4dd</id>
<content type='text'>
The "--name-only" option is about showing the name of each file in
the post-image tree that got changed and nothing else (like "was it
created?").  Unlike the "--name-status" option that tells how the
change happened (e.g., renamed with similarity), it does not give
anything else, like the name of the corresponding file in the old
tree.

For example, if you start from a clean checkout that has a file
whose name is COPYING, here is what you would see:

    $ git mv COPYING RENAMING
    $ git diff -M --name-only HEAD
    RENAMING
    $ git diff -M --name-status HEAD
    R100	COPYING	RENAMING

Lack of the description of this fact has confused readers in the
past.  Even back when dda2d79a ([PATCH] Clean up diff option
descriptions., 2005-07-13) documented "--name-only", "git diff"
already supported the renames, so in a sense, from day one, this
should have been documented more clearly but it wasn't.

Belatedly clarify it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: add diff.srcPrefix and diff.dstPrefix configuration variables</title>
<updated>2024-03-15T17:04:45Z</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2024-03-15T01:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fdc2656331f051a673a61444051cde58044ceeb'/>
<id>urn:sha1:7fdc2656331f051a673a61444051cde58044ceeb</id>
<content type='text'>
Allow the default prefixes "a/" and "b/" to be tweaked by the
diff.srcPrefix and diff.dstPrefix configuration variables.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: enforce placeholders in documentation</title>
<updated>2023-12-26T19:06:57Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2023-12-25T21:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51e846e673ca749273534d063082627a561f7622'/>
<id>urn:sha1:51e846e673ca749273534d063082627a561f7622</id>
<content type='text'>
Any string that is not meant to be used verbatim in the documentation
should be marked as a placeholder.

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>Merge branch 'sn/typo-grammo-phraso-fixes'</title>
<updated>2023-10-29T22:09:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-10-29T22:09:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8183b63ff6a9c7eec5555e51e127e712efb64704'/>
<id>urn:sha1:8183b63ff6a9c7eec5555e51e127e712efb64704</id>
<content type='text'>
Many typos, ungrammatical sentences and wrong phrasing have been
fixed.

* sn/typo-grammo-phraso-fixes:
  t/README: fix multi-prerequisite example
  doc/gitk: s/sticked/stuck/
  git-jump: admit to passing merge mode args to ls-files
  doc/diff-options: improve wording of the log.diffMerges mention
  doc: fix some typos, grammar and wording issues
</content>
</entry>
<entry>
<title>Merge branch 'en/docfixes'</title>
<updated>2023-10-23T20:56:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-10-23T20:56:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d12166d3c8bb12d5a1638c870fc590c4e300a413'/>
<id>urn:sha1:d12166d3c8bb12d5a1638c870fc590c4e300a413</id>
<content type='text'>
Documentation typo and grammo fixes.

* en/docfixes: (25 commits)
  documentation: add missing parenthesis
  documentation: add missing quotes
  documentation: add missing fullstops
  documentation: add some commas where they are helpful
  documentation: fix whitespace issues
  documentation: fix capitalization
  documentation: fix punctuation
  documentation: use clearer prepositions
  documentation: add missing hyphens
  documentation: remove unnecessary hyphens
  documentation: add missing article
  documentation: fix choice of article
  documentation: whitespace is already generally plural
  documentation: fix singular vs. plural
  documentation: fix verb vs. noun
  documentation: fix adjective vs. noun
  documentation: fix verb tense
  documentation: employ consistent verb tense for a list
  documentation: fix subject/verb agreement
  documentation: remove extraneous words
  ...
</content>
</entry>
<entry>
<title>diff-merges: introduce '--dd' option</title>
<updated>2023-10-09T19:47:29Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2023-10-09T16:05:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8e5cb065802e96c5aa5dd25936d9780c5734182'/>
<id>urn:sha1:c8e5cb065802e96c5aa5dd25936d9780c5734182</id>
<content type='text'>
This option provides a shortcut to request diff with respect to first
parent for any kind of commit, universally. It's implemented as pure
synonym for "--diff-merges=first-parent --patch".

Gives user quick and universal way to see what changes, exactly, were
brought to a branch by merges as well as by regular commits.

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