<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, 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-10-10T17:53:33Z</updated>
<entry>
<title>files_read_raw_ref: prevent infinite retry loops in general</title>
<updated>2016-10-10T17:53:33Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-06T16:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8c42cb9ce6a566aad797cc6c5bc1279d608d819'/>
<id>urn:sha1:e8c42cb9ce6a566aad797cc6c5bc1279d608d819</id>
<content type='text'>
Limit the number of retries to 3. That should be adequate to
prevent any races, while preventing the possibility of
infinite loops if the logic fails to handle any other
possible error modes correctly.

After the fix in the previous commit, there's no known way
to trigger an infinite loop, but I did manually verify that
this fixes the test in that commit even when the code change
is not applied.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>files_read_raw_ref: avoid infinite loop on broken symlinks</title>
<updated>2016-10-10T17:53:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-10-06T19:41:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f7bd767ed6df4dbbc36c5ab881c0de668107001'/>
<id>urn:sha1:3f7bd767ed6df4dbbc36c5ab881c0de668107001</id>
<content type='text'>
Our ref resolution first runs lstat() on any path we try to
look up, because we want to treat symlinks specially (by
resolving them manually and considering them symrefs). But
if the results of `readlink` do _not_ look like a ref, we
fall through to treating it like a normal file, and just
read the contents of the linked path.

Since fcb7c76 (resolve_ref_unsafe(): close race condition
reading loose refs, 2013-06-19), that "normal file" code
path will stat() the file and if we see ENOENT, will jump
back to the lstat(), thinking we've seen inconsistent
results between the two calls. But for a symbolic ref, this
isn't a race: the lstat() found the symlink, and the stat()
is looking at the path it points to. We end up in an
infinite loop calling lstat() and stat().

We can fix this by avoiding the retry-on-inconsistent jump
when we know that we found a symlink. While we're at it,
let's add a comment explaining why the symlink case gets to
this code in the first place; without that, it is not
obvious that the correct solution isn't to avoid the stat()
code path entirely.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mh/ref-iterators'</title>
<updated>2016-07-25T21:13:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-25T21:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=87492cb24d9d8be8e18217b89ae5f090089ff31d'/>
<id>urn:sha1:87492cb24d9d8be8e18217b89ae5f090089ff31d</id>
<content type='text'>
The API to iterate over all the refs (i.e. for_each_ref(), etc.)
has been revamped.

* mh/ref-iterators:
  for_each_reflog(): reimplement using iterators
  dir_iterator: new API for iterating over a directory tree
  for_each_reflog(): don't abort for bad references
  do_for_each_ref(): reimplement using reference iteration
  refs: introduce an iterator interface
  ref_resolves_to_object(): new function
  entry_resolves_to_object(): rename function from ref_resolves_to_object()
  get_ref_cache(): only create an instance if there is a submodule
  remote rm: handle symbolic refs correctly
  delete_refs(): add a flags argument
  refs: use name "prefix" consistently
  do_for_each_ref(): move docstring to the header file
  refs: remove unnecessary "extern" keywords
</content>
</entry>
<entry>
<title>Merge branch 'mh/update-ref-errors'</title>
<updated>2016-07-25T21:13:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-25T21:13:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=702ebbf4e2937accbac8184f87932f961e626a63'/>
<id>urn:sha1:702ebbf4e2937accbac8184f87932f961e626a63</id>
<content type='text'>
Error handling in the codepaths that updates refs has been
improved.

* mh/update-ref-errors:
  lock_ref_for_update(): avoid a symref resolution
  lock_ref_for_update(): make error handling more uniform
  t1404: add more tests of update-ref error handling
  t1404: document function test_update_rejected
  t1404: remove "prefix" argument to test_update_rejected
  t1404: rename file to t1404-update-ref-errors.sh
</content>
</entry>
<entry>
<title>Merge branch 'mh/split-under-lock'</title>
<updated>2016-07-25T21:13:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-25T21:13:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b34ce90a748ff6bd679c29bc3f37a75a1bd3441'/>
<id>urn:sha1:6b34ce90a748ff6bd679c29bc3f37a75a1bd3441</id>
<content type='text'>
Further preparatory work on the refs API before the pluggable
backend series can land.

* mh/split-under-lock: (33 commits)
  lock_ref_sha1_basic(): only handle REF_NODEREF mode
  commit_ref_update(): remove the flags parameter
  lock_ref_for_update(): don't resolve symrefs
  lock_ref_for_update(): don't re-read non-symbolic references
  refs: resolve symbolic refs first
  ref_transaction_update(): check refname_is_safe() at a minimum
  unlock_ref(): move definition higher in the file
  lock_ref_for_update(): new function
  add_update(): initialize the whole ref_update
  verify_refname_available(): adjust constness in declaration
  refs: don't dereference on rename
  refs: allow log-only updates
  delete_branches(): use resolve_refdup()
  ref_transaction_commit(): correctly report close_ref() failure
  ref_transaction_create(): disallow recursive pruning
  refs: make error messages more consistent
  lock_ref_sha1_basic(): remove unneeded local variable
  read_raw_ref(): move docstring to header file
  read_raw_ref(): improve docstring
  read_raw_ref(): rename symref argument to referent
  ...
</content>
</entry>
<entry>
<title>coccinelle: apply object_id Coccinelle transformations</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:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c368dde9245fa3d50b7e01e1ff4f9e5c12c718da'/>
<id>urn:sha1:c368dde9245fa3d50b7e01e1ff4f9e5c12c718da</id>
<content type='text'>
Apply the set of semantic patches from contrib/coccinelle to convert
some leftover places using struct object_id's hash member to instead
use the wrapper functions that take struct object_id natively.

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>lock_ref_for_update(): avoid a symref resolution</title>
<updated>2016-06-20T18:49:00Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2016-06-07T07:32:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=841caad903f2b160e9f5ff05f961d20ad9085ddc'/>
<id>urn:sha1:841caad903f2b160e9f5ff05f961d20ad9085ddc</id>
<content type='text'>
If we're overwriting a symref with a SHA-1, we need to resolve the value
of the symref (1) to check against update-&gt;old_sha1 and (2) to write to
its reflog. However, we've already read the symref itself and know its
referent. So there is no need to read the symref's value through the
symref; we can read the referent directly.

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_for_update(): make error handling more uniform</title>
<updated>2016-06-20T18:49:00Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2016-06-07T07:29:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e3f510393c9d373f2969badc2b8afe179803a0fa'/>
<id>urn:sha1:e3f510393c9d373f2969badc2b8afe179803a0fa</id>
<content type='text'>
To aid the effort, extract a new function, check_old_oid(), and use it
in the two places where the read value of the reference has to be
checked against update-&gt;old_sha1.

Update tests to reflect the improvements.

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>for_each_reflog(): reimplement using iterators</title>
<updated>2016-06-20T18:38:21Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2016-06-18T04:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2880d16f09635f9d43247b27fd7e6508b992e599'/>
<id>urn:sha1:2880d16f09635f9d43247b27fd7e6508b992e599</id>
<content type='text'>
Allow references with reflogs to be iterated over using a ref_iterator.
The latter is implemented as a files_reflog_iterator, which in turn uses
dir_iterator to read the "logs" directory.

Note that reflog iteration doesn't correctly handle per-worktree
reflogs (either before or after this patch).

Signed-off-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
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>for_each_reflog(): don't abort for bad references</title>
<updated>2016-06-20T18:38:20Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2016-06-18T04:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d24b21e9fcaa9ed4b7966275a8d82406f578577d'/>
<id>urn:sha1:d24b21e9fcaa9ed4b7966275a8d82406f578577d</id>
<content type='text'>
If there is a file under "$GIT_DIR/logs" with no corresponding
reference, the old code was emitting an error message, aborting the
reflog iteration, and returning -1. But

* None of the callers was checking the exit value

* The callers all want to find all legitimate reflogs (sometimes for the
  purpose of determining object reachability!) and wouldn't benefit from
  a truncated iteration anyway.

So instead, emit an error message and skip the "broken" reflog, but
continue with the iteration.

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>
