git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Alexander Riesen <alexander.riesen@cetitec.com>
Cc: git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH] Allow "clone --dissociate" to dissociate from alternates
Date: Wed, 21 Oct 2015 10:52:26 -0700	[thread overview]
Message-ID: <xmqqpp085cth.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <56274922.80007@cetitec.com> (Alexander Riesen's message of "Wed, 21 Oct 2015 10:13:22 +0200")

Alexander Riesen <alexander.riesen@cetitec.com> writes:

> Reminder. Is this (or rather the one I'm replying to) patch a better option?

I suspect that the reason why you didn't get any quick response was
because it was unclear from either one of these proposed log
messages why any change is needed in the first place.  At least that
is what prevented me from commenting on either.

The "clone --dissociate" was designed to be used with "--reference".
The mindset of those who saw the need for the feature being that
"clone --reference" is the only way to make the resulting
repository's objects incomplete, needing to borrow objects from some
other place, which necessitates the "--dissociate" option.

The readers of this change need to be enlightened with a log message
to remind them that "--reference" is not the only way.  Namely, if
you start from a repository with $GIT_DIR/objects/info/alternates,
i.e. the original already borrows from somewhere, and bypass the
normal "Git aware" transport mechanism, i.e. "git clone --local",
then the resulting repository would also become dependent of the
object store that the original depended on before the clone.  In
order to make it free-standing, you would need "--dissociate", but
there is no "--reference" involved in that use case.

And once that is clarified, it becomes very clear why it is wrong to
blindly require "--reference" to be there on the command line when
"--dissociate" is given.

As to the patch, I think this one is much simpler and preferrable.
It would hurt those who make a clone without bypassing the normal
"Git aware" transport mechanism and pass "--dissociate" without
"--reference".  They will end up making a clone that does not need
repacking to dissociate, but with this patch they would spend extra
cycles to run an unnecessary repack.  To avoid that, I think you can
throw in an check at the beginning of dissociate_from_references()
to see if git_path("objects/info/alternates") is there and make the
function a no-op if there isn't.

Thanks.

  reply	other threads:[~2015-10-21 17:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 11:28 [PATCH] Use the alternates of the source repository for dissociating clone Alexander Riesen
2015-10-15 14:11 ` Johannes Schindelin
2015-10-15 14:38   ` [PATCH] Allow "clone --dissociate" to dissociate from alternates Alexander Riesen
2015-10-21  8:13     ` Alexander Riesen
2015-10-21 17:52       ` Junio C Hamano [this message]
2015-10-22 13:59         ` [PATCH] Consider object stores in alternates during a dissociating clone Alexander Riesen
2015-10-22 16:12           ` Junio C Hamano
2015-10-22 16:41             ` Alexander Riesen
2015-10-22 17:50               ` Junio C Hamano
2015-10-22 18:08                 ` Alexander Riesen
2015-10-22 18:33                   ` Junio C Hamano
2015-10-22 18:48                     ` Junio C Hamano
2015-10-22 20:10                       ` [PATCH] Documentation: AsciiDoc spells em-dash as double-dashes, not triple Junio C Hamano
2015-10-23  1:14                   ` [PATCH] Consider object stores in alternates during a dissociating clone Johannes Löthberg
2015-10-15 21:59 ` [PATCH] Use the alternates of the source repository for " Junio C Hamano
2015-10-16  7:00   ` Alexander Riesen

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=xmqqpp085cth.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=alexander.riesen@cetitec.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).