From: "Paolo Pettinato (ppettina)" <ppettina@cisco.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Git fetch bug in git 2.21+ "Could not access submodule '%s'"
Date: Wed, 14 Aug 2019 09:57:50 +0000 [thread overview]
Message-ID: <951a0ac4-592f-d71c-df6a-53a806249f7b@cisco.com> (raw)
Spotted this when our Jenkins executors had git updated, and later
managed to reproduce locally.
The issue happens when fetching an updated ref from a remote, and that
ref updates a submodule which is not checked out but whose folder is dirty.
Steps to reproduce (on *nix) with repositories on GitHub:
Scenario: git-fetch-bug repository with 2 branches, the HEADs for these
branches point respectively to 2 different commits in a submodule.
$ mkdir git_repo
$ cd git_repo
# Manually fetch "master" branch
$ git init
$ git remote add origin https://github.com/paolope/git-fetch-bug.git
$ git fetch origin master
# Checkout
$ git checkout master
# Repo now contains a folder named "sm" which is bound to contain a
submodule checkout. But the submodule is not checked out yet.
# Dirty that folder:
$ touch sm/test
# Fetching another branch will fail
$ git fetch origin branch_1
Output:
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 2), reused 5 (delta 2), pack-reused 0
Unpacking objects: 100% (5/5), done.
From https://github.com/paolope/git-fetch-bug
* branch branch_1 -> FETCH_HEAD
* [new branch] branch_1 -> origin/branch_1
Could not access submodule 'sm' # fails, plus no newline here :P!
# Re-issuing the command succeeds
$ git fetch origin branch_1
Output:
From https://github.com/paolope/git-fetch-bug
* branch branch_1 -> FETCH_HEAD
I'd expect the command not to fail, or to fail consistently. This
behaviour didn't happen in git 2.18.1, so the regression was introduced
somewhere in between.
It is possible that this is related to this issue:
https://marc.info/?l=git&m=155246493613592&w=2
Regards,
Paolo Pettinato
**
next reply other threads:[~2019-08-14 10:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 9:57 Paolo Pettinato (ppettina) [this message]
2019-08-14 15:36 ` Git fetch bug in git 2.21+ "Could not access submodule '%s'" Jeff King
2019-08-14 16:40 ` Junio C Hamano
2019-08-14 17:03 ` Paolo Pettinato (ppettina)
2019-08-14 17:56 ` Junio C Hamano
2019-08-14 19:31 ` Jeff King
2019-08-14 15:59 ` [PATCH] get_next_submodule(): format error string as an error Jeff King
2019-08-14 16:15 ` Junio C Hamano
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=951a0ac4-592f-d71c-df6a-53a806249f7b@cisco.com \
--to=ppettina@cisco.com \
--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).