<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.c, branch v2.0.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-03-18T20:51:05Z</updated>
<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>
<entry>
<title>rename_ref(): extract function rename_tmp_log()</title>
<updated>2014-01-21T21:46:59Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-01-18T22:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fa59ae7971498157370d935adbb2bfc28012aa9f'/>
<id>urn:sha1:fa59ae7971498157370d935adbb2bfc28012aa9f</id>
<content type='text'>
It's about to become a bit more complex.

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>lock_ref_sha1_basic(): if locking fails with ENOENT, retry</title>
<updated>2014-01-21T21:46:30Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-01-18T22:48:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5c223e98b985d9faa274039aefa4391d2da25a6'/>
<id>urn:sha1:e5c223e98b985d9faa274039aefa4391d2da25a6</id>
<content type='text'>
If hold_lock_file_for_update() fails with errno==ENOENT, it might be
because somebody else (for example, a pack-refs process) has just
deleted one of the lockfile's ancestor directories.  So if this
condition is detected, try again (up to 3 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>
</feed>
