Skip to content

Fixes issue #613 (support for GPG signed commits on upstream repo) #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edvinassabaliauskas
Copy link

@edvinassabaliauskas edvinassabaliauskas commented Mar 25, 2024

Fixes #613

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how this was effecting GPG signed commits? I am not able to see it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so the filter-branch is effectively rewriting all the commits even if there was no change made (no .gitrepo to remove). If filter encounters a merge commit (with more than one parent), continuing the filter on a second parent rewrites those commits. If commits are GPG signed during rewrite the signatures gets dropped which results in changed commit hash. This results in inability to push the branch to the remote, as local and remote histories do not match.
We actually want to remove .gitrepo files only from the newly created commits and not from the ones that are already on the remote.

I hope I've explained it clear enough 😃 It took me a while to understand what was happening with the commit rewriting.

@soraxas
Copy link

soraxas commented Apr 23, 2025

Hi @admorgan , I was encountering this exact issue and was extremely puzzled as to WHY two commits have exactly the same timestamp/message etc but with different SHA. It's only afte r seeing the raw commit info that it became apparent.

Many thanks @edvinassabaliauskas for the fixes (can confirmed it works). Previously, git-subrepo was complaining parent sha not found in subrepo HEAD and was not able to push changes to the subrepo (some changes was made to subrepo outside its parent and got pulled).

Can we get this merged? I can share my info:

  • The Left is inside the tmp worktree (i.e. local to the parent repo),
  • The Right is the remote subrepo (i.e. what you'd see from the actual subrepo) (I've made that changes directly from github web)
  • They are "supposed" to be the same commit, but had diverged.

Notice how the local worktree had the signature removed, resulting in mismatch of the commit SHA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No support for GPG signed commits on upstream repo
3 participants