<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/range-diff.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-11-30T04:47:55Z</updated>
<entry>
<title>format-patch: do not let its diff-options affect --range-diff</title>
<updated>2018-11-30T04:47:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-30T04:27:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d8981c3f885ceaddfec0e545b0f995b96e5ec58f'/>
<id>urn:sha1:d8981c3f885ceaddfec0e545b0f995b96e5ec58f</id>
<content type='text'>
Stop leaking how the primary output of format-patch is customized to
the range-diff machinery and instead let the latter use its own
"reasonable default", in order to correct the breakage introduced by
a5170794 ("Merge branch 'ab/range-diff-no-patch'", 2018-11-18) on
the 'master' front.  "git format-patch --range-diff..." without any
weird diff option started to include the "range-diff --stat" output,
which is rather useless right now, that made the whole thing
unusable and this is probably the least disruptive way to whip the
codebase into a shippable shape.

We may want to later make the range-diff driven by format-patch more
configurable, but that would have to wait until we have a good
design.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/range-diff-no-patch'</title>
<updated>2018-11-18T09:23:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5170794372cf1325710a3419473c91ec4af53bf'/>
<id>urn:sha1:a5170794372cf1325710a3419473c91ec4af53bf</id>
<content type='text'>
The "--no-patch" option, which can be used to get a high-level
overview without the actual line-by-line patch difference shown, of
the "range-diff" command was earlier broken, which has been
corrected.

* ab/range-diff-no-patch:
  range-diff: make diff option behavior (e.g. --stat) consistent
  range-diff: fix regression in passing along diff options
  range-diff doc: add a section about output stability
</content>
</entry>
<entry>
<title>range-diff: make diff option behavior (e.g. --stat) consistent</title>
<updated>2018-11-14T06:25:48Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-11-13T18:55:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a48e12ef7a9498084dc510765452bc3b8677683f'/>
<id>urn:sha1:a48e12ef7a9498084dc510765452bc3b8677683f</id>
<content type='text'>
Make the behavior when diff options (e.g. "--stat") are passed
consistent with how "diff" behaves.

Before 73a834e9e2 ("range-diff: relieve callers of low-level
configuration burden", 2018-07-22) running range-diff with "--stat"
would produce stat output and the diff output, as opposed to how
"diff" behaves where once "--stat" is specified "--patch" also needs
to be provided to emit the patch output.

As noted in a previous change ("range-diff doc: add a section about
output stability", 2018-11-07) the "--stat" output with "range-diff"
is useless at the moment.

But we should behave consistently with "diff" in anticipation of such
output being useful in the future, because it would make for confusing
UI if "diff" and "range-diff" behaved differently when it came to how
they interpret diff options.

The new behavior is also consistent with the existing documentation
added in ba931edd28 ("range-diff: populate the man page",
2018-08-13). See "[...]also accepts the regular diff options[...]" in
git-range-diff(1).

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/xdiff-interface'</title>
<updated>2018-11-13T13:37:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-13T13:37:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39d23dfa409e51844ddda99599927092c8300f12'/>
<id>urn:sha1:39d23dfa409e51844ddda99599927092c8300f12</id>
<content type='text'>
The interface into "xdiff" library used to discover the offset and
size of a generated patch hunk by first formatting it into the
textual hunk header "@@ -n,m +k,l @@" and then parsing the numbers
out.  A new interface has been introduced to allow callers a more
direct access to them.

* jk/xdiff-interface:
  xdiff-interface: drop parse_hunk_header()
  range-diff: use a hunk callback
  diff: convert --check to use a hunk callback
  combine-diff: use an xdiff hunk callback
  diff: use hunk callback for word-diff
  diff: discard hunk headers for patch-ids earlier
  diff: avoid generating unused hunk header lines
  xdiff-interface: provide a separate consume callback for hunks
  xdiff: provide a separate emit callback for hunks
</content>
</entry>
<entry>
<title>range-diff: fix regression in passing along diff options</title>
<updated>2018-11-12T03:09:21Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-11-09T10:18:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4624185a67aa17104762a4bbff2b05727ef4cd83'/>
<id>urn:sha1:4624185a67aa17104762a4bbff2b05727ef4cd83</id>
<content type='text'>
In 73a834e9e2 ("range-diff: relieve callers of low-level configuration
burden", 2018-07-22) we broke passing down options like --no-patch,
--stat etc.

Fix that regression, and add a test asserting the pre-73a834e9e2
behavior for some of these diff options.

As noted in a change leading up to this ("range-diff doc: add a
section about output stability", 2018-11-07) the output is not meant
to be stable. So this regression test will likely need to be tweaked
once we get a "proper" --stat option.

See
https://public-inbox.org/git/nycvar.QRO.7.76.6.1811071202480.39@tvgsbejvaqbjf.bet/
for a further explanation of the regression. The fix here is not the
same as in Johannes's on-list patch, for reasons that'll be explained
in a follow-up commit.

The quoting of "EOF" here mirrors that of an earlier test. Perhaps
that should be fixed, but let's leave that up to a later cleanup
change.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>range-diff: use a hunk callback</title>
<updated>2018-11-05T04:14:35Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-02T06:39:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2eb80935a4e93cd775b5e8dc3f07fa1cd21d330'/>
<id>urn:sha1:d2eb80935a4e93cd775b5e8dc3f07fa1cd21d330</id>
<content type='text'>
When we count the lines in a diff, we don't actually care about the
contents of each line. By using a hunk callback, we tell xdiff that it
does not need to even bother generating a hunk header line, saving a
small amount of work.

Arguably we could even ignore the hunk headers completely, since we're
just computing a cost function between patches. But doing it this way
maintains the exact same behavior before and after.

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>xdiff-interface: provide a separate consume callback for hunks</title>
<updated>2018-11-02T11:43:02Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-02T06:35:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9346d6d14dddc7989ba879839d58f6c2426cffbb'/>
<id>urn:sha1:9346d6d14dddc7989ba879839d58f6c2426cffbb</id>
<content type='text'>
The previous commit taught xdiff to optionally provide the hunk header
data to a specialized callback. But most users of xdiff actually use our
more convenient xdi_diff_outf() helper, which ensures that our callbacks
are always fed whole lines.

Let's plumb the special hunk-callback through this interface, too. It
will follow the same rule as xdiff when the hunk callback is NULL (i.e.,
continue to pass a stringified hunk header to the line callback). Since
we add NULL to each caller, there should be no behavior change yet.

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>range-diff: allow to diff files regardless of submodule config</title>
<updated>2018-10-25T05:47:53Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@intel.com</email>
</author>
<published>2018-10-24T19:46:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e573e8fcc395b5249c1c4713c2e385893c98b8c'/>
<id>urn:sha1:0e573e8fcc395b5249c1c4713c2e385893c98b8c</id>
<content type='text'>
If we have `submodule.diff = log' in the configuration file
or `--submodule=log' is given as argument, range-diff fails
to compare both diffs and we only get the following output:

    Submodule a 0000000...0000000 (new submodule)

Even if the repository doesn't have any submodule.

That's because the mode in diff_filespec is not correct and when
flushing the diff, down in builtin_diff() we will enter the condition:

	if (o-&gt;submodule_format == DIFF_SUBMODULE_LOG &amp;&amp;
	    (!one-&gt;mode || S_ISGITLINK(one-&gt;mode)) &amp;&amp;
	    (!two-&gt;mode || S_ISGITLINK(two-&gt;mode))) {
		show_submodule_summary(o, one-&gt;path ? one-&gt;path : two-&gt;path,
				&amp;one-&gt;oid, &amp;two-&gt;oid,
				two-&gt;dirty_submodule);
		return;

It turns out that S_ISGITLINK will return true (mode == 0160000 here).
Similar thing happens if submodule.diff is "diff".

Do like it's done in grep.c when calling fill_filespec() and force it to
be recognized as a file by adding S_IFREG to the mode.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@intel.com&gt;
Acked-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'es/format-patch-rangediff'</title>
<updated>2018-09-17T20:53:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-17T20:53:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=881c019ea6a0a45f97fb8a1865a88b07263a02ca'/>
<id>urn:sha1:881c019ea6a0a45f97fb8a1865a88b07263a02ca</id>
<content type='text'>
"git format-patch" learned a new "--range-diff" option to explain
the difference between this version and the previous attempt in
the cover letter (or after the tree-dashes as a comment).

* es/format-patch-rangediff:
  format-patch: allow --range-diff to apply to a lone-patch
  format-patch: add --creation-factor tweak for --range-diff
  format-patch: teach --range-diff to respect -v/--reroll-count
  format-patch: extend --range-diff to accept revision range
  format-patch: add --range-diff option to embed diff in cover letter
  range-diff: relieve callers of low-level configuration burden
  range-diff: publish default creation factor
  range-diff: respect diff_option.file rather than assuming 'stdout'
</content>
</entry>
<entry>
<title>range-diff: indent special lines as context</title>
<updated>2018-08-20T21:33:28Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-08-17T20:43:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2543a64187bb80078e493268e683cb0661be754f'/>
<id>urn:sha1:2543a64187bb80078e493268e683cb0661be754f</id>
<content type='text'>
The range-diff coloring is a bit fuzzy when it comes to special lines of
a diff, such as indicating new and old files with +++ and ---, as it
would pickup the first character and interpret it for its coloring, which
seems annoying as in regular diffs, these lines are colored bold via
DIFF_METAINFO.

By indenting these lines by a white space, they will be treated as context
which is much more useful, an example [1] on the range diff series itself:

[...]
    + diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt
    + new file mode 100644
    + --- /dev/null
    + +++ b/Documentation/git-range-diff.txt
    +@@
    ++git-range-diff(1)
[...]
    +
      diff --git a/Makefile b/Makefile
      --- a/Makefile
      +++ b/Makefile
[...]

The first lines that introduce the new file for the man page will have the
'+' sign colored and the rest of the line will be bold.

The later lines that indicate a change to the Makefile will be treated as
context both in the outer and inner diff, such that those lines stay
regular color.

[1] ./git-range-diff pr-1/dscho/branch-diff-v3...pr-1/dscho/branch-diff-v4
    These tags are found at https://github.com/gitgitgadget/git

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