GitSavvy
GitSavvy copied to clipboard
Commit Message Templates
- [ ] add
GitSavvy.sublime-settings
optioncommit_template
that accepts a string - [ ] when set, this string will be used to pre-populate the commit window on new commits
- [ ] user should be able to define tab-stops (similar to how snippets work), so that they can tab between the "fields" that need to be filled out
Maybe we should use git's commit template? loot at setting commit.template
Hey,
I use the "commit_help_extra_file": option to set the commit message that I am supposed to use. However, the commit screen (and the amend commit screen for that matter) ends up showing the GitSavvy's help message anyway.
Is there a way to disable this?
Cheers! Bharath ಭರತ
@divmain It's a very useful feature. In my team we have to add branch name manually to every commit.
A complete hack but the following works to get a jira prefix added to all commits. Install gitsavvy as a git repo as described in readme. edit ~/.config/sublime-text-3/Packages/GitSavvy-master/core/commands/commit.py
line 26, add a default prefix/marker
COMMIT_HELP_TEXT = """JIRA-1234
line 133, add move cursor to end of prefix
self.view.run_command("gs_replace_view_text", {
"text": initial_text,
"nuke_cursors": True
})
self.view.run_command("move_to", {"to": "eol"})
There does not seem to be a way to force a reload of the plugin without a restart so make a simple bash function to set the current task id you are working on and restart sublime.
function git_template {
sed -i -e "s/JIRA-[[:digit:]]*.*/JIRA-$1 /" ~/.gitmessage
sed -i -e "s/JIRA-[[:digit:]]*.*/JIRA-$1 /" ~/.config/sublime-text-3/Packages/GitSavvy-master/core/commands/commit.py
kill $(pgrep sublime -U <user>)
subl &
}
Now simply run git_template 5678
and enjoy :-)