<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.c, branch v2.1.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.1.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.1.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-09-19T21:05:12Z</updated>
<entry>
<title>Merge branch 'jk/prune-top-level-refs-after-packing' into maint</title>
<updated>2014-09-19T21:05:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-19T21:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fb6f843a8fbce633a4a1f39f4b7b2a862e5cb855'/>
<id>urn:sha1:fb6f843a8fbce633a4a1f39f4b7b2a862e5cb855</id>
<content type='text'>
* jk/prune-top-level-refs-after-packing:
  pack-refs: prune top-level refs like "refs/foo"
</content>
</entry>
<entry>
<title>pack-refs: prune top-level refs like "refs/foo"</title>
<updated>2014-08-25T19:19:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-23T05:27:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afd11d3ebcfb18c29840dfa68be32c5215810a77'/>
<id>urn:sha1:afd11d3ebcfb18c29840dfa68be32c5215810a77</id>
<content type='text'>
After we have packed all refs, we prune any loose refs that
correspond to what we packed. We do so by first taking a
lock with lock_ref_sha1, and then deleting the loose ref
file.

However, lock_ref_sha1 will refuse to take a lock on any
refs that exist at the top-level of the "refs/" directory,
and we skip pruning the ref.  This is almost certainly not
what we want to happen here. The criteria to be pruned
should not differ from that to be packed; if a ref makes it
to prune_ref, it's because we want it both packed and
pruned (if there are refs you do not want to be packed, they
should be omitted much earlier by pack_ref_is_possible,
which we do in this case if --all is not given).

We can fix this by switching to lock_any_ref_for_update.
This behaves exactly the same with the exception of this
top-level check.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Reviewed-by: Ronnie Sahlberg &lt;sahlberg@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Revert "Merge branch 'dt/refs-check-refname-component-sse'"</title>
<updated>2014-07-28T17:41:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-28T17:41:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e6502288d713cfa673c456a040ad0841db11dfa'/>
<id>urn:sha1:5e6502288d713cfa673c456a040ad0841db11dfa</id>
<content type='text'>
This reverts commit 6f92e5ff3cdc813de8ef5327fd4bad492fb7d6c9, reversing
changes made to a02ad882a17b9d45f63ea448391ac5e9f7948222.
</content>
</entry>
<entry>
<title>Revert "Merge branch 'dt/refs-check-refname-component-sse-fix'"</title>
<updated>2014-07-28T17:41:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-28T17:41:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dad2e7f4bf6e2f01bf2b589490441343a0f8f6f7'/>
<id>urn:sha1:dad2e7f4bf6e2f01bf2b589490441343a0f8f6f7</id>
<content type='text'>
This reverts commit 779c99fd68dcdaff7d996a1985914154a36a272c, reversing
changes made to df4d7d56461c19361a6f32b633e850c7ba6e55e6.
</content>
</entry>
<entry>
<title>add object_as_type helper for casting objects</title>
<updated>2014-07-28T17:14:33Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-07-13T06:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c4ad00f8ccb59a0ae0735e8e32b203d4bd835616'/>
<id>urn:sha1:c4ad00f8ccb59a0ae0735e8e32b203d4bd835616</id>
<content type='text'>
When we call lookup_commit, lookup_tree, etc, the logic goes
something like:

  1. Look for an existing object struct. If we don't have
     one, allocate and return a new one.

  2. Double check that any object we have is the expected
     type (and complain and return NULL otherwise).

  3. Convert an object with type OBJ_NONE (from a prior
     call to lookup_unknown_object) to the expected type.

We can encapsulate steps 2 and 3 in a helper function which
checks whether we have the expected object type, converts
OBJ_NONE as appropriate, and returns the object.

Not only does this shorten the code, but it also provides
one central location for converting OBJ_NONE objects into
objects of other types. Future patches will use that to
enforce type-specific invariants.

Since this is a refactoring, we would want it to behave
exactly as the current code. It takes a little reasoning to
see that this is the case:

  - for lookup_{commit,tree,etc} functions, we are just
    pulling steps 2 and 3 into a function that does the same
    thing.

  - for the call in peel_object, we currently only do step 3
    (but we want to consolidate it with the others, as
    mentioned above). However, step 2 is a noop here, as the
    surrounding conditional makes sure we have OBJ_NONE
    (which we want to keep to avoid an extraneous call to
    sha1_object_info).

  - for the call in lookup_commit_reference_gently, we are
    currently doing step 2 but not step 3. However, step 3
    is a noop here. The object we got will have just come
    from deref_tag, which must have figured out the type for
    each object in order to know when to stop peeling.
    Therefore the type will never be OBJ_NONE.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/alloc-commit-id'</title>
<updated>2014-07-22T17:59:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-22T17:59:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=10b944b37b11d6e0597541efdd1fa23c0eecbeff'/>
<id>urn:sha1:10b944b37b11d6e0597541efdd1fa23c0eecbeff</id>
<content type='text'>
Make sure all in-core commit objects are assigned a unique number
so that they can be annotated using the commit-slab API.

* jk/alloc-commit-id:
  diff-tree: avoid lookup_unknown_object
  object_as_type: set commit index
  alloc: factor out commit index
  add object_as_type helper for casting objects
  parse_object_buffer: do not set object type
  move setting of object-&gt;type to alloc_* functions
  alloc: write out allocator definitions
  alloc.c: remove the alloc_raw_commit_node() function
</content>
</entry>
<entry>
<title>Merge branch 'rs/unify-is-branch'</title>
<updated>2014-07-21T18:18:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-21T18:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=528396a463e4030e19f150e8fddd8d911063e77e'/>
<id>urn:sha1:528396a463e4030e19f150e8fddd8d911063e77e</id>
<content type='text'>
* rs/unify-is-branch:
  refs.c: add a public is_branch function
</content>
</entry>
<entry>
<title>Merge branch 'rs/ref-transaction-0'</title>
<updated>2014-07-21T18:18:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-21T18:18:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19a249ba83abb72faf530a214ea867feb51ade91'/>
<id>urn:sha1:19a249ba83abb72faf530a214ea867feb51ade91</id>
<content type='text'>
Early part of the "ref transaction" topic.

* rs/ref-transaction-0:
  refs.c: change ref_transaction_update() to do error checking and return status
  refs.c: remove the onerr argument to ref_transaction_commit
  update-ref: use err argument to get error from ref_transaction_commit
  refs.c: make update_ref_write update a strbuf on failure
  refs.c: make ref_update_reject_duplicates take a strbuf argument for errors
  refs.c: log_ref_write should try to return meaningful errno
  refs.c: make resolve_ref_unsafe set errno to something meaningful on error
  refs.c: commit_packed_refs to return a meaningful errno on failure
  refs.c: make remove_empty_directories always set errno to something sane
  refs.c: verify_lock should set errno to something meaningful
  refs.c: make sure log_ref_setup returns a meaningful errno
  refs.c: add an err argument to repack_without_refs
  lockfile.c: make lock_file return a meaningful errno on failurei
  lockfile.c: add a new public function unable_to_lock_message
  refs.c: add a strbuf argument to ref_transaction_commit for error logging
  refs.c: allow passing NULL to ref_transaction_free
  refs.c: constify the sha arguments for ref_transaction_create|delete|update
  refs.c: ref_transaction_commit should not free the transaction
  refs.c: remove ref_transaction_rollback
</content>
</entry>
<entry>
<title>refs.c: add a public is_branch function</title>
<updated>2014-07-16T20:06:41Z</updated>
<author>
<name>Ronnie Sahlberg</name>
<email>sahlberg@google.com</email>
</author>
<published>2014-07-15T23:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7e0f26eb64de205acaac63da89f47aab78ba229'/>
<id>urn:sha1:e7e0f26eb64de205acaac63da89f47aab78ba229</id>
<content type='text'>
Both refs.c and fsck.c have their own private copies of the is_branch function.
Delete the is_branch function from fsck.c and make the version in refs.c
public.

Signed-off-by: Ronnie Sahlberg &lt;sahlberg@google.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/strip-suffix'</title>
<updated>2014-07-16T18:26:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-16T18:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e4094731acee5207595a8416d19508107ea475d'/>
<id>urn:sha1:6e4094731acee5207595a8416d19508107ea475d</id>
<content type='text'>
* jk/strip-suffix:
  prepare_packed_git_one: refactor duplicate-pack check
  verify-pack: use strbuf_strip_suffix
  strbuf: implement strbuf_strip_suffix
  index-pack: use strip_suffix to avoid magic numbers
  use strip_suffix instead of ends_with in simple cases
  replace has_extension with ends_with
  implement ends_with via strip_suffix
  add strip_suffix function
  sha1_file: replace PATH_MAX buffer with strbuf in prepare_packed_git_one()
</content>
</entry>
</feed>
