Closed redactedscribe closed 7 months ago
For me it works fine. Did you stage? It uses as files the filenames of the staged section
Create 2 templates:
tmpl1: chore: %| ${files:1}
tmpl2: chore: %| ${files:2}
Then stage 3 files. Commit message is chore: .gitignore, and 2 more files
.
Select tmpl2. Commit message is now chore:
.
Selecting tmpl1, no change, then tmpl2 again, no change; still chore:
.
The message needs to be manually cleared and a file un/staged to get the commit message to reappear with the filenames listed. But what's inserted is tmpl1's template even though tmpl2 was selected last.
It seems to be broken and unpredictable.
What do you mean
But what's inserted is tmpl1's template even though tmpl2 was selected last.
Did you move tmpl1 as first in the list?
No. I guess that's not how it works then (my expectation was that it would use the last one which I picked). At that point I would have to repick tmpl2, but as noted, currently only chore:
is inserted.
Ah now I understand, you choose it manually not automatically. I was able to reproduce
No files are passed when doing it manually. I have to check
This will fix your issue:
Thank you.
Templates is unintuitive, probably because it's broken.
Selecting one from the list doesn't update the commit message to include the currently staged files: Clicking a "Chore" template with
chore: %| ${files:2}
as its template value will insert "chore: " (no filenames).v1.3.0