Skip to content

Commit trailer support #1418

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

Closed
matthiasbeyer opened this issue Nov 2, 2022 · 6 comments
Closed

Commit trailer support #1418

matthiasbeyer opened this issue Nov 2, 2022 · 6 comments
Labels
dormant Marked by stale bot on close feature-request

Comments

@matthiasbeyer
Copy link

Is your feature request related to a problem? Please describe.

A lot of projects require trailers, for example the Signed-off-by trailer.

Right now I do not see a way to make gitui commit with these trailers enabled.

Describe the solution you'd like

Trailers are in fact a complicated topic, because there are quite a few of them (it is a pseudo-standard) and they are structured data.

FWIW What I'd like to see would be a way to tell gitui to always add a Signed-off-by trailer with my name <email> as value, but also an option to add other trailers.

And here comes the problem. For example, a Co-authored-by trailer would be nice, but typing the value (some name and email address) is tedious. Especially if one has to do it all the time. What I could think of, though, would be this:

  • I open the editor to add a commit
  • I type my commit message
  • I hit some key combination for adding my signed-off-by (for example ctrl-s)
  • I hit another key combination for another trailer (for example ctrl-t)
  • I type coa to get the fuzzy completion for the Co-authored-by: trailer key
  • gitui provides a (fuzzy) selection-list that is filled from the authors in the git repository at hand (think git log --format="%an <%ae>" | sort -u | fzf). Then, I would type "BenB" and get fuzzy-completed the Benjamin Blümchen <[email protected]> author and hit Enter to confirm and gitui adds that trailer
  • I can repeat the above three points until satisfied

Because data for git-trailers can not necessarily be found from the git repository itself, I would even like to see some integration for running some external script for fetching the values for the interactive trailer-value selection!

Describe alternatives you've considered

The alternative I see right now is spawning the $EDITOR (in my case vim) which has been configured to provide these interactive completions for git trailers and type my commit message there.

@extrawurst
Copy link
Collaborator

Can you point me to how other UI tools for git handle this? This is yet again a crazy complex feature in never used in git :D

@matthiasbeyer
Copy link
Author

matthiasbeyer commented Nov 3, 2022

To be honest, gitui is my first attempt in using something that is not native git, apart maybe from vim-fugitive (vim plugin for git). FWIW I think tig does not support this, but I may be mistaken. GUI Tools like IntelliJ have a special knob in their commit interface to enable the signed off by line for a single commit. For other trailers, I don't know!

More rationale Thing is, that the `Signed-off-by` trailer is mission critical for a _lot_ of open source projects. Commits _have_ to be signed off in almost all open source projects I contribute to, because of the [developers certificate](https://developercertificate.org/) (some [rationale](https://drewdevault.com/2021/04/12/DCO.html)). Commits without that trailer are automatically rejected by CI in these projects, because they could lead to legal issues.

Needing to type out "Signed-off-by: My Name [email protected]" all the time is just not bearable. Having a -s in my git commit call is a no-brainer (and actually muscle memory for me by now). It should be as easy as that little -s in gitui IMO.

@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label May 21, 2023
@matthiasbeyer
Copy link
Author

Still relevant.

@stale stale bot removed the dormant Marked by stale bot on close label May 21, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label Dec 15, 2023
@extrawurst
Copy link
Collaborator

#1758 added support for sign-off. lets open another more specific issue for any other relevant trailer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dormant Marked by stale bot on close feature-request
Projects
None yet
Development

No branches or pull requests

2 participants