<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/diffcore-rename.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-03-18T20:50:21Z</updated>
<entry>
<title>Merge branch 'dd/use-alloc-grow'</title>
<updated>2014-03-18T20:50:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-18T20:50:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe9122a35213827348c521a16ffd0cf2652c4ac5'/>
<id>urn:sha1:fe9122a35213827348c521a16ffd0cf2652c4ac5</id>
<content type='text'>
Replace open-coded reallocation with ALLOC_GROW() macro.

* dd/use-alloc-grow:
  sha1_file.c: use ALLOC_GROW() in pretend_sha1_file()
  read-cache.c: use ALLOC_GROW() in add_index_entry()
  builtin/mktree.c: use ALLOC_GROW() in append_to_tree()
  attr.c: use ALLOC_GROW() in handle_attr_line()
  dir.c: use ALLOC_GROW() in create_simplify()
  reflog-walk.c: use ALLOC_GROW()
  replace_object.c: use ALLOC_GROW() in register_replace_object()
  patch-ids.c: use ALLOC_GROW() in add_commit()
  diffcore-rename.c: use ALLOC_GROW()
  diff.c: use ALLOC_GROW()
  commit.c: use ALLOC_GROW() in register_commit_graft()
  cache-tree.c: use ALLOC_GROW() in find_subtree()
  bundle.c: use ALLOC_GROW() in add_to_ref_list()
  builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()
</content>
</entry>
<entry>
<title>Merge branch 'nd/i18n-progress'</title>
<updated>2014-03-14T21:26:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-14T21:26:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0963008cbf266db8001521c87084cea353005020'/>
<id>urn:sha1:0963008cbf266db8001521c87084cea353005020</id>
<content type='text'>
Mark the progress indicators from various time-consuming commands
for i18n/l10n.

* nd/i18n-progress:
  i18n: mark all progress lines for translation
</content>
</entry>
<entry>
<title>diffcore-rename.c: use ALLOC_GROW()</title>
<updated>2014-03-03T22:49:02Z</updated>
<author>
<name>Dmitry S. Dolzhenko</name>
<email>dmitrys.dolzhenko@yandex.ru</email>
</author>
<published>2014-03-03T22:31:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=337ce247e35b88e8413ab80b43d9ce47729c8136'/>
<id>urn:sha1:337ce247e35b88e8413ab80b43d9ce47729c8136</id>
<content type='text'>
Use ALLOC_GROW() instead of open-coding it in locate_rename_dst()
and register_rename_src().

Signed-off-by: Dmitry S. Dolzhenko &lt;dmitrys.dolzhenko@yandex.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: mark all progress lines for translation</title>
<updated>2014-02-24T17:08:37Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-02-21T12:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=754dbc43f078625f38c7908f19dc71a0c617ec85'/>
<id>urn:sha1:754dbc43f078625f38c7908f19dc71a0c617ec85</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>diffcore-rename.c: use new hash map implementation</title>
<updated>2013-11-18T21:04:23Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2013-11-14T19:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f79d9c581437d8f48e10506e62c34b9718c7f3f7'/>
<id>urn:sha1:f79d9c581437d8f48e10506e62c34b9718c7f3f7</id>
<content type='text'>
Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diffcore-rename.c: simplify finding exact renames</title>
<updated>2013-11-18T21:04:23Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2013-11-14T19:19:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c85f8acb2282e3ed108c46b59fd5daa78bf17db'/>
<id>urn:sha1:7c85f8acb2282e3ed108c46b59fd5daa78bf17db</id>
<content type='text'>
The find_exact_renames function currently only uses the hash table for
grouping, i.e.:

1. add sources
2. add destinations
3. iterate all buckets, per bucket:
4. split sources from destinations
5. iterate destinations, per destination:
6. iterate sources to find best match

This can be simplified by utilizing the lookup functionality of the hash
table, i.e.:

1. add sources
2. iterate destinations, per destination:
3. lookup sources matching the current destination
4. iterate sources to find best match

This saves several iterations and file_similarity allocations for the
destinations.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diffcore-rename.c: move code around to prepare for the next patch</title>
<updated>2013-11-18T21:04:22Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2013-11-14T19:19:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=48f6407ffec1db18f5ef3316f0d761965bb17f1e'/>
<id>urn:sha1:48f6407ffec1db18f5ef3316f0d761965bb17f1e</id>
<content type='text'>
No actual code changes, just move hash_filespec up and outdent part of
find_identical_files.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Preallocate hash tables when the number of inserts are known in advance</title>
<updated>2013-03-17T05:57:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-03-17T03:28:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c73592812d36ccc7eccfd0489177970d246fa522'/>
<id>urn:sha1:c73592812d36ccc7eccfd0489177970d246fa522</id>
<content type='text'>
This avoids unnecessary re-allocations and reinsertions. On webkit.git
(i.e. about 182k inserts to the name hash table), this reduces about
100ms out of 3s user time.

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 'jk/maint-null-in-trees'</title>
<updated>2012-08-27T18:54:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-08-27T18:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b753148b636be9dc821feebf85cd7f1739b07a1'/>
<id>urn:sha1:3b753148b636be9dc821feebf85cd7f1739b07a1</id>
<content type='text'>
We do not want a link to 0{40} object stored anywhere in our objects.

* jk/maint-null-in-trees:
  fsck: detect null sha1 in tree entries
  do not write null sha1s to on-disk index
  diff: do not use null sha1 as a sentinel value
</content>
</entry>
<entry>
<title>diff: do not use null sha1 as a sentinel value</title>
<updated>2012-07-29T22:04:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-07-28T15:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e54501004abbd20fa8d813c1e5b82c3b50bb9361'/>
<id>urn:sha1:e54501004abbd20fa8d813c1e5b82c3b50bb9361</id>
<content type='text'>
The diff code represents paths using the diff_filespec
struct. This struct has a sha1 to represent the sha1 of the
content at that path, as well as a sha1_valid member which
indicates whether its sha1 field is actually useful. If
sha1_valid is not true, then the filespec represents a
working tree file (e.g., for the no-index case, or for when
the index is not up-to-date).

The diff_filespec is only used internally, though. At the
interfaces to the diff subsystem, callers feed the sha1
directly, and we create a diff_filespec from it. It's at
that point that we look at the sha1 and decide whether it is
valid or not; callers may pass the null sha1 as a sentinel
value to indicate that it is not.

We should not typically see the null sha1 coming from any
other source (e.g., in the index itself, or from a tree).
However, a corrupt tree might have a null sha1, which would
cause "diff --patch" to accidentally diff the working tree
version of a file instead of treating it as a blob.

This patch extends the edges of the diff interface to accept
a "sha1_valid" flag whenever we accept a sha1, and to use
that flag when creating a filespec. In some cases, this
means passing the flag through several layers, making the
code change larger than would be desirable.

One alternative would be to simply die() upon seeing
corrupted trees with null sha1s. However, this fix more
directly addresses the problem (while bogus sha1s in a tree
are probably a bad thing, it is really the sentinel
confusion sending us down the wrong code path that is what
makes it devastating). And it means that git is more capable
of examining and debugging these corrupted trees. For
example, you can still "diff --raw" such a tree to find out
when the bogus entry was introduced; you just cannot do a
"--patch" diff (just as you could not with any other
corrupted tree, as we do not have any content to diff).

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