<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/diff-options.txt, branch v2.35.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.35.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.35.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-08-11T19:36:18Z</updated>
<entry>
<title>Merge branch 'jn/log-m-does-not-imply-p'</title>
<updated>2021-08-11T19:36:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-08-11T19:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c90d8908ac0c7ec9cd8d2caee7a1a0394636612'/>
<id>urn:sha1:4c90d8908ac0c7ec9cd8d2caee7a1a0394636612</id>
<content type='text'>
Earlier "git log -m" was changed to always produce patch output,
which would break existing scripts, which has been reverted.

* jn/log-m-does-not-imply-p:
  Revert 'diff-merges: let "-m" imply "-p"'
</content>
</entry>
<entry>
<title>Revert 'diff-merges: let "-m" imply "-p"'</title>
<updated>2021-08-09T20:52:01Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2021-08-06T01:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a38e33331560c3e84123c567f95de72d1cfa506'/>
<id>urn:sha1:6a38e33331560c3e84123c567f95de72d1cfa506</id>
<content type='text'>
This reverts commit f5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe, which
made "git log -m" imply "--patch" by default.  The logic was that
"-m", which makes diff generation for merges perform a diff against
each parent, has no use unless I am viewing the diff, so we could save
the user some typing by turning on display of the resulting diff
automatically.  That wasn't expected to adversely affect scripts
because scripts would either be using a command like "git diff-tree"
that already emits diffs by default or would be combining -m with a
diff generation option such as --name-status.  By saving typing for
interactive use without adversely affecting scripts in the wild, it
would be a pure improvement.

The problem is that although diff generation options are only relevant
for the displayed diff, a script author can imagine them affecting
path limiting.  For example, I might run

	git log -w --format=%H -- README

hoping to list commits that edited README, excluding whitespace-only
changes.  In fact, a whitespace-only change is not TREESAME so the use
of -w here has no effect (since we don't apply these diff generation
flags to the diff_options struct rev_info::pruning used for this
purpose), but the documentation suggests that it should work

	Suppose you specified foo as the &lt;paths&gt;. We shall call
	commits that modify foo !TREESAME, and the rest TREESAME. (In
	a diff filtered for foo, they look different and equal,
	respectively.)

and a script author who has not tested whitespace-only changes
wouldn't notice.

Similarly, a script author could include

	git log -m --first-parent --format=%H -- README

to filter the first-parent history for commits that modified README.
The -m is a no-op but it reflects the script author's intent.  For
example, until 1e20a407fe2 (stash list: stop passing "-m" to "git
log", 2021-05-21), "git stash list" did this.

As a result, we can't safely change "-m" to imply "-p" without fear of
breaking such scripts.  Restore the previous behavior.

Noticed because Rust's src/bootstrap/bootstrap.py made use of this
same construct: https://github.com/rust-lang/rust/pull/87513.  That
script has been updated to omit the unnecessary "-m" option, but we
can expect other scripts in the wild to have similar expectations.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diffcore-rename: treat a rename_limit of 0 as unlimited</title>
<updated>2021-07-15T23:54:24Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-15T00:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9dd29dbef01e39fe9df81ad9e5e193128d8c5ad5'/>
<id>urn:sha1:9dd29dbef01e39fe9df81ad9e5e193128d8c5ad5</id>
<content type='text'>
In commit 89973554b52c (diffcore-rename: make diff-tree -l0 mean
-l&lt;large&gt;, 2017-11-29), -l0 was given a special magical "large" value,
but one which was not large enough for some uses (as can be seen from
commit 9f7e4bfa3b6d (diff: remove silent clamp of renameLimit,
2017-11-13).  Make 0 (or a negative value) be treated as unlimited
instead and update the documentation to mention this.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: clarify documentation for rename/copy limits</title>
<updated>2021-07-15T23:54:24Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-15T00:45:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6623a528e00b73f5438724a355c43343d3de8652'/>
<id>urn:sha1:6623a528e00b73f5438724a355c43343d3de8652</id>
<content type='text'>
A few places in the docs implied that rename/copy detection is always
quadratic or that all (unpaired) files were involved in the quadratic
portion of rename/copy detection.  The following two commits each
introduced an exception to this:

    9027f53cb505 (Do linear-time/space rename logic for exact renames,
                  2007-10-25)
    bd24aa2f97a0 (diffcore-rename: guide inexact rename detection based
                  on basenames, 2021-02-14)

(As a side note, for copy detection, the basename guided inexact rename
detection is turned off and the exact renames will only result in
sources (without the dests) being removed from the set of files used in
quadratic detection.  So, for copy detection, the documentation was
closer to correct.)

Avoid implying that all files involved in rename/copy detection are
subject to the full quadratic algorithm.  While at it, also note the
default values for all these settings.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'so/log-m-implies-p'</title>
<updated>2021-06-14T04:33:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-06-14T04:33:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e444e66df45ee5bbe84af0d884c6625627219f3'/>
<id>urn:sha1:8e444e66df45ee5bbe84af0d884c6625627219f3</id>
<content type='text'>
The "-m" option in "git log -m" that does not specify which format,
if any, of diff is desired did not have any visible effect; it now
implies some form of diff (by default "--patch") is produced.

* so/log-m-implies-p:
  diff-merges: let "-m" imply "-p"
  diff-merges: rename "combined_imply_patch" to "merges_imply_patch"
  stash list: stop passing "-m" to "git log"
  git-svn: stop passing "-m" to "git rev-list"
  diff-merges: move specific diff-index "-m" handling to diff-index
  t4013: test "git diff-index -m"
  t4013: test "git diff-tree -m"
  t4013: test "git log -m --stat"
  t4013: test "git log -m --raw"
  t4013: test that "-m" alone has no effect in "git log"
</content>
</entry>
<entry>
<title>diff-merges: let "-m" imply "-p"</title>
<updated>2021-05-21T00:24:14Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-05-20T21:47:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe'/>
<id>urn:sha1:f5bfcc823ba242a46e20fb6f71c9fbf7ebb222fe</id>
<content type='text'>
Fix long standing inconsistency between -c/--cc that do imply -p on
one side, and -m that did not imply -p on the other side.

Change corresponding test accordingly, as "log -m" output should now
match one from "log -m -p", rather than from just "log".

Change documentation accordingly.

NOTES:

After this patch

  git log -m

produces diffs without need to provide -p as well, that improves both
consistency and usability. It gets even more useful if one sets
"log.diffMerges" configuration variable to "first-parent" to force -m
produce usual diff with respect to first parent only.

This patch, however, does not change behavior when specific diff
format is explicitly provided on the command-line, so that commands
like

  git log -m --raw
  git log -m --stat

are not affected, nor does it change commands where specific diff
format is active by default, such as:

  git diff-tree -m

It's also worth to be noticed that exact historical semantics of -m is
still provided by --diff-merges=separate.

Signed-off-by: Sergey Organov &lt;sorganov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/pathname-encoding-doc'</title>
<updated>2021-04-30T04:50:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-30T04:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93e0b28dbb4c1a2cbdce1da8e229af075c2fa092'/>
<id>urn:sha1:93e0b28dbb4c1a2cbdce1da8e229af075c2fa092</id>
<content type='text'>
Clarify that pathnames recorded in Git trees are most often (but
not necessarily) encoded in UTF-8.

* ab/pathname-encoding-doc:
  doc: clarify the filename encoding in git diff
</content>
</entry>
<entry>
<title>doc: clarify the filename encoding in git diff</title>
<updated>2021-04-20T19:57:26Z</updated>
<author>
<name>Andrey Bienkowski</name>
<email>hexagonrecursion@gmail.com</email>
</author>
<published>2021-04-20T11:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9364bf465d23ff26f5e2eb4ee52434e7a69894f1'/>
<id>urn:sha1:9364bf465d23ff26f5e2eb4ee52434e7a69894f1</id>
<content type='text'>
AFAICT parsing the output of `git diff --name-only master...feature`
is the intended way of programmatically getting the list of files
modified
by a feature branch. It is impossible to parse text unless you know what
encoding it is in. The output encoding of diff --name-only and

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc/diff-options: document new --diff-merges features</title>
<updated>2021-04-17T06:38:35Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-04-13T11:41:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=364bc11fe5711fe7fbb98abf376168a207e7a448'/>
<id>urn:sha1:364bc11fe5711fe7fbb98abf376168a207e7a448</id>
<content type='text'>
Document changes in -m and --diff-merges=m semantics, as well as new
--diff-merges=on option.

Signed-off-by: Sergey Organov &lt;sorganov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: --{rotate,skip}-to=&lt;path&gt;</title>
<updated>2021-02-16T17:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-11T19:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1eb4136ac2a24764257567b930535fcece01719f'/>
<id>urn:sha1:1eb4136ac2a24764257567b930535fcece01719f</id>
<content type='text'>
In the implementation of "git difftool", there is a case where the
user wants to start viewing the diffs at a specific path and
continue on to the rest, optionally wrapping around to the
beginning.  Since it is somewhat cumbersome to implement such a
feature as a post-processing step of "git diff" output, let's
support it internally with two new options.

 - "git diff --rotate-to=C", when the resulting patch would show
   paths A B C D E without the option, would "rotate" the paths to
   shows patch to C D E A B instead.  It is an error when there is
   no patch for C is shown.

 - "git diff --skip-to=C" would instead "skip" the paths before C,
   and shows patch to C D E.  Again, it is an error when there is no
   patch for C is shown.

 - "git log [-p]" also accepts these two options, but it is not an
   error if there is no change to the specified path.  Instead, the
   set of output paths are rotated or skipped to the specified path
   or the first path that sorts after the specified path.

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