mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Olivier Bornet <>
Cc: Olivier Bornet <>
Subject: Problem with fsck and invalid submodule path in history
Date: Mon, 29 Jul 2019 09:58:52 +0200	[thread overview]
Message-ID: <> (raw)

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


I have a git repository with an error in a submodule path in the history.
The submodule path is “-f”, which is not allowed. But for some reason, it’s in the history of the git, and I’m trying to find a way to manage it without having to rewrite the full history on the main gitlab (if possible)...

To reproduce this unwanted history:

    mkdir test-bad-history
    cd test-bad-history
    echo "Test git submodule problems" >
    git init
    git add
    git commit --message="Start test"
    git submodule add
    git commit --message="Commit new submodule with correct path"
    # the bad part...
    git mv hello-world -- -f
    git commit --message="Move submodule to an invalid path"
    # correct it...
    git mv -- -f valid-path
    sed -i.bak 's/-f/valid-path/' .gitmodules
    git add .gitmodules
    git commit --message="Back to a valid path"

After that, even if the git is working correctly, we have a “bad” history if we check with fsck:

    $ git fsck
    Checking object directories: 100% (256/256), done.
    error in blob 19a97d3b70760c74b780c8134e33f5392292c2e6: gitmodulesPath: disallowed submodule path: -f

Is it possible to correct it? Must git handle this kind of errors?

Thanks in advance for any help.

Olivier Bornet

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 235 bytes --]

             reply	other threads:[~2019-07-29  7:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29  7:58 Olivier Bornet [this message]
2019-07-29  9:39 ` Problem with fsck and invalid submodule path in history SZEDER Gábor
2019-07-29  9:59   ` [PATCH] Documentation/git-fsck.txt: include fsck.* config variables SZEDER Gábor
2019-07-29 15:33     ` Ævar Arnfjörð Bjarmason
2019-07-29 15:48       ` Junio C Hamano
2019-07-29 20:12         ` Jeff King
2019-07-29 21:32           ` Junio C Hamano
2019-07-29 14:31   ` Problem with fsck and invalid submodule path in history Olivier Bornet

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:

  List information:

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

  git send-email \ \ \ \

* 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

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