Skip to content
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

Templates doesn't insert filenames #658

Closed
redactedscribe opened this issue Nov 4, 2023 · 8 comments · Fixed by #667
Closed

Templates doesn't insert filenames #658

redactedscribe opened this issue Nov 4, 2023 · 8 comments · Fixed by #667

Comments

@redactedscribe
Copy link

redactedscribe commented Nov 4, 2023

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

@Murmele
Copy link
Owner

Murmele commented Nov 12, 2023

image

For me it works fine. Did you stage? It uses as files the filenames of the staged section

@redactedscribe
Copy link
Author

redactedscribe commented Nov 12, 2023

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.

@Murmele
Copy link
Owner

Murmele commented Nov 12, 2023

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?

@redactedscribe
Copy link
Author

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.

@Murmele
Copy link
Owner

Murmele commented Nov 12, 2023

Ah now I understand, you choose it manually not automatically. I was able to reproduce

@Murmele
Copy link
Owner

Murmele commented Nov 12, 2023

image

No files are passed when doing it manually. I have to check

@Murmele
Copy link
Owner

Murmele commented Nov 12, 2023

This will fix your issue:

#667

@redactedscribe
Copy link
Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants