<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.c, branch v2.5.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.5.4</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.5.4'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2015-09-28T22:33:56Z</updated>
<entry>
<title>Sync with 2.4.10</title>
<updated>2015-09-28T22:33:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-28T22:33:56Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=11a458befcd7662fbe6d2d53c76d49ae2b0fe219'/>
<id>urn:sha1:11a458befcd7662fbe6d2d53c76d49ae2b0fe219</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sync with 2.3.10</title>
<updated>2015-09-28T22:28:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-28T22:28:26Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6343e2f6f271cf344ea8e7384342502faecaf37c'/>
<id>urn:sha1:6343e2f6f271cf344ea8e7384342502faecaf37c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>react to errors in xdi_diff</title>
<updated>2015-09-28T21:57:10Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T23:12:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3efb988098858bf6b974b1e673a190f9d2965d1d'/>
<id>urn:sha1:3efb988098858bf6b974b1e673a190f9d2965d1d</id>
<content type='text'>
When we call into xdiff to perform a diff, we generally lose
the return code completely. Typically by ignoring the return
of our xdi_diff wrapper, but sometimes we even propagate
that return value up and then ignore it later.  This can
lead to us silently producing incorrect diffs (e.g., "git
log" might produce no output at all, not even a diff header,
for a content-level diff).

In practice this does not happen very often, because the
typical reason for xdiff to report failure is that it
malloc() failed (it uses straight malloc, and not our
xmalloc wrapper).  But it could also happen when xdiff
triggers one our callbacks, which returns an error (e.g.,
outf() in builtin/rerere.c tries to report a write failure
in this way). And the next patch also plans to add more
failure modes.

Let's notice an error return from xdiff and react
appropriately. In most of the diff.c code, we can simply
die(), which matches the surrounding code (e.g., that is
what we do if we fail to load a file for diffing in the
first place). This is not that elegant, but we are probably
better off dying to let the user know there was a problem,
rather than simply generating bogus output.

We could also just die() directly in xdi_diff, but the
callers typically have a bit more context, and can provide a
better message (and if we do later decide to pass errors up,
we're one step closer to doing so).

There is one interesting case, which is in diff_grep(). Here
if we cannot generate the diff, there is nothing to match,
and we silently return "no hits". This is actually what the
existing code does already, but we make it a little more
explicit.

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 'jc/diff-ws-error-highlight'</title>
<updated>2015-07-15T19:30:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-07-15T19:30:14Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=abecddea25e9c39857b963c8a0cffbbdc135caa9'/>
<id>urn:sha1:abecddea25e9c39857b963c8a0cffbbdc135caa9</id>
<content type='text'>
A hotfix to a new feature in 2.5.0-rc.

* jc/diff-ws-error-highlight:
  diff: parse ws-error-highlight option more strictly
</content>
</entry>
<entry>
<title>diff: parse ws-error-highlight option more strictly</title>
<updated>2015-07-12T16:55:23Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2015-07-11T12:58:21Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3f4f17b51b30262041a2248ef9f966f6248aed50'/>
<id>urn:sha1:3f4f17b51b30262041a2248ef9f966f6248aed50</id>
<content type='text'>
Check if a matched token is followed by a delimiter before advancing the
pointer arg.  This avoids accepting composite words like "allnew" or
"defaultcontext" and misparsing them as "new" or "context".

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/color-diff-plain-is-context' into maint</title>
<updated>2015-06-25T18:02:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-25T18:02:11Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6998d890c7120fe2d30fa0b6f80ddfaad716f632'/>
<id>urn:sha1:6998d890c7120fe2d30fa0b6f80ddfaad716f632</id>
<content type='text'>
"color.diff.plain" was a misnomer; give it 'color.diff.context' as
a more logical synonym.

* jk/color-diff-plain-is-context:
  diff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT
  diff: accept color.diff.context as a synonym for "plain"
</content>
</entry>
<entry>
<title>Merge branch 'jk/color-diff-plain-is-context'</title>
<updated>2015-06-11T16:29:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-11T16:29:53Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=db65170ee5558b47355e7f9f111aecb5b152d4d9'/>
<id>urn:sha1:db65170ee5558b47355e7f9f111aecb5b152d4d9</id>
<content type='text'>
"color.diff.plain" was a misnomer; give it 'color.diff.context' as
a more logical synonym.

* jk/color-diff-plain-is-context:
  diff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT
  diff: accept color.diff.context as a synonym for "plain"
</content>
</entry>
<entry>
<title>Merge branch 'jc/diff-ws-error-highlight'</title>
<updated>2015-06-11T16:29:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-11T16:29:51Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=709cd912d4663af87903d3d278a3bab9d4d84153'/>
<id>urn:sha1:709cd912d4663af87903d3d278a3bab9d4d84153</id>
<content type='text'>
Allow whitespace breakages in deleted and context lines to be also
painted in the output.

* jc/diff-ws-error-highlight:
  diff.c: --ws-error-highlight=&lt;kind&gt; option
  diff.c: add emit_del_line() and emit_context_line()
  t4015: separate common setup and per-test expectation
  t4015: modernise style
</content>
</entry>
<entry>
<title>diff.h: rename DIFF_PLAIN color slot to DIFF_CONTEXT</title>
<updated>2015-05-27T20:54:42Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-27T20:48:46Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=8dbf3eb6850d6d9495ace908625fe50888b111e6'/>
<id>urn:sha1:8dbf3eb6850d6d9495ace908625fe50888b111e6</id>
<content type='text'>
The latter is a much more descriptive name (and we support
"color.diff.context" now). This also updates the name of any
local variables which were used to store the color.

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>diff: accept color.diff.context as a synonym for "plain"</title>
<updated>2015-05-27T20:54:37Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-27T07:22:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=74b15bfbf6f7efffa40fda170b3a3cb0218d8651'/>
<id>urn:sha1:74b15bfbf6f7efffa40fda170b3a3cb0218d8651</id>
<content type='text'>
The term "plain" is a bit ambiguous; let's allow the more
specific "context", but keep "plain" around for
compatibility.

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