git: Add ability to pass --signoff
(#29874)
This adds an option for `--signoff` to the git panel and commit modal. It allows users to enable the [`--signoff` flag](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt-code--signoffcode) when committing through Zed. The option is added to the context menu of the commit button (following the style of the "Editor Controls"). To support this, the commit+amend experience was revamped (following the ideas of [this comment](https://github.com/zed-industries/zed/pull/29874#issuecomment-2950848000)). Amending is now also a toggle in the commit button's dropdown menu. I've kept some of the original experience such as the changed button text and ability to cancel outside the context menu. The tooltip of the commit buttons now also includes the flags that will be used based on the amending and signoff status (which I couldn't capture in screenshots unfortunately). So, by default the tooltip will say `git commit` and if you toggle, e.g., amending on it will say `git commit --amend`. | What | Panel | Modal | | --- | --- | --- | | Not amending, dropdown |  |  | | Amending, dropdown |  |  | | Amending |  | - | The initial implementation was based on the changeset of https://github.com/zed-industries/zed/pull/28187. Closes https://github.com/zed-industries/zed/discussions/26114 Release Notes: - Added git `--signoff` support. - Update the git `--amend` experience. - Improved git panel to persist width as well as amend and signoff on a per-workspace basis.
This commit is contained in:
parent
1ce384bbda
commit
1d72fa8e9e
6 changed files with 342 additions and 337 deletions
|
@ -1738,6 +1738,7 @@ impl GitStore {
|
|||
name.zip(email),
|
||||
CommitOptions {
|
||||
amend: options.amend,
|
||||
signoff: options.signoff,
|
||||
},
|
||||
cx,
|
||||
)
|
||||
|
@ -3488,6 +3489,7 @@ impl Repository {
|
|||
email: email.map(String::from),
|
||||
options: Some(proto::commit::CommitOptions {
|
||||
amend: options.amend,
|
||||
signoff: options.signoff,
|
||||
}),
|
||||
})
|
||||
.await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue