Skip to content
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

Bad GPG signature after metaedit #1028

Open
nairb774 opened this issue Feb 12, 2025 · 3 comments
Open

Bad GPG signature after metaedit #1028

nairb774 opened this issue Feb 12, 2025 · 3 comments

Comments

@nairb774
Copy link

I'm seeing situations where invalid GPG signatures are being attached to commits. This seems to reproduce the state:

# Edit a file
sl commit -m 'My edit'
# Verify commit - passes:
git -C "$(sl root)/.sl/store/git" verify-commit "$(sl id -i)"
# Update the commit message:
sl metaedit -m 'Better description'
# Verify commit - fails:
git -C "$(sl root)/.sl/store/git" verify-commit "$(sl id -i)"

There might be other workflows that trigger this as well (rebasing possibly). I've been working around it by grafting the busted commit.

From what I can tell, the prior gigsig entry is remaining in the extra dict when generating the new commit. Inspect extra here-ish:

"extras": extra or {},

This is causing the new signature to include the prior signature before replacing it. This might have been introduced with 138903f but I've had a hard time building sapling from anything other than head in the past.

A hack-fix that seems to work is adding fields["extras"].pop("gpgsig", None) prior to

text = to_text(fields).encode()

This is seen when building from bc5cb14.

@quark-zju
Copy link
Contributor

Thanks! I'll fix this shortly.

@quark-zju
Copy link
Contributor

Should be fixed by 3d7285b

@nairb774
Copy link
Author

Building from 309a579 seems to address the signature issue. Thanks.

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

No branches or pull requests

2 participants