git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-clone --config order & fetching extra refs during initial clone
@ 2017-02-25 19:12 Robin H. Johnson
  2017-02-25 20:21 ` Jeff King
  2017-02-25 20:50 ` Jeff King
  0 siblings, 2 replies; 15+ messages in thread
From: Robin H. Johnson @ 2017-02-25 19:12 UTC (permalink / raw)
  To: Git Mailing List

[-- 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 --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-05-09  2:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-25 19:12 git-clone --config order & fetching extra refs during initial clone Robin H. Johnson
2017-02-25 20:21 ` 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

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).