Skip to content

contrib/subtree: Add -S/-gpg-sign

Patrik Weiskircher via GitGitGadget git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

* Adjusted commit message to not mention the not implemented flag yet.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2contrib/subtree: parse using --stuck-longcontrib/subtree/git-subtree.sh+13 -210 replies
2/2contrib/subtree: add -S/--gpg-signcontrib/subtree/git-subtree.adoc contrib/subtree/git-subtree.sh contrib/subtree/t/t7900-subtree.sh+145 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] contrib/subtree: Add -S/-gpg-sign

This patch adds support for the -S/--gpg-sign option to the git subtree command.

Currently, git subtree creates squash and merge commits without applying GPG signatures, even when commit signing is configured via commit.gpgSign. This causes issues in repositories that require signed commits for policy reasons.

The implementation ensures that -S/--gpg-sign behaves consistently with other Git commands, passing the flag through to git commit-tree and git merge where appropriate.

This change improves compatibility with workflows and repositories that enforce signed commits.

Changes have been made to this patch according to a discussion with Junio C Hamano [email protected] on my previous patch attempt.

Changes since v1:

* Adjusted commit message to not mention the not implemented flag yet.

Patrik Weiskircher (2):
contrib/subtree: parse using --stuck-long
contrib/subtree: add -S/--gpg-sign

 contrib/subtree/git-subtree.adoc   |  19 +++--
 contrib/subtree/git-subtree.sh     |  66 ++++++++---------
 contrib/subtree/t/t7900-subtree.sh | 113 +++++++++++++++++++++++++++++
 3 files changed, 158 insertions(+), 40 deletions(-)

base-commit: 0bd2d791cc9f745ebaedafc0e1cbebdebe41343e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1928%2Fpweiskircher%2Fsubtree-sign-the-second-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1928/pweiskircher/subtree-sign-the-second-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1928

Range-diff vs v1:

1: fe7e918ba18 ! 1: 5bbdbf01636 contrib/subtree: parse using --stuck-long
@@ Metadata
## Commit message ##
contrib/subtree: parse using --stuck-long

- -S/--gpg-sign requires an optional parameter. Optional parameter
- handling only works unambiguous with git rev-parse --parseopt when using
- the --stuck-long option.
+ Optional parameter handling only works unambiguous with git rev-parse
+ --parseopt when using the --stuck-long option. To prepare for future commits
+ which add flags with optional parameters, parse with --stuck-long.

2: 45ae2c31bc0 = 2: af5b4a65b63 contrib/subtree: add -S/--gpg-sign

Signature · 1 line
gitgitgadget