Skip to content

Feature request & BUG report: auto add filenames of all staged files #51

@marridG

Description

@marridG

Hi~
Is it possible to include filenames of all staged files in the commit message?

What I've tried

  1. read related issue: Feature request: preview of file list #8 (reply)
  2. tried the following config
{
    "vscodeGitCommit.variables": {

        "prefix": "keke",
        "files.add": "files",
        "files.edit": "files.staged.modified",
        "files.del": "files.staged.deleted",
    },
    "vscodeGitCommit.template": [
        "{prefix}: {message}",
        "- [ADDED] {files.add}",
        "- [EDITED] {files.edit}",
        "- [RMVED] {files.del}"
    ],
}

with files:

  • .env.prod: added and staged
  • manual.service.ts, create-asset-profile-dialog.componenr.ts: modified and stage
  • another one modified but NOT staged

Expected behaviour

  1. with some new macros ("files.add": "<some.new.macro>"), after entering {message} and pressing ENTER, filenames concatnated with ", " are auto generated for variable files.add, files.edit, files.del
  2. final output may be like:
<icon> feature: a sample output
- [ADDED] .env.prod
- [EDITED] manual.service.ts, create-asset-profile-dialog.componenr.ts
- [RMVED]

Why it fails

  1. "files.edit": "files.staged.modified" does NOT show filenames on the "drop-down". The number of elements is INCORRECT(should be 2, manual.service.ts, create-asset-profile-dialog.componenr.ts, instead of 3).
    Image|400

  2. BTW "files.add": "files" (deliberately not as "files.staged.added" to test) do show filenames. The number is correct (as 4).
    Image|400

  3. when multiple files are edited (and staged), only ONE file can be selected in {files.staged.modified} to fill {files.edit}.

  4. it is not possible to determine the number of added/edited/deleted files beforehand. neither is changing the template everytime

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions