From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>,
Jens Lehmann <Jens.Lehmann@web.de>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCHv2 0/6] git clone: Marry --recursive and --reference
Date: Tue, 09 Aug 2016 14:45:59 -0700 [thread overview]
Message-ID: <xmqqeg5x8vl4.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kbPvj6dU1DMaCh7ieJbs0qWimdHSD8xFfUyV98md2pywQ@mail.gmail.com> (Stefan Beller's message of "Tue, 9 Aug 2016 13:31:31 -0700")
Stefan Beller <sbeller@google.com> writes:
> At the time of cloning you may run
>
> git clone --recursive --reference <other-super-project-location>
> or
> git clone --recursive --reference-if-able <other-super-project-location>
> or
> git clone --recursive
That's an interesting tangent. I never meant "if-able" to be an
end-user visible option [*1*], but now you mention it, I do not see
a reason why "clone --reference-if-able" of the top-level project
cannot be used together with "--recursive".
> Then later when we run
> git submodule update
> we have this option to know if a submodule alternate should be treated
> as optional or required referenced as the existence
> of the superprojects alternate (as a boolean indicator) is not enough of
> an indicator what the user later wants.
A tangent that comes to my mind after reading this is if letting
"if-able" just skip (with or without warning) and forget about it
once a clone is made is what we really want.
Suppose the "other-super-project-location" repository did not have a
clone of a submodule when you create a new clone of the superproject
using it as a reference. The submodule will be made a full clone,
but after that happens, other-super-project-location can get
interested in the submodule and can acquire its own clone.
At that point, our clone of the submodule _could_ add the submodule
in the other-super-project-location as its alternate and lose the
duplicate objects that it could borrow from there by repacking, but
the suggested "clone with if-able, and forget about it after a clone
is made" would not allow us to do this. I do not know if a
real-world use of submodules want the ability to do so, or it is
unnecessary. I suspect with the recording of "you were told that
borrowing from the same location as the superproject is OK", this
becomes easily doable (i.e. subsequent "submodule update" can realize
that the submodule does not have alternates but it could borrow from
the submodule in the other-super-project-location).
[Footnote]
*1* Rather, I meant: clone has a very intimate knowledge on what and
what cannot be borrowed from and it is not just "is there a
directory?", so "git submodule update --init" is not in a good
position to decide if it wants to add --reference to the
invocation of "git clone" it makes internally, and introducing
an "if-able" variant to "clone" is one way to relieve it from
having to make that decision.
I could have suggested an alternative: because the submodule
machinery is gettting moved to C the "update --init" code that
drives the internal invocation of "git clone" could share the
the logic in "git clone --reference" that determines if a local
repository can be used as an alternate by small refactoring of
builtin/clone.c::add_one_reference().
next prev parent reply other threads:[~2016-08-09 21:46 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 4:08 [PATCHv2 0/6] git clone: Marry --recursive and --reference Stefan Beller
2016-08-09 4:08 ` [PATCHv3 1/9] t7408: modernize style Stefan Beller
2016-08-09 6:59 ` Eric Sunshine
2016-08-09 15:50 ` Junio C Hamano
2016-08-09 15:51 ` Junio C Hamano
2016-08-09 17:30 ` Stefan Beller
2016-08-09 17:39 ` Junio C Hamano
2016-08-09 23:06 ` Eric Sunshine
2016-08-09 4:08 ` [PATCHv3 2/9] t7408: merge short tests, factor out testing method Stefan Beller
2016-08-09 16:41 ` Junio C Hamano
2016-08-09 17:26 ` Stefan Beller
2016-08-09 4:08 ` [PATCHv3 3/9] submodule--helper module-clone: allow multiple references Stefan Beller
2016-08-09 4:08 ` [PATCHv3 4/9] submodule--helper update-clone: " Stefan Beller
2016-08-09 4:08 ` [PATCHv3 5/9] clone: clarify option_reference as required Stefan Beller
2016-08-09 4:08 ` [PATCHv2 5/6] submodule update: add super-reference flag Stefan Beller
2016-08-09 4:08 ` [PATCHv3 6/9] clone: implement optional references Stefan Beller
2016-08-09 16:37 ` Junio C Hamano
2016-08-09 17:54 ` Junio C Hamano
2016-08-09 18:20 ` Stefan Beller
2016-08-09 18:35 ` Junio C Hamano
2016-08-09 4:08 ` [PATCHv2 6/6] clone: reference flag is used for submodules as well Stefan Beller
2016-08-09 4:08 ` [PATCHv3 7/9] submodule helper: pass through --reference-if-able Stefan Beller
2016-08-09 4:08 ` [PATCHv3 8/9] submodule: try alternates when superproject has an alternate Stefan Beller
2016-08-09 4:08 ` [PATCHv3 9/9] submodule--helper: use parallel processor correctly Stefan Beller
2016-08-09 16:40 ` Junio C Hamano
2016-08-09 5:23 ` [PATCHv2 0/6] git clone: Marry --recursive and --reference Jacob Keller
2016-08-09 15:49 ` Junio C Hamano
2016-08-09 17:26 ` Stefan Beller
2016-08-09 17:47 ` Junio C Hamano
2016-08-09 17:58 ` Junio C Hamano
2016-08-09 18:09 ` Stefan Beller
2016-08-09 18:44 ` Junio C Hamano
2016-08-09 20:31 ` Stefan Beller
2016-08-09 21:45 ` Junio C Hamano [this message]
2016-08-09 22:05 ` Stefan Beller
2016-08-10 15:59 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2016-08-06 1:23 Stefan Beller
2016-08-06 17:29 ` Junio C Hamano
2016-08-08 18:16 ` Stefan Beller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqeg5x8vl4.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=mst@redhat.com \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.