Skip to content

Amend commit attribute enhancements #4504

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

Open
VoxelPrismatic opened this issue Apr 22, 2025 · 0 comments
Open

Amend commit attribute enhancements #4504

VoxelPrismatic opened this issue Apr 22, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@VoxelPrismatic
Copy link

Is your feature request related to a problem? Please describe.
I don't like typing Signed-off-by or any other user-related trailers

Describe the solution you'd like
This menu should also feature other trailers, like Signed-off-by, Reviewed-by or any other trailers featured in previous commits

Image

Describe alternatives you've considered
I made my own custom command, but it doesn't work on previous commits.

Additional context
Add any other context or screenshots about the feature request here.

Custom command:

customCommands:
  - key: "<c-a>"
    context: "files"
    command: "git commit --amend --trailer {{ .Form.Trailer | quote }}:{{ .Form.Author | quote }} --only -m {{ runCommand \"git --no-pager log --pretty=%B -n 1\" | quote }}"
    prompts:
      - type: "input"
        title: "Key"
        key: "Trailer"
        suggestions:
          command: |
            (git log --pretty=%B | grep -E '^[A-Z][A-Za-z-]+: .*<.*@.*>' | awk -F: '{print $1}'; echo -e 'Signed-off-by\nCo-authored-by\nReviewed-by\nHelped-by') | sort -u
      - type: "input"
        title: "User"
        key: "Author"
        initialValue: "{{ runCommand \"git config user.name\" }} <{{ runCommand \"git config user.email\" }}>"
        suggestions:
          preset: "authors"
  1. Get all trailer tags, including a few handy defaults:
    • Signed-off-by
    • Co-authored-by
    • Reviewed-by
    • Helped-by
  2. Ask for the user, defaulting to the user's config
  3. Append trailer

Optional:

  1. Detect conflicts and ask if the user wants to append or override; or
  2. Provide a menu asking which trailer the user wishes to delete or modify, or add a new trailer.
@VoxelPrismatic VoxelPrismatic added the enhancement New feature or request label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant