<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diff.c, branch v2.10.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.10.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.10.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-10-28T16:01:23Z</updated>
<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://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://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://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://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://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://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://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://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>
<entry>
<title>Merge branch 'kw/patch-ids-optim'</title>
<updated>2016-08-12T16:47:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-08-12T16:47:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd610aeda684e42d3933a719cbd59ffbcdfdbcaa'/>
<id>urn:sha1:dd610aeda684e42d3933a719cbd59ffbcdfdbcaa</id>
<content type='text'>
When "git rebase" tries to compare set of changes on the updated
upstream and our own branch, it computes patch-id for all of these
changes and attempts to find matches. This has been optimized by
lazily computing the full patch-id (which is expensive) to be
compared only for changes that touch the same set of paths.

* kw/patch-ids-optim:
  rebase: avoid computing unnecessary patch IDs
  patch-ids: add flag to create the diff patch id using header only data
  patch-ids: replace the seen indicator with a commit pointer
  patch-ids: stop using a hand-rolled hashmap implementation
</content>
</entry>
<entry>
<title>Merge branch 'jk/diff-do-not-reuse-wtf-needs-cleaning'</title>
<updated>2016-08-03T22:10:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-08-03T22:10:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=767da54bf8bd212a483097999ee9ba77b711e4a8'/>
<id>urn:sha1:767da54bf8bd212a483097999ee9ba77b711e4a8</id>
<content type='text'>
There is an optimization used in "git diff $treeA $treeB" to borrow
an already checked-out copy in the working tree when it is known to
be the same as the blob being compared, expecting that open/mmap of
such a file is faster than reading it from the object store, which
involves inflating and applying delta.  This however kicked in even
when the checked-out copy needs to go through the convert-to-git
conversion (including the clean filter), which defeats the whole
point of the optimization.  The optimization has been disabled when
the conversion is necessary.

* jk/diff-do-not-reuse-wtf-needs-cleaning:
  diff: do not reuse worktree files that need "clean" conversion
</content>
</entry>
</feed>
