git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Git Mailing list <git@vger.kernel.org>
Subject: Re: "git clone --shallow-exclude ...", fatal: the remote end hung up unexpectedly
Date: Fri, 15 Mar 2019 19:28:18 +0700	[thread overview]
Message-ID: <CACsJy8DVRJ4DG6PEkFuzytOQJ7RX6GMaHd4BRQTR9N7Y9V6fqQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.21.1903150809070.26709@localhost.localdomain>

On Fri, Mar 15, 2019 at 7:17 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
>
>   probably doing something idiotic but i'm enumerating variations of
> shallow cloning, and tried the following:
>
> $ git clone --shallow-exclude=master https://github.com/django/django.git
> Cloning into 'django'...
> fatal: the remote end hung up unexpectedly
> $
>
>   it is entirely reproducible, and some googling suggests that this
> represents an error at the *other* end, which in some weird way does
> not support that clone option. that seems strange ... should this
> option work? am i using it incorrectly?
>
>   wait, hang on ... i just picked one of django's topic branches at
> random, and this did succeed:

Yeah i think when you request shallow clone, by default it only gets
one branch (see --single-branch, often 'master'). So when you specify
--shallow-exclude you essentially say 'give me master branch but
exclude everything from master'.

I should probably make it print a friendlier message than simply
terminateing like that (it's still a guess, I haven't tried it out)

> $ git clone --shallow-exclude=stable/2.0.x https://github.com/django/django.git
> Cloning into 'django'...
> remote: Enumerating objects: 33112, done.
> remote: Counting objects: 100% (33112/33112), done.
> ... etc etc ...
> $
>
> but all this gave me was the master branch. i clearly don't understand
> what this option is supposed to do.

You're saying 'give me master branch, exclude everything that is
reachable from stable/2.0.x'. If there's nothing in common between
master and this branch, you get full 'master' branch. Otherwise you
get a shallow 'master' branch.

This option is meant to give you another way to cut the history.
Instead of saying 'give me X latest commits' with --shallow, you could
say 'give me commits since this cut point' and the cut point is often
a tag, on the same branch. Using an unrelated bracnh or tag could give
some surprising result.
-- 
Duy

  reply	other threads:[~2019-03-15 12:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15 12:14 "git clone --shallow-exclude ...", fatal: the remote end hung up unexpectedly Robert P. J. Day
2019-03-15 12:28 ` Duy Nguyen [this message]
2019-03-15 13:19   ` Robert P. J. Day
2019-03-15 13:41     ` Duy Nguyen
2019-03-15 14:31       ` Robert P. J. Day
2019-03-16  3:43         ` Duy Nguyen
2019-03-16 12:15           ` Robert P. J. Day

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACsJy8DVRJ4DG6PEkFuzytOQJ7RX6GMaHd4BRQTR9N7Y9V6fqQ@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).