<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff-merges.c, branch v2.31.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.31.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.31.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-12-21T21:47:32Z</updated>
<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='https://git.shady.money/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>
<entry>
<title>diff-merges: add old mnemonic counterparts to --diff-merges</title>
<updated>2020-12-21T21:47:32Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5071c7531692f53cdfec43542f1cbaee573fd2be'/>
<id>urn:sha1:5071c7531692f53cdfec43542f1cbaee573fd2be</id>
<content type='text'>
This adds --diff-merges={m|c|cc} values that match mnemonics of old
options, for those who are used to them.

Note that, say, --diff-meres=cc behaves differently than --cc, as the
latter implies -p and therefore enables diffs for all the commits,
while the former enables output of diffs for merge commits only.

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: let new options enable diff without -p</title>
<updated>2020-12-21T21:47:32Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6d19ecc6b7715b50b0dced7e3d2923a8797df64'/>
<id>urn:sha1:a6d19ecc6b7715b50b0dced7e3d2923a8797df64</id>
<content type='text'>
New options don't have any visible effect unless -p is either given or
implied, as unlike -c/-cc we don't imply -p with --diff-merges. To fix
this, this patch adds new functionality by letting new options enable
output of diffs for merge commits only.

Add 'merges_need_diff' field and set it whenever diff output for merges is
enabled by any of the new options.

Extend diff output logic accordingly, to output diffs for merges when
'merges_need_diff' is set even when no -p has been provided.

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: do not imply -p for new options</title>
<updated>2020-12-21T21:47:32Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5733b20f41ac0fecdacdf34a11acef2d03fac829'/>
<id>urn:sha1:5733b20f41ac0fecdacdf34a11acef2d03fac829</id>
<content type='text'>
Add 'combined_imply_patch' field and set it only for old --cc/-c
options, then imply -p if this flag is set instead of implying -p
whenever 'combined_merge' flag is set.

We don't want new --diff-merge options to imply -p, to make it
possible to enable output of diffs for merges independently from
non-merge commits. At the same time we want to preserve behavior of
old --c/-c/-m options and their interactions with --first-parent, to
stay backward-compatible.

This patch is first step in this direction: it separates old "--cc/-c
imply -p" logic from the rest of the options.

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: implement new values for --diff-merges</title>
<updated>2020-12-21T21:47:32Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c0ba528bc3c61f4582bf68d3f0cc2a72f5f3792'/>
<id>urn:sha1:8c0ba528bc3c61f4582bf68d3f0cc2a72f5f3792</id>
<content type='text'>
We first implement new options as exact synonyms for their original
counterparts, to get all the infrastructure right, and keep functional
improvements for later commits.

The following values are implemented:

--diff-merges=	        old equivalent
first|first-parent    = --first-parent (only format implications)
sep|separate          = -m
comb|combined         = -c
dense| dense-combined = --cc

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: make -m/-c/--cc explicitly mutually exclusive</title>
<updated>2020-12-21T21:47:31Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=255a4dacc59f4f4f62cc61743f40a078b4b38647'/>
<id>urn:sha1:255a4dacc59f4f4f62cc61743f40a078b4b38647</id>
<content type='text'>
-c/--cc got precedence over -m only because of external logic where
corresponding flags are checked before that for -m. This is too
error-prone, so add code that explicitly makes these 3 options
mutually exclusive, so that the last option specified on the
command-line gets precedence.

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 opt settings into separate functions</title>
<updated>2020-12-21T21:47:31Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d2b5f2f496b9868f982b614f9c2232efa7505df'/>
<id>urn:sha1:3d2b5f2f496b9868f982b614f9c2232efa7505df</id>
<content type='text'>
To prepare introduction of new options some of which will be synonyms
to existing options, let every option handling code just call
corresponding function.

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: get rid of now empty diff_merges_init_revs()</title>
<updated>2020-12-21T21:47:31Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6e66af923d54f44bc7d0a404109e900a6a1cb60'/>
<id>urn:sha1:a6e66af923d54f44bc7d0a404109e900a6a1cb60</id>
<content type='text'>
After getting rid of 'ignore_merges' field, the diff_merges_init_revs()
function became empty. Get rid of it.

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: split 'ignore_merges' field</title>
<updated>2020-12-21T21:47:31Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a2c4d80501c50fbe96cc0be096273703a5c0d16'/>
<id>urn:sha1:1a2c4d80501c50fbe96cc0be096273703a5c0d16</id>
<content type='text'>
'ignore_merges' was 3-way field that served two distinct purposes that
we now assign to 2 new independent flags: 'separate_merges', and
'explicit_diff_merges'.

'separate_merges' tells that we need to output diff format containing
separate diff for every parent (as opposed to 'combine_merges').

'explicit_diff_merges' tells that at least one of diff-merges options
has been explicitly specified on the command line, so no defaults
should apply.

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: fix -m to properly override -c/--cc</title>
<updated>2020-12-21T21:47:31Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-12-21T15:19:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6fc944d8956bf75bf2e52a871c02b71b4f9dfcba'/>
<id>urn:sha1:6fc944d8956bf75bf2e52a871c02b71b4f9dfcba</id>
<content type='text'>
Logically, -m, -c, --cc specify 3 different formats for representing
merge commits, yet -m doesn't in fact override -c or --cc, that makes
no sense.

Fix -m to properly override -c/--cc, and change the tests accordingly.

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