git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: Teddy Reed <teddy.reed@gmail.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: Cannot shallow clone using GitHub tag refs after commit 34066f06
Date: Sat, 12 Oct 2019 18:31:02 -0400
Message-ID: <20191012183102.337fe74d728a4942a7de5ab7@gmail.com> (raw)

Hello, I am trying to debug an issue where a shallow clone (--depth=1) fails when the reference is the tip of a tag on a GitHub repository.

The git client works on versions below 2.22.0-rc0 up until commit 34066f06, "fetch: do not consider peeled tags as advertised tips". That commit peels refs in the form of "refs/tags/v2.2.2^{}". My question is if the intention was to peel these refs and break this functionality? I do not know enough about git to understand if the behavior before commit 34066f06 was unintended.

Here is a method to reproduce the previous behavior:

$ mkdir test-repo
$ cd test-repo
$ git init
$ git submodule add https://github.com/gflags/gflags gflags
$ (cd gflags; git checkout v2.2.2)
$ git add .
$ git commit -m 'Add gflags submodule'

Then with git client version 2.21.0:

$ git clone test-repo test-repo2
$ cd test-repo2
$ git submodule update --init --depth=1

Submodule 'gflags' (https://github.com/gflags/gflags) registered for path 'gflags'
Cloning into '/tmp/test-repo2/gflags'...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 9 (delta 8), reused 1 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
From https://github.com/gflags/gflags
 * branch            e171aa2d15ed9eb17054558e0b3a6a413bb01067 -> FETCH_HEAD
Submodule path 'gflags': checked out 'e171aa2d15ed9eb17054558e0b3a6a413bb01067'

And attempting with newer versions of the git client:

Cloning into '/tmp/test-repo2/gflags'...
error: Server does not allow request for unadvertised object e171aa2d15ed9eb17054558e0b3a6a413bb01067
Fetched in submodule path 'gflags', but it did not contain e171aa2d15ed9eb17054558e0b3a6a413bb01067. Direct fetching of that commit failed.

Thanks for the help!

-- 
Teddy Reed <teddy.reed@gmail.com>

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12 22:31 Teddy Reed [this message]
2019-10-13  6:43 ` Jeff King

Reply instructions:

You may reply publically 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=20191012183102.337fe74d728a4942a7de5ab7@gmail.com \
    --to=teddy.reed@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror http://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox