<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.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-05-27T19:30:47Z</updated>
<entry>
<title>remote prune: optimize "dangling symref" check/warning</title>
<updated>2014-05-27T19:30:47Z</updated>
<author>
<name>Jens Lindström</name>
<email>jl@opera.com</email>
</author>
<published>2014-05-23T10:30:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6bea66db6229a0975ebba510a1d2827bf09cb7f'/>
<id>urn:sha1:e6bea66db6229a0975ebba510a1d2827bf09cb7f</id>
<content type='text'>
When 'git remote prune' was used to delete many refs in a repository
with many refs, a lot of time was spent checking for (now) dangling
symbolic refs pointing to the deleted ref, since warn_dangling_symref()
was once per deleted ref to check all other refs in the repository.

Avoid this using the new warn_dangling_symrefs() function which
makes one pass over all refs and checks for all the deleted refs in
one go, after they have all been deleted.

Signed-off-by: Jens LindstrÃ¶m &lt;jl@opera.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>remote: repack packed-refs once when deleting multiple refs</title>
<updated>2014-05-27T19:30:42Z</updated>
<author>
<name>Jens Lindström</name>
<email>jl@opera.com</email>
</author>
<published>2014-05-23T10:29:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9e768bb77762765f739fffb5c09d0888f3de20e'/>
<id>urn:sha1:c9e768bb77762765f739fffb5c09d0888f3de20e</id>
<content type='text'>
When 'git remote rm' or 'git remote prune' were used in a repository
with many refs, and needed to delete many remote-tracking refs, a lot
of time was spent deleting those refs since for each deleted ref,
repack_without_refs() was called to rewrite packed-refs without just
that deleted ref.

To avoid this, call repack_without_refs() first to repack without all
the refs that will be deleted, before calling delete_ref() to delete
each one completely.  The call to repack_without_ref() in delete_ref()
then becomes a no-op, since packed-refs already won't contain any of
the deleted refs.

Signed-off-by: Jens LindstrÃ¶m &lt;jl@opera.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sh/use-hashcpy'</title>
<updated>2014-03-18T20:51:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-18T20:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=006f678780e816a2540628e5473b0eea199d0b61'/>
<id>urn:sha1:006f678780e816a2540628e5473b0eea199d0b61</id>
<content type='text'>
* sh/use-hashcpy:
  Use hashcpy() when copying object names
</content>
</entry>
<entry>
<title>Use hashcpy() when copying object names</title>
<updated>2014-03-06T22:03:12Z</updated>
<author>
<name>Sun He</name>
<email>sunheehnus@gmail.com</email>
</author>
<published>2014-03-03T09:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50546b15ed1df25837f8b291e6fa5bbcdb84635e'/>
<id>urn:sha1:50546b15ed1df25837f8b291e6fa5bbcdb84635e</id>
<content type='text'>
We invented hashcpy() to keep the abstraction of "object name"
behind it.  Use it instead of calling memcpy() with hard-coded
20-byte length when moving object names between pieces of memory.

Leave ppc/sha1.c as-is, because the function is about the SHA-1 hash
algorithm whose output is and will always be 20 bytes.

Helped-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Helped-by: Duy Nguyen &lt;pclouds@gmail.com&gt;
Signed-off-by: Sun He &lt;sunheehnus@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use wildmatch() directly without fnmatch() wrapper</title>
<updated>2014-02-20T22:15:46Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-02-15T02:01:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb07894fe036566acccb71420ab79ccb9c9e2d66'/>
<id>urn:sha1:eb07894fe036566acccb71420ab79ccb9c9e2d66</id>
<content type='text'>
Make it clear that we don't use fnmatch() anymore.

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 'mh/safe-create-leading-directories'</title>
<updated>2014-01-27T18:45:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-01-27T18:45:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0956cfa8ef8b3668ea6adc94b27f5dcdc93bde0'/>
<id>urn:sha1:d0956cfa8ef8b3668ea6adc94b27f5dcdc93bde0</id>
<content type='text'>
Code clean-up and protection against concurrent write access to the
ref namespace.

* mh/safe-create-leading-directories:
  rename_tmp_log(): on SCLD_VANISHED, retry
  rename_tmp_log(): limit the number of remote_empty_directories() attempts
  rename_tmp_log(): handle a possible mkdir/rmdir race
  rename_ref(): extract function rename_tmp_log()
  remove_dir_recurse(): handle disappearing files and directories
  remove_dir_recurse(): tighten condition for removing unreadable dir
  lock_ref_sha1_basic(): if locking fails with ENOENT, retry
  lock_ref_sha1_basic(): on SCLD_VANISHED, retry
  safe_create_leading_directories(): add new error value SCLD_VANISHED
  cmd_init_db(): when creating directories, handle errors conservatively
  safe_create_leading_directories(): introduce enum for return values
  safe_create_leading_directories(): always restore slash at end of loop
  safe_create_leading_directories(): split on first of multiple slashes
  safe_create_leading_directories(): rename local variable
  safe_create_leading_directories(): add explicit "slash" pointer
  safe_create_leading_directories(): reduce scope of local variable
  safe_create_leading_directories(): fix format of "if" chaining
</content>
</entry>
<entry>
<title>Merge branch 'mh/retire-ref-fetch-rules'</title>
<updated>2014-01-27T18:44:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-01-27T18:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9bb528709878d26ac75bf0cb075cc694acd0d69d'/>
<id>urn:sha1:9bb528709878d26ac75bf0cb075cc694acd0d69d</id>
<content type='text'>
Code simplification.

* mh/retire-ref-fetch-rules:
  refname_match(): always use the rules in ref_rev_parse_rules
</content>
</entry>
<entry>
<title>rename_tmp_log(): on SCLD_VANISHED, retry</title>
<updated>2014-01-21T21:47:28Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-01-18T22:49:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08f555cb82f92797ca0aa0d6ba32e6872f1331e5'/>
<id>urn:sha1:08f555cb82f92797ca0aa0d6ba32e6872f1331e5</id>
<content type='text'>
If safe_create_leading_directories() fails because a file along the
path unexpectedly vanished, try again from the beginning.  Try at most
4 times.

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>rename_tmp_log(): limit the number of remote_empty_directories() attempts</title>
<updated>2014-01-21T21:47:24Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-01-18T22:49:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1e9e9a4dbe2cfb39dcb14ee4f34628ef46d7b15'/>
<id>urn:sha1:f1e9e9a4dbe2cfb39dcb14ee4f34628ef46d7b15</id>
<content type='text'>
This doesn't seem to be a likely error, but we've got the counter
anyway, so we might as well use it for an added bit of safety.

Please note that the first call to rename() is optimistic, and it is
normal for it to fail if there is a directory in the way.  So bump the
total number of allowed attempts to 4, to be sure that we can still
have at least 3 retries in the case of a race.

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>rename_tmp_log(): handle a possible mkdir/rmdir race</title>
<updated>2014-01-21T21:47:13Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-01-18T22:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae4a283e3b4cdc99a548d215739539c3a690f290'/>
<id>urn:sha1:ae4a283e3b4cdc99a548d215739539c3a690f290</id>
<content type='text'>
If a directory vanishes while renaming the temporary reflog file,
retry (up to 3 times).  This could happen if another process deletes
the directory created by safe_create_leading_directories() just before
we rename the file into the directory.

As far as I can tell, this race could not occur internal to git.  The
only time that a directory under $GIT_DIR/logs is deleted is if room
has to be made for a log file for a reference with the same name;
for example, in the following sequence:

    git branch foo/bar    # Creates file .git/logs/refs/heads/foo/bar
    git branch -d foo/bar # Deletes file but leaves .git/logs/refs/heads/foo/
    git branch foo        # Deletes .git/logs/refs/heads/foo/

But the only reason the last command deletes the directory is because
it wants to create a file with the same name.  So if another process
(e.g.,

    git branch foo/baz

) wants to create that directory, one of the two is doomed to failure
anyway because of a D/F conflict.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
