-
-
Couldn't load subscription status.
- Fork 2.3k
Enhance support for GPG signed tags #4394
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
Enhance support for GPG signed tags #4394
Conversation
8ac0d6d to
afa1256
Compare
|
Looks good, although I would prefer if we could actually make it work for people who don't have a gpg-agent running. Throwing the DisabledForGPG error should really be an exception for cases where it's too hard to support. As for making it work: we do have the WithGpgHandling helper already, all we need to do it pass in the git config to check as a criterion. Instead of what you did here (add a second NeedsGpgSubprocessForX function), I would have kept the UsingGpg function and passed in the git config there (probably as a named constant). Let me know if I'm not being clear enough. See also #3423 (comment). |
afa1256 to
0c5a8ef
Compare
|
Updated the PR to not create that exception anymore! It was my first time creating an enum-like construct in Go with the |
| self.commitsHelper.OnCommitSuccess() | ||
|
|
||
| return self.c.Refresh(types.RefreshOptions{ | ||
| Mode: types.ASYNC, Scope: []types.RefreshableView{types.COMMITS, types.TAGS}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We implicitly now refresh on more scopes, since the WithGpgHandler calls Refresh with no scopes list applied. I'm assuming that refreshes all scopes. Don't think this is a major problem, but let me know if it is !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's not a major problem, but on the other hand it's also easy to fix, so why not: 81064e7
|
Looks great now, thanks. Yes, I think the use of the enum is perfect here. |
|
@ChrisMcD1 I'd be ready to merge this, but didn't want to without getting some sort of acknowledgment for the commit I added. Also, the PR description no longer matches what the branch does; it would be good if you could update it, since it ends up in the merge commit. |
|
@stefanhaller I have updated the PR description! I could have sworn that I acknowledged that commit, but I now see I only acknowledged it in my own head 😆 |
The actual usage is case insensitive, so this doesn't actually matter. But if fills my heart with joy. The test is case sensitive, but the actual response to `git config commit.gpgSign` is equivalent to `git config commit.gppsign`
81064e7 to
c765da1
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.48.0` -> `v0.50.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary> ### [`v0.50.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.50.0) [Compare Source](jesseduffield/lazygit@v0.49.0...v0.50.0) <!-- Release notes generated using configuration in .github/release.yml at v0.50.0 --> #### What's Changed ##### Enhancements 🔥 - Continue/abort a conflicted cherry-pick or revert by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4441 - Show todo items for pending cherry-picks and reverts by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4442 - Use "git cherry-pick" for implementing copy/paste of commits by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4443 - Allow reverting a range of commits by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4444 - Section headers for rebase todos and actual commits by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4463 - Focus the main view by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4429 - Auto-forward main branches after fetching by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4493 - Add new command "Move commits to new branch" by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#3876 - Strip the '+' and '-' characters when copying parts of a diff to the clipboard by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4519 - Reduce memory consumption of graph (pipe sets) by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4498 ##### Fixes 🔧 - Fix truncation of branches when scrolling branches panel to the left by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4483 - Fix nvim-remote commands for fish shell by [@​SavingFrame](https://github.com/SavingFrame) in jesseduffield/lazygit#4506 - Disallow creating custom patches when the diff context size is 0 by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4522 - Remove double space between rebase todo and author columns by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4520 ##### Maintenance ⚙️ - Allow closing issues via github actions by [@​jesseduffield](https://github.com/jesseduffield) in jesseduffield/lazygit#4515 ##### Docs 📖 - Add Debian installation instructions alongside Ubuntu by [@​jmkim](https://github.com/jmkim) in jesseduffield/lazygit#4501 - fix wording of random tip by [@​dawedawe](https://github.com/dawedawe) in jesseduffield/lazygit#4488 #### New Contributors - [@​jmkim](https://github.com/jmkim) made their first contribution in jesseduffield/lazygit#4501 - [@​SavingFrame](https://github.com/SavingFrame) made their first contribution in jesseduffield/lazygit#4506 - [@​dawedawe](https://github.com/dawedawe) made their first contribution in jesseduffield/lazygit#4488 **Full Changelog**: jesseduffield/lazygit@v0.49.0...v0.50.0 ### [`v0.49.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.49.0) [Compare Source](jesseduffield/lazygit@v0.48.0...v0.49.0) <!-- Release notes generated using configuration in .github/release.yml at v0.49.0 --> #### What's Changed ##### Enhancements 🔥 - Support fish when running shell command by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4350 - Add acme editor preset by [@​rakoo](https://github.com/rakoo) in jesseduffield/lazygit#4360 - Support home and end as alternatives to '<' and '>' by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4396 - Drop the git config cache when getting focus by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4376 - Add a "Content of selected file" entry to the copy menu for commit files by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4341 - Add root node in file tree by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4346 - \[FEAT] Add Recursive Bulk Initialize and Update for Submodules by [@​cesarandr](https://github.com/cesarandr) in jesseduffield/lazygit#4259 - Commit without pre-commit hooks action is independent on prefix by [@​kschweiger](https://github.com/kschweiger) in jesseduffield/lazygit#4374 - Let users define custom icons and color for files on the config file by [@​hasecilu](https://github.com/hasecilu) in jesseduffield/lazygit#4395 - Add "Absolute path" item to the file view's copy menu by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4410 - Allow range drop stashes by [@​gaogao-qwq](https://github.com/gaogao-qwq) in jesseduffield/lazygit#4451 - More navigation keybindings for confirmation panel by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4404 - Resolve non-inline merge conflicts by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4431 - Add `runCommand` function to Go template syntax + add support for templates in git `branchPrefix` setting by [@​ruudk](https://github.com/ruudk) in jesseduffield/lazygit#4438 - Show "(hooks disabled)" in title bar of commit message editor by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4467 - Add a command to select all commits of the current branch by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4448 ##### Fixes 🔧 - Use a waiting status for rewording a non-head commit by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4343 - Fix layout of options view for non-english languages by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4359 - Fix changing language while lazygit is running by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4361 - URL encode gitlab brackets to make consistent with branch names by [@​ChrisMcD1](https://github.com/ChrisMcD1) in jesseduffield/lazygit#4336 - Fix commitPrefix setting with empty pattern by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4381 - Commit only tracked files in tracked filter view by [@​parthokunda](https://github.com/parthokunda) in jesseduffield/lazygit#4386 - Revert [#​4313](jesseduffield/lazygit#4313) (Skip post-checkout hook when discarding changes) by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4407 - Enhance support for GPG signed tags by [@​ChrisMcD1](https://github.com/ChrisMcD1) in jesseduffield/lazygit#4394 - Fix checking out a file from a range selection of commits by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4423 - Fix discarding submodule changes in nested folders by [@​brandondong](https://github.com/brandondong) in jesseduffield/lazygit#4317 - Better support for shell aliases by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4385 - Fix hyperlinks in last line of confirmation popups by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4454 - Fix wrong main view content after pressing `e` in a stack of branches by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4450 - fix: update vscode color to logo color by [@​PeterCardenas](https://github.com/PeterCardenas) in jesseduffield/lazygit#4459 - Fix crash with drag selecting and staging by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4480 - Escape special characters in filenames when git-ignoring files by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4475 ##### Maintenance ⚙️ - Fix linter warnings by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4352 - Fix release schedule again by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4364 - Update to go 1.24 by [@​radsaq](https://github.com/radsaq) in jesseduffield/lazygit#4377 - Add an integration test for a config with a negative refspec by [@​radsaq](https://github.com/radsaq) in jesseduffield/lazygit#4382 - Specify a go release minor version by [@​radsaq](https://github.com/radsaq) in jesseduffield/lazygit#4393 - Fix flaky integration test by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4432 - Some code cleanup by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4449 - Bump the minimum required git version to 2.22 by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4439 - Bump go-git, and get rid of github.com/imdario/mergo by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4460 - Skip date check when release worfklow is manually invoked by [@​jesseduffield](https://github.com/jesseduffield) in jesseduffield/lazygit#4484 ##### Docs 📖 - Include empty arrays and maps in config docs by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4413 - Filter out deprecated user config fields from generated Config.md by [@​karimkhaleel](https://github.com/karimkhaleel) in jesseduffield/lazygit#4416 - Corrected interactive rebase keybind example in README.md by [@​NewtonChutney](https://github.com/NewtonChutney) in jesseduffield/lazygit#4426 - Update kidpix link in README to active url by [@​ChrisMcD1](https://github.com/ChrisMcD1) in jesseduffield/lazygit#4425 ##### I18n 🌎 - Update translation files from Crowdin by [@​stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4473 #### New Contributors - [@​rakoo](https://github.com/rakoo) made their first contribution in jesseduffield/lazygit#4360 - [@​radsaq](https://github.com/radsaq) made their first contribution in jesseduffield/lazygit#4377 - [@​cesarandr](https://github.com/cesarandr) made their first contribution in jesseduffield/lazygit#4259 - [@​kschweiger](https://github.com/kschweiger) made their first contribution in jesseduffield/lazygit#4374 - [@​NewtonChutney](https://github.com/NewtonChutney) made their first contribution in jesseduffield/lazygit#4426 - [@​gaogao-qwq](https://github.com/gaogao-qwq) made their first contribution in jesseduffield/lazygit#4451 - [@​ruudk](https://github.com/ruudk) made their first contribution in jesseduffield/lazygit#4438 **Full Changelog**: jesseduffield/lazygit@v0.48.0...v0.49.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4yIiwidXBkYXRlZEluVmVyIjoiNDAuMTEuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
When using gpg signing on tags via the git config
tag.gpgSign=true, it is not possible to do a lightweight tag. You must do an annotated tag (Which is allowed to have an empty description).This PR augments the existing
WithGpgHandlinghelper to allow it to specifically target commit signing and tag signing. It then uses that handler, and creates an annotated tag, when the git config demands tag GPG signing. By default it will launch the tag signing in a new subprocess. This does require that users click an extra<enter>after creating a signed tag, but this is currently the behavior for signed commits, so I don't feel too bad about that. If they want, they can use the LazyGit configuration option ofgit.overrideGpg: trueto promise to LazyGit that they do not need a GPG sub-process (because they reliably already have gpg-agent or similar running in the background). This again matches the current behavior for GPG signed commits.This has no integration test because we don't have the machinery set up in place to set up a GPG key inside of our integration test framework.
Fixes #2955
go generate ./...)