git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] Move code resolving packed refs into its own function.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 1, 2006, 09:58 UTC
Message-ID
<7vodsw2w9g.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200610010606.32561.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 10 quoted lines
> Junio C Hamano wrote:
>> Christian Couder <chriscool@tuxfamily.org> writes:
>> > This patch move Linus' packed refs resolving code from
>> > "resolve_ref" into a new "resolve_packed_ref" extern
>> > function so that it can be reused when needed.
>>
>> I think we are stepping on each other's toes.  How far into the
>> process of making correct branch deletion are you?
>
> I am not farther than the 2 patches I sent yesterday (before going to bed).

Thanks. I just did not want to waste your work with overlapping duplicated efforts.

I think what we have in "next" tonight is in a more-or-less testable shape, although it has still a long way to reach "master". Things I know we need to address:

 - I've updated lock_ref_sha1_basic() to remove empty left-over
   directories and to notice conflicts between 'foo/bar' vs
   'foo' when creating a new ref, hopefully in the same spirit
   as your patch to safe_create_leading_directories(), but done
   differently (safe_... function is meant to be used anywhere
   not just $GIT_DIR/refs/, and it felt wrong for it to take
   exception for packed refs).  We should do the same for the
   reflog hierarchy but we currently don't.
 - We need to audit our shell scripts to make sure they do not
   depend on being able to look directly into $GIT_DIR/refs to
   see if the ref they are interested in exists.  I've fixed a
   few in git-fetch while handling the patch to clean up its
   output from Santi, but I would not be surprised if there are
   more.  The code in git-branch and git-tag to list what's
   there are Ok; they use "rev-parse --symbolic --all/--tags".
 - I think gitweb should be Ok; it does peek-remote on the
   repository.  Although we would probably want to update
   git_get_references and git_get_refs_list sub to use
   for-each-ref there, that can be done as a later optimization.
 - Dumb transports are not aware of packed refs on the remote
   side.  The underlying commit walkers (anything that links
   with fetch.c) needs their fetch_ref() implementation updated
   to look at the packed-refs file from the remote side and we
   should be fine after that.  I haven't looked at rsync
   transport but the change necessary there shouldn't be too
   involved.
Previous: Christian CouderNext: Jakub Narebski
Message 12 of 14 in “Move code resolving packed refs into its own function.”
  1. 1/2 Move code resolving packed refs into its own function.Christian Couder, Sep 30, 2006
  2. Junio C HamanoSep 30, 2006
  3. 0/6 ref deletion and D/F conflict avoidance with packed-refs.Junio C Hamano, Sep 30, 2006
  4. 1/6 ref locking: allow 'foo' when 'foo/bar' used to exist but not anymore.Junio C Hamano, Sep 30, 2006
  5. 2/6 refs: minor restructuring of cached refs data.Junio C Hamano, Sep 30, 2006
  6. 3/6 lock_ref_sha1(): do not sometimes error() and sometimes die().Junio C Hamano, Sep 30, 2006
  7. 4/6 lock_ref_sha1(): check D/F conflict with packed ref when creating.Junio C Hamano, Sep 30, 2006
  8. 5/6 delete_ref(): delete packed refJunio C Hamano, Sep 30, 2006
  9. 6/6 git-branch: remove D/F check done by hand.Junio C Hamano, Sep 30, 2006
  10. Jeff KingSep 30, 2006
  11. Christian CouderOct 1, 2006
  12. Junio C HamanoOct 1, 2006
  13. Jakub NarebskiOct 3, 2006
  14. Junio C HamanoOct 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.