From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Adeodato Simó" <dato@net.com.org.es>,
"Jay Soffian" <jaysoffian@gmail.com>,
"Johannes Sixt" <j.sixt@viscovery.net>,
git@vger.kernel.org, "Mikael Magnusson" <mikachu@gmail.com>,
"Joey Hess" <joey@kitenet.net>
Subject: Re: [PATCH] git-clone.txt: document that pushing from a shallow clone may work
Date: Wed, 04 Mar 2009 16:41:25 -0800 [thread overview]
Message-ID: <7vr61c4x8q.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: alpine.DEB.1.00.0903041209070.8549@intel-tinevez-2-302
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> On Wed, 4 Mar 2009, Junio C Hamano wrote:
>
>> Isn't the rule more or less like:
>>
>> If your shallow repository's history does not extend long enough and
>> the other repository forked before your truncated history, wyou cannot
>> compute the common ancestor and you cannot push out.
>
> Exactly.
Actually, come to think of it, it is a lot stronger than "cannot compute
the common".
The history may look like this:
R---R---R
/
--R---R---X---X---S---S---S
where S are the commits you have in your shallow repository, and R are the
commits that exist in the repository that receives your push. Because
your history is shallow, neither repository has 'X' that are the commits
that need to exist in order to keep the history of recipient repository
complete; the recipient is not shallow to begin with, and we do not want
to make it shallow.
If you cloned shallowly some time ago, worked without communicating with
the other side while the other side progressed, *AND* if the other side's
progress included a rewind & rebuild of the history, you would see a
similar topology. The leftmost 'S' in the above picture might have been
the tip of the branch when you shallowly cloned with depth 1, and since
then the remote end may have discarded topmost three commits and have
rebuilt its history that leads to the rightmost 'R'. In such a case
pushing to the remote's HEAD will fail.
next prev parent reply other threads:[~2009-03-05 0:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 22:02 pushing from a shallow repo allowed? Joey Hess
2009-02-16 10:00 ` Mikael Magnusson
2009-03-03 11:33 ` [PATCH] git-clone.txt: document that pushing from a shallow clone may work Adeodato Simó
2009-03-03 11:57 ` Johannes Sixt
2009-03-03 12:08 ` Adeodato Simó
2009-03-03 19:27 ` Jay Soffian
2009-03-04 10:19 ` Adeodato Simó
2009-03-04 10:45 ` Junio C Hamano
2009-03-04 11:11 ` Johannes Schindelin
2009-03-05 0:41 ` Junio C Hamano [this message]
2009-03-04 22:22 ` Adeodato Simó
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=7vr61c4x8q.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=dato@net.com.org.es \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=jaysoffian@gmail.com \
--cc=joey@kitenet.net \
--cc=mikachu@gmail.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 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).