<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/refs.c, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-11-27T21:28:45Z</updated>
<entry>
<title>Merge branch 'jh/update-ref-d-through-symref' into maint</title>
<updated>2012-11-27T21:28:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-11-27T21:28:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ed20513c8de70e8bd7f18d2fb5beb1a81f49cdf8'/>
<id>urn:sha1:ed20513c8de70e8bd7f18d2fb5beb1a81f49cdf8</id>
<content type='text'>
* jh/update-ref-d-through-symref:
  Fix failure to delete a packed ref through a symref
  t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
</content>
</entry>
<entry>
<title>Fix failure to delete a packed ref through a symref</title>
<updated>2012-10-21T19:08:42Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2012-10-21T10:40:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b274a7146c44624bc30bbd54124312d4d3e6a28d'/>
<id>urn:sha1:b274a7146c44624bc30bbd54124312d4d3e6a28d</id>
<content type='text'>
When deleting a ref through a symref (e.g. using 'git update-ref -d HEAD'
to delete refs/heads/master), we would remove the loose ref, but a packed
version of the same ref would remain, the end result being that instead of
deleting refs/heads/master we would appear to reset it to its state as of
the last repack.

This patch fixes the issue, by making sure we pass the correct ref name
when invoking repack_without_ref() from within delete_ref().

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: lock symref that is to be deleted, not its target</title>
<updated>2012-10-16T17:08:23Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-10-16T10:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=547d058fb6fefad147675a6d3fdb9439c57916a1'/>
<id>urn:sha1:547d058fb6fefad147675a6d3fdb9439c57916a1</id>
<content type='text'>
When delete_ref is called on a symref then it locks its target and then
either deletes the target or the symref, depending on whether the flag
REF_NODEREF was set in the parameter delopt.

Instead, simply pass the flag to lock_ref_sha1_basic, which will then
either lock the target or the symref, and delete the locked ref.

This reimplements part of eca35a25 (Fix git branch -m for symrefs.).

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/refs-string-slice'</title>
<updated>2012-05-29T20:09:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-29T20:09:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a7060009e1272aa43c8fb941f039cff9e9a0459b'/>
<id>urn:sha1:a7060009e1272aa43c8fb941f039cff9e9a0459b</id>
<content type='text'>
Avoid unnecessary temporary allocations while looking for matching refs
inside refs API.

By René Scharfe (3) and Junio C Hamano (1)
* rs/refs-string-slice:
  refs: do not create ref_entry when searching
  refs: use strings directly in find_containing_dir()
  refs: convert parameter of create_dir_entry() to length-limited string
  refs: convert parameter of search_ref_dir() to length-limited string
</content>
</entry>
<entry>
<title>Merge branch 'mh/ref-api-lazy-loose'</title>
<updated>2012-05-29T20:08:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-29T20:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=38f2b874ff0e7d6f182b7995d45efbaf1adfe94a'/>
<id>urn:sha1:38f2b874ff0e7d6f182b7995d45efbaf1adfe94a</id>
<content type='text'>
The code to lazily read loose refs unnecessarily read the refs in a
subhierarchy by mistake when we free the data for the subhierarchy.

By Michael Haggerty
* mh/ref-api-lazy-loose:
  free_ref_entry(): do not trigger reading of loose refs
</content>
</entry>
<entry>
<title>Merge branch 'mh/ref-api'</title>
<updated>2012-05-25T19:04:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-25T19:04:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ec04a275b495a7d786b49aeca2eef7f45fb00c48'/>
<id>urn:sha1:ec04a275b495a7d786b49aeca2eef7f45fb00c48</id>
<content type='text'>
Fixes a performance regression in the earlier series.
</content>
</entry>
<entry>
<title>Avoid sorting if references are added to ref_cache in order</title>
<updated>2012-05-24T19:16:06Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-05-24T12:16:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=654ad400c27653a138b028cdd35a09b0c69c7ef0'/>
<id>urn:sha1:654ad400c27653a138b028cdd35a09b0c69c7ef0</id>
<content type='text'>
The old code allowed many references to be efficiently added to a
single directory, because it just appended the references to the
containing directory unsorted without doing any searching (and
therefore without requiring any intermediate sorting).  But the old
code was inefficient when a large number of subdirectories were added
to a directory, because the directory always had to be searched to see
if the new subdirectory already existed, and this search required the
directory to be sorted first.  The same was repeated for every new
subdirectory, so the time scaled like O(N^2), where N is the number of
subdirectories within a single directory.

In practice, references are often added to the ref_cache in
lexicographic order, for example when reading the packed-refs file.
So build some intelligence into add_entry_to_dir() to optimize for the
case of references and/or subdirectories being added in lexicographic
order: if the existing entries were already sorted, and the new entry
comes after the last existing entry, then adjust ref_dir::sorted to
reflect the fact that the ref_dir is still sorted.

Thanks to Peff for pointing out the performance regression that
inspired this change.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: do not create ref_entry when searching</title>
<updated>2012-05-22T21:28:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-05-22T21:03:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e1980c9d23c22ecfbcadbe91d304ba778b84b457'/>
<id>urn:sha1:e1980c9d23c22ecfbcadbe91d304ba778b84b457</id>
<content type='text'>
The search_ref_dir() function is about looking up an existing ref_entry in
a sorted array of ref_entry stored in dir-&gt;entries, but it still allocates
a new ref_entry and frees it before returning.  This is only because the
call to bsearch(3) was coded in a suboptimal way. Unlike the comparison
function given to qsort(3), the first parameter to its comparison function
does not need to point at an object that is shaped like an element in the
array.

Introduce a new comparison function that takes a counted string as the key
and an element in an array of ref_entry and give it to bsearch(), so that
we do not have to allocate a new ref_entry that we will never return to
the caller anyway.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: use strings directly in find_containing_dir()</title>
<updated>2012-05-22T20:32:26Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-05-22T18:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dd02e72852280d73bfd845703476b230475b2776'/>
<id>urn:sha1:dd02e72852280d73bfd845703476b230475b2776</id>
<content type='text'>
Convert the parameter subdirname of search_for_subdir() to a
length-limted string and then simply pass the interesting slice of the
refname from find_containing_dir(), thereby avoiding to duplicate the
string.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: convert parameter of create_dir_entry() to length-limited string</title>
<updated>2012-05-22T20:32:24Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-05-22T18:50:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b9146f517a312fed42d12b32e3ee3bd99944121d'/>
<id>urn:sha1:b9146f517a312fed42d12b32e3ee3bd99944121d</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
