Skip to content

Amend commit attribute enhancements #4504

Open
@VoxelPrismatic

Description

@VoxelPrismatic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions