[go: up one dir, main page]

Skip to content

Add git-filter-repo flags for handling signed tags and commits

Previous work (#457 (closed)) added a --signed-commits flag to git fast-export. During the discussion Junio commented (see https://public-inbox.org/git/xmqq1pvn6zvg.fsf@gitster.g/):

I haven't thought about this topic obviously for a looooong time, but I wonder we may want to have an option, which is independent from these --signed-tags/--signed-commits options addressed here, that allows the person who performed the import to attest to the result by adding their own signature on tags and commits, whether these tags and commits were originally signed or not.

Elijah Newren, the git-filter-repo author, replied:

For what it's worth, this has been requested multiple times of git-filter-repo, so there is some desire for this feature.

And @pks-gitlab confirmed this was our goal:

This is also exactly the usecase we have been reviving this effort for :) We recently hit such a case where a customer was basically unable to use git-filter-repo(1) due to commit signatures, so we wanted to help out and get this patch series landed so that the issue can ultimately be addressed in git-filter-repo(1).

When discussing with him, Elijah suggested all the following options:

  • (A) Make fast-export include signatures, have filter-repo preserve them in the stream, and make fast-import include them unconditionally.
  • (B) Similar to (A), but make fast-import check them and either error out or drop them if they become invalid.
  • (C) Similar to (B), but make fast-import re-sign the commit if they become invalid.
  • (D) Similar to (B), but make fast-import re-sign the commit even if the signature would have been valid.
  • (E) Make fast-import simply resign all commits it writes out, regardless of whether there is a signature attached to any commit it is directed to make. (Which makes it irrelevant whether fast-export or filter-repo process commit signatures.)

Elijah later said that when the above is implemented he would take care of making the changes in git-filter-repo so that it can use the implemented features.

Right now, #457 (closed) and #557 (closed) have been implemented so that fast-export properly exports commit signatures.

I also started working on #519 so that fast-import can check and drop signatures or resign commits. So we are close to being able to address this.

Edited by Christian Couder