Skip to content

Fix git repository corruption #5

@alerque

Description

@alerque

This repository has had a long standing issue with an invalid object in a commit. If git option for fsckObjects is set to true, the repository cannot be cloned:

❯ git clone git@github.com:vim-pandoc/vim-markdownfootnotes.git
Cloning into 'vim-markdownfootnotes'...
remote: Enumerating objects: 61, done.
error: object 03bd5b16bcd2add179d28dfb7252384770082880: badTimezone: invalid author/committer line - bad time zone
fatal: fsck error in packed object
fatal: index-pack failed

For years I've worked around this by temporarily disabling this setting in my user's git-config, cloning the repository, then turning the setting back on. In my bootstrap scripts I pass extra arguments to git for this project in particular that none of my other clones require.

Unfortunately since this was not caught and fixed by running git fsck early, fixing it is hard. Or at least awkward. There are actually two objects that need fixing:

❯ git fsck
Checking object directories: 100% (256/256), done.
error in commit 03bd5b16bcd2add179d28dfb7252384770082880: badTimezone: invalid author/committer line - bad time zone
error in commit 7d48d84e93060e1b5aa05fdcdc782690e7d3801e: badTimezone: invalid author/committer line - bad time zone
Checking objects: 100% (61/61), done.

These are of course the initial 2 commits in this repository. Fixing them means rebasing all the other commits. This will mean everybody's clones will also need rebasing.

I would suggest that this is worth doing, and doing sooner rather than later. However since it is a bit of a disruptive change I will hold off actually doing it until there is some consensus that this is okay.

Alternatives to rebasing this would be to rename this repository as a "legacy" repo and open a new one that is not a fork of this one and post the clean branch there. I don't support this option, but it's the only other way I can think of to deal with the problem.

Lastly doing noting and just letting all future cloners deal with this in their own way is an option. Again I don't support this because it's so disruptive to anybody that has integrity checks turned on, but it is an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions