Skip to content

Roundtripping broken when raw commit includes custom metadata (e.g. as GitButler adds) #1377

@bjeanes

Description

@bjeanes

In #596 (comment), I discovered the reason my SHAs were not lining up, by finding a specific commit where the histories began to diverge (between original repo and imported-then-subpath-cloned repo).

In this case, it seems that the GitButler tool is injecting custom headers into the commit object, which are being elided when JOSH rewrites them:

diff <(git show --pretty=raw 8f49df1dc) <(git show --pretty=raw 34d061bdc)
1c1
< commit 8f49df1dc0acf9389c7aa712847cc8309f01755d
---
> commit 34d061bdca18e243ccc8bfe53333037ce17500f9
6,7d5
< gitbutler-headers-version 2
< gitbutler-change-id baefc019-8ef0-40f2-9f1f-dc92b9984387

These appear to be added by the GitButler tool here https://github.com/gitbutlerapp/gitbutler/blob/6fdcf9fcc85b78fde9b449c914eaa1228c65d868/crates/gitbutler-commit/src/commit_headers.rs#L114-L121, introduced in gitbutlerapp/gitbutler#4025.

Is it possible to support unknown headers or do new headers need to be "learned" case-by-case?

Would it be possible to update JOSH to support these headers? I don't even know what GitButler would do if the gitbutler-change-id was the same UUID for a different commit object, though.

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