Add "Signed-off-by" trailer option to commit options menu#21741
Merged
niik merged 3 commits intodevelopmentfrom Mar 10, 2026
Merged
Add "Signed-off-by" trailer option to commit options menu#21741niik merged 3 commits intodevelopmentfrom
niik merged 3 commits intodevelopmentfrom
Conversation
Co-authored-by: niik <634063+niik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enable --signoff option for commits in GitHub Desktop
Add "Signed-off-by" trailer option to commit options menu
Mar 5, 2026
niik
requested changes
Mar 5, 2026
|
|
||
| private get isCommitOptionsButtonEnabled() { | ||
| return enableHooksEnvironment() && this.props.hasCommitHooks | ||
| return enableHooksEnvironment() |
Member
There was a problem hiding this comment.
@copilot This would always be enabled now right? We could just remove the isCommitOptionsButtonEnabled but we have to conditionalize whether the "Bypass commit hooks" context menu item is visible depending on whether enableHooksEnvironment is true AND hasCommitHooks
Contributor
Author
There was a problem hiding this comment.
Done in 75fd4cd. Removed isCommitOptionsButtonEnabled entirely (and the now-redundant isActionBarEnabled getter). The button is rendered unconditionally, and the "Bypass Commit hooks" item is now conditionally pushed into the menu array only when enableHooksEnvironment() && this.props.hasCommitHooks.
…show button unconditionally, conditionalize Bypass Commit Hooks menu item on hooks environment and hasCommitHooks Co-authored-by: niik <634063+niik@users.noreply.github.com>
niik
approved these changes
Mar 6, 2026
sergiou87
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many open source projects require Developer Certificate of Origin (DCO) sign-off on commits. GitHub Desktop had no way to add
Signed-off-bytrailers without amending via CLI or manually inserting the line.Description
Adds a "Add Signed-off-by trailer" toggle to the commit options (gear) menu. When enabled for a repository, commits are passed
--signoff, appendingSigned-off-by: Name <email>from the user's git identity. The option is per-repository and resets on app restart (matching theskipCommitHooksbehavior and git's own stance on not supporting a config option for this).app-state.ts: AddedsignOffCommits: booleantoIRepositoryState; expandedCommitOptionstoPick<IRepositoryState, 'skipCommitHooks' | 'signOffCommits'>repository-state-cache.ts: DefaultsignOffCommits: falsecommit.ts: AddedsignOff?: booleantocreateCommitoptions → appends--signoffto git argsapp-store.ts: PassessignOff: state.signOffCommitsintocreateCommitcommit-message.tsx: AddedsignOffCommitsprop; new checkbox menu item in commit options context menu; removedisCommitOptionsButtonEnabled(was gated onhasCommitHooks) — the button is now always rendered since the sign-off option is always available; the "Bypass Commit hooks" menu item is conditionally shown only whenenableHooksEnvironment() && hasCommitHooks; gear icon losesdefault-optionsstyling when either option is activesidebar.tsx,repository.tsx,filter-changes-list.tsx,app.tsx,commit-message-dialog.tsx) updated to propagate the new propScreenshots
Commit options menu with the new toggle:
Release notes
Notes: [Added] Add option to include a Signed-off-by trailer on commits for Developer Certificate of Origin workflows
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.