git-redmine-commit

git commit with redmine issue id. With this tool, you can do a git commit with a redmine issue id. The message of the commit is filled with the title of the issue automatically.

With this tool, you can do a git commit with a redmine issue id. The message of the commit is filled with the title of the issue automatically.

1. Install

gem install git-redmine-commit

2. Usage

git-redmine-commit issue_id [options] -- [git-commit options]
Specify the api key and url. You only need to do it once for each repo.

--redmine-api-key [key]      The api access key to access redmine.
--redmine-url [url]          URL of your redmine.

-h, --help                       Displays this help info
-s, --silent                     commit with default message silently without prompting the message editor

Example:

git-redmine-commit 3125 -s -- -a

Git Alias

[alias]
    rc = "!sh -c 'git-redmine-commit $1 -s -- -a' -"
Then, the exmaple becomes:

run git rc.

git rc 3125

3. Message Template

You can put your own mssage template file under $HOME as

$HOME/.redmine_commit_template

The format of the template file is ERB.
The default template file is like:

" #<%= issue_id %>:<%= issue_subject %> "

4. Extend

The message of the commit is filled with the id, title, project name, assign_to of the issue automatically, please seed https://github.com/atyun/git-redmine-commit

gem 'git-redmine-commit', git: '[email protected]:atyun/git-redmine-commit.git', branch: 'feature/fengbin-20171219-rename'

References

robin/git-redmine-commit: git commit with redmine issue id. With this tool, you can do a git commit with a redmine issue id. The message of the commit is filled with the title of the issue automatically.
https://github.com/robin/git-redmine-commit

git-redmine-commit | RubyGems.org | your community gem host
https://rubygems.org/gems/git-redmine-commit

打赏

Leave a Reply

Your email address will not be published. Required fields are marked *