<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diffcore-rename.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-08-01T21:01:03Z</updated>
<entry>
<title>pass constants as first argument to st_mult()</title>
<updated>2016-08-01T21:01:03Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-07-30T18:18:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50492f7b38f84619cbfb443efc3c0c78fc0304dd'/>
<id>urn:sha1:50492f7b38f84619cbfb443efc3c0c78fc0304dd</id>
<content type='text'>
The result of st_mult() is the same no matter the order of its
arguments.  It invokes the macro unsigned_mult_overflows(), which
divides the second parameter by the first one.  Pass constants
first to allow that division to be done already at compile time.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: rename struct diff_filespec's sha1_valid member</title>
<updated>2016-06-28T18:39:02Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2016-06-24T23:09:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41c9560ee5f9fc4bd3c6580272bd292083a9fe18'/>
<id>urn:sha1:41c9560ee5f9fc4bd3c6580272bd292083a9fe18</id>
<content type='text'>
Now that this struct's sha1 member is called "oid", update the comment
and the sha1_valid member to be called "oid_valid" instead.  The
following Coccinelle semantic patch was used to implement this, followed
by the transformations in object_id.cocci:

@@
struct diff_filespec o;
@@
- o.sha1_valid
+ o.oid_valid

@@
struct diff_filespec *p;
@@
- p-&gt;sha1_valid
+ p-&gt;oid_valid

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: convert struct diff_filespec to struct object_id</title>
<updated>2016-06-28T18:39:02Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2016-06-24T23:09:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a0d12c4433e25e87b67df78b45635df8a098fb23'/>
<id>urn:sha1:a0d12c4433e25e87b67df78b45635df8a098fb23</id>
<content type='text'>
Convert struct diff_filespec's sha1 member to use a struct object_id
called "oid" instead.  The following Coccinelle semantic patch was used
to implement this, followed by the transformations in object_id.cocci:

@@
struct diff_filespec o;
@@
- o.sha1
+ o.oid.hash

@@
struct diff_filespec *p;
@@
- p-&gt;sha1
+ p-&gt;oid.hash

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sg/diff-multiple-identical-renames'</title>
<updated>2016-04-13T21:12:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-04-13T21:12:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26effb8487386e431990905d4eba7e81f1018eda'/>
<id>urn:sha1:26effb8487386e431990905d4eba7e81f1018eda</id>
<content type='text'>
"git diff -M" used to work better when two originally identical
files A and B got renamed to X/A and X/B by pairing A to X/A and B
to X/B, but this was broken in the 2.0 timeframe.

* sg/diff-multiple-identical-renames:
  diffcore: fix iteration order of identical files during rename detection
</content>
</entry>
<entry>
<title>diffcore: fix iteration order of identical files during rename detection</title>
<updated>2016-03-30T20:46:04Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder@ira.uka.de</email>
</author>
<published>2016-03-30T08:35:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca4e3ca029def86b7b29451d4ba77ef76574949e'/>
<id>urn:sha1:ca4e3ca029def86b7b29451d4ba77ef76574949e</id>
<content type='text'>
If the two paths 'dir/A/file' and 'dir/B/file' have identical content
and the parent directory is renamed, e.g. 'git mv dir other-dir', then
diffcore reports the following exact renames:

    renamed:    dir/B/file -&gt; other-dir/A/file
    renamed:    dir/A/file -&gt; other-dir/B/file

While technically not wrong, this is confusing not only for the user,
but also for git commands that make decisions based on rename
information, e.g. 'git log --follow other-dir/A/file' follows
'dir/B/file' past the rename.

This behavior is a side effect of commit v2.0.0-rc4~8^2~14
(diffcore-rename.c: simplify finding exact renames, 2013-11-14): the
hashmap storing sources returns entries from the same bucket, i.e.
sources matching the current destination, in LIFO order.  Thus the
iteration first examines 'other-dir/A/file' and 'dir/B/file' and, upon
finding identical content and basename, reports an exact rename.

Other hashmap users are apparently happy with the current iteration
order over the entries of a bucket.  Changing the iteration order
would risk upsetting other hashmap users and would increase the memory
footprint of each bucket by a pointer to the tail element.

Fill the hashmap with source entries in reverse order to restore the
original exact rename detection behavior.

Reported-by: Bill Okara &lt;billokara@gmail.com&gt;
Signed-off-by: SZEDER Gábor &lt;szeder@ira.uka.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use st_add and st_mult for allocation size computation</title>
<updated>2016-02-22T22:51:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-22T22:44:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50a6c8efa2bbeddf46ca34c7765024108202e04b'/>
<id>urn:sha1:50a6c8efa2bbeddf46ca34c7765024108202e04b</id>
<content type='text'>
If our size computation overflows size_t, we may allocate a
much smaller buffer than we expected and overflow it. It's
probably impossible to trigger an overflow in most of these
sites in practice, but it is easy enough convert their
additions and multiplications into overflow-checking
variants. This may be fixing real bugs, and it makes
auditing the code easier.

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 'jk/diffcore-rename-duplicate'</title>
<updated>2015-03-10T20:52:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-10T20:52:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d659f7d6e6071701a4f532487edf139b3e1fa9d'/>
<id>urn:sha1:2d659f7d6e6071701a4f532487edf139b3e1fa9d</id>
<content type='text'>
A corrupt input to "git diff -M" can cause us to segfault.

* jk/diffcore-rename-duplicate:
  diffcore-rename: avoid processing duplicate destinations
  diffcore-rename: split locate_rename_dst into two functions
</content>
</entry>
<entry>
<title>diffcore-rename: avoid processing duplicate destinations</title>
<updated>2015-02-27T21:41:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-02-27T01:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d6be03b95c3db21db1bb8fee01128c1b13f70e7'/>
<id>urn:sha1:4d6be03b95c3db21db1bb8fee01128c1b13f70e7</id>
<content type='text'>
The rename code cannot handle an input where we have
duplicate destinations (i.e., more than one diff_filepair in
the queue with the same string in its pair-&gt;two-&gt;path). We
end up allocating only one slot in the rename_dst mapping.
If we fill in the diff_filepair for that slot, when we
re-queue the results, we may queue that filepair multiple
times. When the diff is finally flushed, the filepair is
processed and free()d multiple times, leading to heap
corruption.

This situation should only happen when a tree diff sees
duplicates in one of the trees (see the added test for a
detailed example). Rather than handle it, the sanest thing
is just to turn off rename detection altogether for the
diff.

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>diffcore-rename: split locate_rename_dst into two functions</title>
<updated>2015-02-27T21:41:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-02-27T01:39:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f98c2f7e53062a59f67914337c0b45c82393e11f'/>
<id>urn:sha1:f98c2f7e53062a59f67914337c0b45c82393e11f</id>
<content type='text'>
This function manages the mapping of destination pathnames
to filepairs, and it handles both insertion and lookup. This
makes the return value a bit confusing, as we return a newly
created entry (even though no caller cares), and have no
room to indicate to the caller that an entry already
existed.

Instead, let's break this up into two distinct functions,
both backed by a common binary search. The binary search
will use our normal "return the index if we found something,
or negative index minus one to show where it would have
gone" semantics.

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.c: allow to pass more flags to diff_populate_filespec</title>
<updated>2014-08-18T17:16:35Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-08-16T03:08:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e5dd3d654ebb9e86e06b9ef5ca86bd6ebf44de1'/>
<id>urn:sha1:8e5dd3d654ebb9e86e06b9ef5ca86bd6ebf44de1</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>
</feed>
