Skip to content

Commit trailer support #1418

@matthiasbeyer

Description

@matthiasbeyer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions