git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: Git Mailing List <git@vger.kernel.org>
Subject: git-clone --config order & fetching extra refs during initial clone
Date: Sat, 25 Feb 2017 19:12:38 +0000	[thread overview]
Message-ID: <robbat2-20170225T185056-448272755Z@orbis-terrarum.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

TL;DR: git-clone ignores any fetch specs passed via --config.

The documentation for git-clone --config says:
| Set a configuration variable in the newly-created repository; this takes
| effect immediately __AFTER__ the repository is initialized, but __BEFORE__
| the remote history is fetched or any files checked out. [...]
(emphasis added)

However, this doesn't seem be be true, right after the clone, the refs are NOT
present, and the next fetch seems to pull the extra refs. This seems to be
because the refspec building for the initial clone doesn't take into account
any fetch lines added to the config.

Testcase to reproduce (confirmed in v2.11.1, not tested 2.12.0 quite yet):
# export REPOURI=https://github.com/openstack-dev/sandbox.git DIR=test
# git clone \
    -c remote.origin.fetch=+refs/notes/*:refs/notes/* \
    -c remote.origin.fetch=+refs/changes/*:refs/remotes/origin/changes/* \
    $REPOURI $DIR \
  && cd $DIR \
  && git fetch

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Trustee & Treasurer
E-Mail   : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 1083 bytes --]

             reply	other threads:[~2017-02-25 19:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-25 19:12 Robin H. Johnson [this message]
2017-02-25 20:21 ` git-clone --config order & fetching extra refs during initial clone Jeff King
2017-02-25 20:50 ` Jeff King
2017-02-27 19:16   ` Junio C Hamano
2017-02-27 21:12     ` Jeff King
2017-03-11  0:41       ` SZEDER Gábor
2017-03-15 17:08         ` Jeff King
2017-05-03 14:42           ` SZEDER Gábor
2017-05-03 20:22             ` Jeff King
2017-05-04  6:57               ` Sebastian Schuberth
2017-05-09  1:33               ` Junio C Hamano
2017-05-09  2:10                 ` Jeff King
2017-05-09  2:26                   ` Jeff King
2017-05-09  2:50                     ` Junio C Hamano
2017-05-04  7:28             ` Ævar Arnfjörð Bjarmason

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=robbat2-20170225T185056-448272755Z@orbis-terrarum.net \
    --to=robbat2@gentoo.org \
    --cc=git@vger.kernel.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.
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).