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

Git commit template only loaded when VSC is loaded #39048

Closed
tennisfar opened this issue Nov 23, 2017 · 4 comments
Closed

Git commit template only loaded when VSC is loaded #39048

tennisfar opened this issue Nov 23, 2017 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues verified Verification succeeded

Comments

@tennisfar
Copy link

Tested on:

  • VSCode Version: 1.18.1
  • OS Version: Windows

Steps to Reproduce:

  1. Make sure you have a Git template set up. See this closed issue for more details: Git commit message templates #7830), or simply create a .gitmessage template file with some text in it, and link to it from inside your .gitconfig file, something like this:
[commit]
  template = ~/.gitmessage
  1. Open VSC.
  2. Make a change in your code, open Git sidebar, see the commit message is the same as you've put in .gitmessage.
  3. Modify the content of .gitmessage without closing VSC.
  4. Make another change in your code, close the Git sidebar, play around. Basically do whatever you like except closing VSC.

Problem is.. how to make VSC update the commit message to the latest content in .gitmessage without restarting VSC?

The reason why I'm needing this is that i have a post-checkout git hook that modifies .gitmessage, adding part of the name of the branch I've switched to. If, for example, I switch to a branch named feature/IU-1234-foo-bar, then my template is updated with IU-1234.

It seems like I can only make VSC re-read .gitmessage by restarting VSC.

@vscodebot vscodebot bot added the git GIT issues label Nov 23, 2017
@joaomoreno joaomoreno added this to the Backlog milestone Nov 23, 2017
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Nov 23, 2017
yanyue404 added a commit to yanyue404/fe-attitude that referenced this issue Apr 17, 2018
* - type: feat, fix, docs, style, refactor, test, chore
* - scope: can be empty (eg. if the change is a global or difficult to assign to a single component)
* - subject: start with verb (such as 'change'), 50-character line
test git commit
* body: 72-character wrapped. This should answer:
* * Why was this change necessary?
git commit问题
* * How does it address the problem?
* * Are there any side effects?

* footer:
* - Include a link to the ticket, if any.
* - BREAKING CHANGE
microsoft/vscode#39048
@joaomoreno
Copy link
Member

Added a git.restoreCommitTemplate command which you can invoke to refresh the commit message with the template.

@ramya-rao-a
Copy link
Contributor

@joaomoreno The restore command is not available in the command pallet. I had to assign a keybinding to the command and then invoke it via the keybinding.

Was this intended?

@joaomoreno
Copy link
Member

Yeah, I don't think it's a command worth putting in the command palette. Seems to be very specific for users who actively modify .gitmessage, doesn't happen often.

@octref octref added the verified Verification succeeded label Sep 28, 2018
@tennisfar
Copy link
Author

@joaomoreno Thanks. :)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants