1. 16 10月, 2014 5 次提交
  2. 20 9月, 2014 1 次提交
    • D
      refs: make rev-parse --quiet actually quiet · c41a87dd
      David Aguilar 提交于
      When a reflog is deleted, e.g. when "git stash" clears its stashes,
      "git rev-parse --verify --quiet" dies:
      
      	fatal: Log for refs/stash is empty.
      
      The reason is that the get_sha1() code path does not allow us
      to suppress this message.
      
      Pass the flags bitfield through get_sha1_with_context() so that
      read_ref_at() can suppress the message.
      
      Use get_sha1_with_context1() instead of get_sha1() in rev-parse
      so that the --quiet flag is honored.
      Signed-off-by: NDavid Aguilar <davvid@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c41a87dd
  3. 04 9月, 2014 5 次提交
  4. 03 9月, 2014 1 次提交
  5. 17 7月, 2014 1 次提交
  6. 15 7月, 2014 11 次提交
  7. 28 5月, 2014 2 次提交
    • J
      remote prune: optimize "dangling symref" check/warning · e6bea66d
      Jens Lindström 提交于
      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: NJens Lindström <jl@opera.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e6bea66d
    • J
      remote: repack packed-refs once when deleting multiple refs · c9e768bb
      Jens Lindström 提交于
      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: NJens Lindström <jl@opera.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c9e768bb
  8. 09 5月, 2014 1 次提交
    • R
      refs.c: add new functions reflog_exists and delete_reflog · 4da58835
      Ronnie Sahlberg 提交于
      Add two new functions, reflog_exists and delete_reflog, to hide the internal
      reflog implementation (that they are files under .git/logs/...) from callers.
      Update checkout.c to use these functions in update_refs_for_switch instead of
      building pathnames and calling out to file access functions. Update reflog.c
      to use these to check if the reflog exists. Now there are still many places
      in reflog.c where we are still leaking the reflog storage implementation but
      this at least reduces the number of such dependencies by one. Finally
      change two places in refs.c itself to use the new function to check if a ref
      exists or not isntead of build-path-and-stat(). Now, this is strictly not all
      that important since these are in parts of refs that are implementing the
      actual file storage backend but on the other hand it will not hurt either.
      Signed-off-by: NRonnie Sahlberg <sahlberg@google.com>
      Acked-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4da58835
  9. 08 4月, 2014 5 次提交
  10. 28 10月, 2013 1 次提交
  11. 05 9月, 2013 1 次提交
    • B
      refs: add update_refs for multiple simultaneous updates · 98aee92d
      Brad King 提交于
      Add 'struct ref_update' to encode the information needed to update or
      delete a ref (name, new sha1, optional old sha1, no-deref flag).  Add
      function 'update_refs' accepting an array of updates to perform.  First
      sort the input array to order locks consistently everywhere and reject
      multiple updates to the same ref.  Then acquire locks on all refs with
      verified old values.  Then update or delete all refs accordingly.  Fail
      if any one lock cannot be obtained or any one old value does not match.
      
      Though the refs themselves cannot be modified together in a single
      atomic transaction, this function does enable some useful semantics.
      For example, a caller may create a new branch starting from the head of
      another branch and rewind the original branch at the same time.  This
      transfers ownership of commits between branches without risk of losing
      commits added to the original branch by a concurrent process, or risk of
      a concurrent process creating the new branch first.
      Signed-off-by: NBrad King <brad.king@kitware.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      98aee92d
  12. 31 8月, 2013 1 次提交
  13. 21 6月, 2013 1 次提交
  14. 03 6月, 2013 1 次提交
    • M
      refs: document the lifetime of the args passed to each_ref_fn · 4f78c24c
      Michael Haggerty 提交于
      The lifetime of the memory pointed to by the refname and sha1
      arguments to each_ref_fn was never documented, but some callers used
      to assume that it was essentially permanent.  In fact the API does
      *not* guarantee that these objects live beyond a single callback
      invocation.
      
      In the current code, the lifetimes are bound together with the
      lifetimes of the ref_caches.  Since these are usually long, the
      callers usually got away with their sloppiness.  But even today, if a
      ref_cache is invalidated the memory can be freed.  And planned changes
      to reference caching, needed to eliminate race conditions, will
      probably need to shorten the lifetimes of these objects.
      
      The commits leading up to this have (hopefully) fixed all of the
      callers of the for_each_ref()-like functions.  This commit does the
      last step: documents what each_ref_fn callbacks can assume about
      object lifetimes.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f78c24c
  15. 02 5月, 2013 3 次提交