git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Olivier Bornet <olivier.bornet@puck.ch>
To: git@vger.kernel.org
Cc: Olivier Bornet <Olivier.Bornet@puck.ch>
Subject: Problem with fsck and invalid submodule path in history
Date: Mon, 29 Jul 2019 09:58:52 +0200	[thread overview]
Message-ID: <9C668779-15AC-4099-AAFA-7FFF519D426F@puck.ch> (raw)

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

Hello,

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" > README.md
    git init
    git add README.md
    git commit --message="Start test"
    git submodule add https://github.com/leachim6/hello-world.git
    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
Olivier.Bornet@puck.ch


[-- 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:
  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=9C668779-15AC-4099-AAFA-7FFF519D426F@puck.ch \
    --to=olivier.bornet@puck.ch \
    --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).