<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/range-diff.h, branch v2.50.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.50.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.50.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-12-16T16:45:48Z</updated>
<entry>
<title>range-diff: optionally include merge commits' diffs in the analysis</title>
<updated>2024-12-16T16:45:48Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-12-16T14:11:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8043236c6c9cb9e943a87ab2e55e8e394796727'/>
<id>urn:sha1:f8043236c6c9cb9e943a87ab2e55e8e394796727</id>
<content type='text'>
The `git log` command already offers support for including diffs for
merges, via the `--diff-merges=&lt;format&gt;` option.

Let's add corresponding support for `git range-diff`, too. This makes it
more convenient to spot differences between commit ranges that contain
merges.

This is especially true in scenarios with non-trivial merges, i.e.
merges introducing changes other than, or in addition to, what merge ORT
would have produced. Merging a topic branch that changes a function
signature into a branch that added a caller of that function, for
example, would require the merge commit itself to adjust that caller to
the modified signature.

In my code reviews, I found the `--diff-merges=remerge` option
particularly useful.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>format-patch: run range-diff with larger creation-factor</title>
<updated>2024-05-06T18:57:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-06T16:40:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c22d41d641711879c57299244ae13b6c4a215fee'/>
<id>urn:sha1:c22d41d641711879c57299244ae13b6c4a215fee</id>
<content type='text'>
We see too often that a range-diff added to format-patch output
shows too many "unmatched" patches.  This is because the default
value for creation-factor is set to a relatively low value.

It may be justified for other uses (like you have a yet-to-be-sent
new iteration of your series, and compare it against the 'seen'
branch that has an older iteration, probably with the '--left-only'
option, to pick out only your patches while ignoring the others) of
"range-diff" command, but when the command is run as part of the
format-patch, the user _knows_ and expects that the patches in the
old and the new iterations roughly correspond to each other, so we
can and should use a much higher default.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/range-diff-one-side-only'</title>
<updated>2021-02-18T01:21:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-18T01:21:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dadc91ff0c15b655070ad334a27a734e91635bd5'/>
<id>urn:sha1:dadc91ff0c15b655070ad334a27a734e91635bd5</id>
<content type='text'>
The "git range-diff" command learned "--(left|right)-only" option
to show only one side of the compared range.

* js/range-diff-one-side-only:
  range-diff: offer --left-only/--right-only options
  range-diff: move the diffopt initialization down one layer
  range-diff: combine all options in a single data structure
  range-diff: simplify code spawning `git log`
  range-diff: libify the read_patches() function again
  range-diff: avoid leaking memory in two error code paths
</content>
</entry>
<entry>
<title>range-diff/format-patch: handle commit ranges other than A..B</title>
<updated>2021-02-07T05:24:55Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2021-02-05T14:44:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=359f0d754ab709c5a1ff3267bc117fb8559c62c2'/>
<id>urn:sha1:359f0d754ab709c5a1ff3267bc117fb8559c62c2</id>
<content type='text'>
In the `SPECIFYING RANGES` section of gitrevisions[7], two ways are
described to specify commit ranges that `range-diff` does not yet
accept: "&lt;commit&gt;^!" and "&lt;commit&gt;^-&lt;n&gt;".

Let's accept them, by parsing them via the revision machinery and
looking for at least one interesting and one uninteresting revision in
the resulting `pending` array.

This also finally lets us reject arguments that _do_ contain `..` but
are not actually ranges, e.g. `HEAD^{/do.. match this}`.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>range-diff: offer --left-only/--right-only options</title>
<updated>2021-02-07T05:14:31Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2021-02-05T14:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e79f973266cfe0e3bab0e26e869b682078e457d'/>
<id>urn:sha1:1e79f973266cfe0e3bab0e26e869b682078e457d</id>
<content type='text'>
When comparing commit ranges, one is frequently interested only in one
side, such as asking the question "Has this patch that I submitted to
the Git mailing list been applied?": one would only care about the part
of the output that corresponds to the commits in a local branch.

To make that possible, imitate the `git rev-list` options `--left-only`
and `--right-only`.

This addresses https://github.com/gitgitgadget/git/issues/206

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>range-diff: combine all options in a single data structure</title>
<updated>2021-02-07T05:14:31Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2021-02-05T14:46:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1ce6c191e9d15ce78041d8b6496c246b10d9b2d'/>
<id>urn:sha1:f1ce6c191e9d15ce78041d8b6496c246b10d9b2d</id>
<content type='text'>
This will make it easier to implement the `--left-only` and
`--right-only` options.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>range-diff/format-patch: refactor check for commit range</title>
<updated>2021-01-28T06:01:49Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2021-01-27T16:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=679b5916cdafdcfa9fb36c31dbf53d7e4aa0af0b'/>
<id>urn:sha1:679b5916cdafdcfa9fb36c31dbf53d7e4aa0af0b</id>
<content type='text'>
Currently, when called with exactly two arguments, `git range-diff`
tests for a literal `..` in each of the two. Likewise, the argument
provided via `--range-diff` to `git format-patch` is checked in the same
manner.

However, `&lt;commit&gt;^!` is a perfectly valid commit range, equivalent to
`&lt;commit&gt;^..&lt;commit&gt;` according to the `SPECIFYING RANGES` section of
gitrevisions[7].

In preparation for allowing more sophisticated ways to specify commit
ranges, let's refactor the check into its own function.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strvec: convert remaining callers away from argv_array name</title>
<updated>2020-07-28T22:02:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:25:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f'/>
<id>urn:sha1:c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f</id>
<content type='text'>
We eventually want to drop the argv_array name and just use strvec
consistently. There's no particular reason we have to do it all at once,
or care about interactions between converted and unconverted bits.
Because of our preprocessor compat layer, the names are interchangeable
to the compiler (so even a definition and declaration using different
names is OK).

This patch converts all of the remaining files, as the resulting diff is
reasonably sized.

The conversion was done purely mechanically with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe '
    s/ARGV_ARRAY/STRVEC/g;
    s/argv_array/strvec/g;
  '

We'll deal with any indentation/style fallouts separately.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strvec: rename files from argv-array to strvec</title>
<updated>2020-07-28T22:02:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98'/>
<id>urn:sha1:dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98</id>
<content type='text'>
This requires updating #include lines across the code-base, but that's
all fairly mechanical, and was done with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe 's/argv-array.h/strvec.h/'

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dl/range-diff-with-notes'</title>
<updated>2019-12-16T21:08:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-12-16T21:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d1c0fe8d9b16bf8b6b1cc0e83fac6670e3f64f0f'/>
<id>urn:sha1:d1c0fe8d9b16bf8b6b1cc0e83fac6670e3f64f0f</id>
<content type='text'>
Code clean-up.

* dl/range-diff-with-notes:
  range-diff: clear `other_arg` at end of function
  range-diff: mark pointers as const
  t3206: fix incorrect test name
</content>
</entry>
</feed>
