<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.c, branch v2.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-02-05T22:54:15Z</updated>
<entry>
<title>Merge branch 'nd/diff-with-path-params' into maint</title>
<updated>2016-02-05T22:54:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-05T22:54:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=02dab5d399fb276f91646d7780da90596bffefab'/>
<id>urn:sha1:02dab5d399fb276f91646d7780da90596bffefab</id>
<content type='text'>
A few options of "git diff" did not work well when the command was
run from a subdirectory.

* nd/diff-with-path-params:
  diff: make -O and --output work in subdirectory
  diff-no-index: do not take a redundant prefix argument
</content>
</entry>
<entry>
<title>diff: make -O and --output work in subdirectory</title>
<updated>2016-01-21T18:45:13Z</updated>
<author>
<name>Duy Nguyen</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-01-21T11:48:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a97262c62f1a31fcc7edf7629d313058bc7d66b5'/>
<id>urn:sha1:a97262c62f1a31fcc7edf7629d313058bc7d66b5</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tk/sigchain-unnecessary-post-tempfile'</title>
<updated>2015-10-29T20:59:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-29T20:59:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=433cc7e3fb861d4530ca6c49b152e94219bddfda'/>
<id>urn:sha1:433cc7e3fb861d4530ca6c49b152e94219bddfda</id>
<content type='text'>
Remove no-longer used #include.

* tk/sigchain-unnecessary-post-tempfile:
  shallow: remove unused #include "sigchain.h"
  read-cache: remove unused #include "sigchain.h"
  diff: remove unused #include "sigchain.h"
  credential-cache--daemon: remove unused #include "sigchain.h"
</content>
</entry>
<entry>
<title>diff: remove unused #include "sigchain.h"</title>
<updated>2015-10-22T18:12:37Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2015-10-22T12:43:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=086ecab1a7b7bfe8d87f5403d37cca84b41dfd72'/>
<id>urn:sha1:086ecab1a7b7bfe8d87f5403d37cca84b41dfd72</id>
<content type='text'>
After switching to use the tempfile module in commit 284098f1
(diff: use tempfile module), no declarations from sigchain.h are used in
diff.c anymore. Thus, remove the #include.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/war-on-sprintf'</title>
<updated>2015-10-20T22:24:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-20T22:24:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78891795df91a313fac590dd6cff9d8aace0dc9a'/>
<id>urn:sha1:78891795df91a313fac590dd6cff9d8aace0dc9a</id>
<content type='text'>
Many allocations that is manually counted (correctly) that are
followed by strcpy/sprintf have been replaced with a less error
prone constructs such as xstrfmt.

Macintosh-specific breakage was noticed and corrected in this
reroll.

* jk/war-on-sprintf: (70 commits)
  name-rev: use strip_suffix to avoid magic numbers
  use strbuf_complete to conditionally append slash
  fsck: use for_each_loose_file_in_objdir
  Makefile: drop D_INO_IN_DIRENT build knob
  fsck: drop inode-sorting code
  convert strncpy to memcpy
  notes: document length of fanout path with a constant
  color: add color_set helper for copying raw colors
  prefer memcpy to strcpy
  help: clean up kfmclient munging
  receive-pack: simplify keep_arg computation
  avoid sprintf and strcpy with flex arrays
  use alloc_ref rather than hand-allocating "struct ref"
  color: add overflow checks for parsing colors
  drop strcpy in favor of raw sha1_to_hex
  use sha1_to_hex_r() instead of strcpy
  daemon: use cld-&gt;env_array when re-spawning
  stat_tracking_info: convert to argv_array
  http-push: use an argv_array for setup_revisions
  fetch-pack: use argv_array for index-pack / unpack-objects
  ...
</content>
</entry>
<entry>
<title>use sha1_to_hex_r() instead of strcpy</title>
<updated>2015-10-05T18:08:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T21:08:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d59f765ac9b3d6fc2e6bea262222b80493055f12'/>
<id>urn:sha1:d59f765ac9b3d6fc2e6bea262222b80493055f12</id>
<content type='text'>
Before sha1_to_hex_r() existed, a simple way to get hex
sha1 into a buffer was with:

  strcpy(buf, sha1_to_hex(sha1));

This isn't wrong (assuming the buf is 41 characters), but it
makes auditing the code base for bad strcpy() calls harder,
as these become false positives.

Let's convert them to sha1_to_hex_r(), and likewise for
some calls to find_unique_abbrev(). While we're here, we'll
double-check that all of the buffers are correctly sized,
and use the more obvious GIT_SHA1_HEXSZ constant.

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>Sync with v2.5.4</title>
<updated>2015-09-29T02:16:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-29T02:16:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3adc4ec7b9e1d2118501728a75a5b93d971974fa'/>
<id>urn:sha1:3adc4ec7b9e1d2118501728a75a5b93d971974fa</id>
<content type='text'>
</content>
</entry>
<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://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://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://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>
</feed>
