<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.c, branch v2.10.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.10.3</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.10.3'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2016-11-29T21:28:03Z</updated>
<entry>
<title>Merge branch 'tk/diffcore-delta-remove-unused' into maint</title>
<updated>2016-11-29T21:28:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-11-29T21:28:03Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0a79ccaac7dcfaf93294979fd9608d0f95fd7a47'/>
<id>urn:sha1:0a79ccaac7dcfaf93294979fd9608d0f95fd7a47</id>
<content type='text'>
Code cleanup.

* tk/diffcore-delta-remove-unused:
  diffcore-delta: remove unused parameter to diffcore_count_changes()
</content>
</entry>
<entry>
<title>diffcore-delta: remove unused parameter to diffcore_count_changes()</title>
<updated>2016-11-14T17:24:04Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2016-11-14T13:39:05Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=974e0044d65dc22e8137e93b8ea13aec23d3a5a3'/>
<id>urn:sha1:974e0044d65dc22e8137e93b8ea13aec23d3a5a3</id>
<content type='text'>
The delta_limit parameter to diffcore_count_changes() has been unused
since commit ba23bbc8e ("diffcore-delta: make change counter to byte
oriented again.", 2006-03-04).

Remove the parameter and adjust all callers.

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 'rs/cocci' into maint</title>
<updated>2016-10-28T16:01:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-28T16:01:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=c8fd2201756f9cd10a796311a1b25d7a2ab2a3b9'/>
<id>urn:sha1:c8fd2201756f9cd10a796311a1b25d7a2ab2a3b9</id>
<content type='text'>
Code cleanup.

* rs/cocci:
  use strbuf_add_unique_abbrev() for adding short hashes, part 3
  remove unnecessary NULL check before free(3)
  coccicheck: make transformation for strbuf_addf(sb, "...") more precise
  use strbuf_add_unique_abbrev() for adding short hashes, part 2
  use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
  gitignore: ignore output files of coccicheck make target
  use strbuf_addstr() for adding constant strings to a strbuf, part 2
  add coccicheck make target
  contrib/coccinelle: fix semantic patch for oid_to_hex_r()
</content>
</entry>
<entry>
<title>diff_unique_abbrev(): document its assumption and limitation</title>
<updated>2016-10-01T01:06:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-30T17:42:05Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d709f1fb9d3bfa148dd8b461e633138fdf5957e6'/>
<id>urn:sha1:d709f1fb9d3bfa148dd8b461e633138fdf5957e6</id>
<content type='text'>
This function is used to add "..." to displayed object names in
"diff --raw --abbrev[=&lt;n&gt;]" output.  It bases its behaviour on an
untold assumption that the abbreviation length requested by the
caller is "reasonble", i.e. most of the objects will abbreviate
within the requested length and the resulting length would never
exceed it by more than a few hexdigits (otherwise the resulting
columns would not align).  Explain that in a comment.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/regexec-buf' into maint</title>
<updated>2016-09-29T23:49:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-29T23:49:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=300e95f7df240a0f6efea09d5e21fcc350e5ce83'/>
<id>urn:sha1:300e95f7df240a0f6efea09d5e21fcc350e5ce83</id>
<content type='text'>
Some codepaths in "git diff" used regexec(3) on a buffer that was
mmap(2)ed, which may not have a terminating NUL, leading to a read
beyond the end of the mapped region.  This was fixed by introducing
a regexec_buf() helper that takes a &lt;ptr,len&gt; pair with REG_STARTEND
extension.

* js/regexec-buf:
  regex: use regexec_buf()
  regex: add regexec_buf() that can work on a non NUL-terminated string
  regex: -G&lt;pattern&gt; feeds a non NUL-terminated string to regexec() and fails
</content>
</entry>
<entry>
<title>use strbuf_add_unique_abbrev() for adding short hashes, part 2</title>
<updated>2016-09-27T21:02:40Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-09-27T19:11:58Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f937d78553ce22505543580ae7958d9f5ffeeb89'/>
<id>urn:sha1:f937d78553ce22505543580ae7958d9f5ffeeb89</id>
<content type='text'>
Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs
instead of taking detours through find_unique_abbrev() and its static
buffer.  This is shorter and a bit more efficient.

1eb47f167d65d1d305b9c196a1bb40eb96117cb1 already converted six cases,
this patch covers three more.

A semantic patch for Coccinelle is included for easier checking for
new cases that might be introduced in the future.

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>regex: use regexec_buf()</title>
<updated>2016-09-21T20:56:15Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-09-21T18:24:14Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b7d36ffca02c23f545d6e098d78180e6e72dfd8d'/>
<id>urn:sha1:b7d36ffca02c23f545d6e098d78180e6e72dfd8d</id>
<content type='text'>
The new regexec_buf() function operates on buffers with an explicitly
specified length, rather than NUL-terminated strings.

We need to use this function whenever the buffer we want to pass to
regexec(3) may have been mmap(2)ed (and is hence not NUL-terminated).

Note: the original motivation for this patch was to fix a bug where
`git diff -G &lt;regex&gt;` would crash. This patch converts more callers,
though, some of which allocated to construct NUL-terminated strings,
or worse, modified buffers to temporarily insert NULs while calling
regexec(3).  By converting them to use regexec_buf(), the code has
become much cleaner.

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>diff: remove dead code</title>
<updated>2016-09-08T20:54:37Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-09-07T23:36:48Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ca9b37e5a8a76b7b5c9990481ce4f9894dd40392'/>
<id>urn:sha1:ca9b37e5a8a76b7b5c9990481ce4f9894dd40392</id>
<content type='text'>
When `len &lt; 1`, len has to be 0 or negative, emit_line will then remove the
first character and by then `len` would be negative. As this doesn't
happen, it is safe to assume it is dead code.

This continues to simplify the code, which was started in b8d9c1a66b
(2009-09-03,  diff.c: the builtin_diff() deals with only two-file
comparison).

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: omit found pointer from emit_callback</title>
<updated>2016-09-08T20:54:23Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-09-07T23:36:46Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ba16233ccd98ee8db6d418903102c8730d87dcc5'/>
<id>urn:sha1:ba16233ccd98ee8db6d418903102c8730d87dcc5</id>
<content type='text'>
We keep the actual data in the diff options, which are just as accessible.
Remove the pointer stored in struct emit_callback for readability.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.c: use diff_options directly</title>
<updated>2016-09-08T20:46:46Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-09-07T23:36:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=fb33b62ca6e6dbfa8a5330cb0535fe122e250b5f'/>
<id>urn:sha1:fb33b62ca6e6dbfa8a5330cb0535fe122e250b5f</id>
<content type='text'>
The value of `ecbdata-&gt;opt` is accessible via the short variable `o`
already, so let's use that instead.

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