-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
[BUG] temporary file for cog commit -e
should have fixed extension
#334
Comments
git commit
should have fixed extensioncog commit -e
should have fixed extension
That's definitely worth fixing, please go ahead and make a PR ! |
Thank you. I can attempt fixing this over the weekend. In the meantime, what do you think the new format for the file name should be? |
No need for a custom filename, cocogitto/src/bin/cog/commit.rs Lines 32 to 37 in 891d55b
Instead we should use Also a nice addition would be to generate a git like commit message template containing the current changes:
|
Yes, I was indeed asking myself why As for your second point, leaving the |
Describe the bug
The temporary file that
cog commit -e
opens in order to compose a new commit message should have a fixed extension so that it can be associated with a file format in a text editor.My text editor of choice is neovim and whenever I run
git commit
normally, it knows how to enable the correct syntax highlighting and a few extra custom options by virtue of the fact the file being edited isCOMMIT_MSG
.This does not happen when I run
cog commit -e
because the filecocogitto
opens under the hood is a temporary file with a name such as.tmpGjG8hc
. That doesn't mean anything for my text editor, nor does it have a useful extension I can associate with a Git commit message file type.Right now all I can do is run
:setfiletype gitcommit
whenever a new temporary buffer opens up, which is not ideal.If you agree that this is something worth fixing, I can attempt a PR!
The text was updated successfully, but these errors were encountered: