Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:52

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help