<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff-merges.c, 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-09-07T18:11:35Z</updated>
<entry>
<title>diff-index: restore -c/--cc options handling</title>
<updated>2021-09-07T18:11:35Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-09-01T16:52:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5acffd34738f9718caf2a5811bddbf2f40e968a0'/>
<id>urn:sha1:5acffd34738f9718caf2a5811bddbf2f40e968a0</id>
<content type='text'>
This fixes 19b2517f (diff-merges: move specific diff-index "-m"
handling to diff-index, 2021-05-21).

That commit disabled handling of all diff for merges options in
diff-index on an assumption that they are unused. However, it later
appeared that -c and --cc, even though undocumented and not being
covered by tests, happen to have had particular effect on diff-index
output.

Restore original -c/--cc options handling by diff-index.

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>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='http://git.kilabit.info/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>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='http://git.kilabit.info/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>diff-merges: rename "combined_imply_patch" to "merges_imply_patch"</title>
<updated>2021-05-21T00:24:14Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-05-20T21:47:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=fd16a39944ce2f2967ed015379f5bd05bac639bb'/>
<id>urn:sha1:fd16a39944ce2f2967ed015379f5bd05bac639bb</id>
<content type='text'>
This is refactoring change in preparation for the next commit that
will let -m imply -p.

The old name doesn't match the intention to let not only -c/-cc imply
-p, but also -m, that is not a "combined" format, so we rename the
flag accordingly.

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-merges: move specific diff-index "-m" handling to diff-index</title>
<updated>2021-05-21T00:24:14Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-05-20T21:46:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=19b2517f95a0a908a8ada7417cf0717299e7e1aa'/>
<id>urn:sha1:19b2517f95a0a908a8ada7417cf0717299e7e1aa</id>
<content type='text'>
Move specific handling of "-m" for diff-index to diff-index.c, so
diff-merges is left to handle only diff for merges options.

Being a better design by itself, this is especially essential in
preparation for letting -m imply -p, as "diff-index -m" obviously
should not imply -p, as it's entirely unrelated.

To handle this, in addition to moving specific diff-index "-m" code
out of diff-merges, we introduce new

  diff_merges_suppress_options_parsing()

and call it before generic options processing in cmd_diff_index().

This new diff_merges_suppress_options_parsing() could then be reused
and called before invocations of setup_revisions() for other commands
that don't need --diff-merges options, but that's outside of the scope
of these patch series.

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-merges: introduce log.diffMerges config variable</title>
<updated>2021-04-17T06:38:35Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-04-13T11:41:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=17c13e60fd799336b28d320dcba06fe1ef06e01d'/>
<id>urn:sha1:17c13e60fd799336b28d320dcba06fe1ef06e01d</id>
<content type='text'>
New log.diffMerges configuration variable sets the format that
--diff-merges=on will be using. The default is "separate".

t4013: add the following tests for log.diffMerges config:

* Test that wrong values are denied.

* Test that the value of log.diffMerges properly affects both
--diff-merges=on and -m.

t9902: fix completion tests for log.d* to match log.diffMerges.

Added documentation for log.diffMerges.

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-merges: adapt -m to enable default diff format</title>
<updated>2021-04-17T06:38:35Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-04-13T11:41:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=38fc4dbbc2f110192752a3b2c99abb745f0494bf'/>
<id>urn:sha1:38fc4dbbc2f110192752a3b2c99abb745f0494bf</id>
<content type='text'>
Let -m option (and --diff-merges=m) enable the default format instead
of "separate", to be able to tune it with log.diffMerges 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-merges: refactor set_diff_merges()</title>
<updated>2021-04-17T06:38:35Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-04-13T11:41:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=26a0f58da84a7da11f9175144c9a926e7b376349'/>
<id>urn:sha1:26a0f58da84a7da11f9175144c9a926e7b376349</id>
<content type='text'>
Split set_diff_merges() into separate parsing and execution functions,
the former to be reused for parsing of configuration values later in
the patch series.

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-merges: introduce --diff-merges=on</title>
<updated>2021-04-17T06:38:35Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2021-04-13T11:41:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4320815eb9a002b4ee64f70dda9b1c1e019f4894'/>
<id>urn:sha1:4320815eb9a002b4ee64f70dda9b1c1e019f4894</id>
<content type='text'>
Introduce the notion of default diff format for merges, and the option
"on" to select it. The default format is "separate" and can't yet
be changed, so effectively "on" is just a synonym for "separate"
for now. Add corresponding test to t4013.

This is in preparation for introducing log.diffMerges configuration
option that will let --diff-merges=on to be configured to any
supported format.

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-merges: add '--diff-merges=1' as synonym for 'first-parent'</title>
<updated>2020-12-21T21:47:32Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:55Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=388091fe4d9e06475f491c195e84e1996aad3f42'/>
<id>urn:sha1:388091fe4d9e06475f491c195e84e1996aad3f42</id>
<content type='text'>
As we now have --diff-merges={m|c|cc}, add --diff-merges=1 as synonym
for --diff-merges=first-parent, to have shorter mnemonics for it as
well.

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