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

Re: [PATCH v2 0/1] git-clone: fix relative path problem in the alternates

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2011, 21:57 UTC
Message-ID
<7vliulun2a.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vzkj1uqpa.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> While at it, we may probably want to update the command option handling so
> that you can give more than one --reference= parameters.
Geez. There appear to be more bugs in the existing code.
If you
 - specify --reference;
 - the source of the clone is a local directory;
 - you do not specify --shared; and
 - the source of the clone has its own alternates
we end up exercising this call flow:
	init_db();
        setup_reference();
        -> add_to_alternates_file();
           This writes objects/info/alternates in the new repository
	clone_local();
        -> copy_or_link_directory(src/objects, dst/objects);
           -> copy_or_link_directory(src/objects/info, dst/objects/info);
              -> unlink(dst/objects/info/alternates);
                 link(src/objects/info/alternates, dst/objects/info/alternates);
and lose the --reference given from the command line.

The problem you are trying to address is a valid one, but it needs to be fixed by teaching copy-or-link-directory that objects/info/alternates is special. We need a more proper fix than "just let the recursive copy do a possibly wrong thing and then patch it up if it is wrong", which is the approach taken by your patch.

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “git-clone: fix relative path problem in the alternates”
  1. 0/1 git-clone: fix relative path problem in the alternatesHui Wang, Aug 22, 2011
  2. 1/1 clone: replace relative paths in the alternatesHui Wang, Aug 22, 2011
  3. Junio C HamanoAug 22, 2011
  4. Junio C HamanoAug 22, 2011
  5. Junio C HamanoAug 22, 2011
  6. 0/2 clone-local fixupJunio C Hamano, Aug 23, 2011
  7. 1/2 clone: allow more than one --referenceJunio C Hamano, Aug 23, 2011
  8. 2/2 clone: clone from a repository with relative alternatesJunio C Hamano, Aug 23, 2011
  9. Hui WangAug 23, 2011
  10. Junio C HamanoAug 23, 2011

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.