git-redmine-commit 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ Specify the api key and url. You only need to do it once for each repo.
19
19
  -h, --help Displays this help info
20
20
 
21
21
  Example:
22
- git-redmine-commit 3125 -- -a
22
+ git-redmine-commit 3125 -s -- -a
23
23
 
24
24
  === Message Template
25
25
 
@@ -29,7 +29,7 @@ You can put your own mssage template file under $HOME as
29
29
  The format of the template file is ERB.
30
30
 
31
31
  The default template file is like:
32
- "#<%= issue_id %>:<%= issue_subject %>\n"
32
+ " #<%= issue_id %>:<%= issue_subject %> "
33
33
 
34
34
  == Copyright
35
35
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.1
1
+ 0.8.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{git-redmine-commit}
8
- s.version = "0.8.1"
8
+ s.version = "0.8.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Robin Lu"]
12
- s.date = %q{2012-12-01}
12
+ s.date = %q{2013-03-01}
13
13
  s.default_executable = %q{git-redmine-commit}
14
14
  s.description = %q{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.}
15
15
  s.email = %q{iamawalrus@gmail.com}
@@ -44,10 +44,13 @@ class GitRedmineCommit
44
44
  puts opts
45
45
  exit 0
46
46
  end
47
-
47
+ opts.separator ""
48
+ opts.on("-s", "--silent", "commit with default message silently without prompting the message editor") do
49
+ @options[:silent] = true
50
+ end
48
51
  opts.separator ""
49
52
  opts.separator "Example:"
50
- opts.separator "\t#{File.basename($0)} 3125 -- -a"
53
+ opts.separator "\t#{File.basename($0)} 3125 -s -- -a"
51
54
  end
52
55
 
53
56
  opts.parse!(args)
@@ -80,7 +83,7 @@ class GitRedmineCommit
80
83
  template_src = if File.file?(REDMINECOMMIT_TEMPLATE)
81
84
  open(REDMINECOMMIT_TEMPLATE) {|f| f.read}
82
85
  else
83
- " #<%= issue_id %>:<%= issue_subject %>\n"
86
+ " Fix #<%= issue_id %>:<%= issue_subject %>\n"
84
87
  end
85
88
  ERB.new template_src
86
89
  end
@@ -102,12 +105,16 @@ class GitRedmineCommit
102
105
  temp = Tempfile.new('redmine_commit')
103
106
  temp << title
104
107
  temp.close
105
-
106
- commit_template = `git config --get commit.template`
107
- `git config commit.template #{temp.path}`
108
- system "git commit #{@options[:git_options]}"
109
- system "git config --unset commit.template"
110
- `git config commit.template #{commit_template}` if commit_template && commit_template.size > 0
108
+
109
+ if @options[:silent]
110
+ puts `git commit #{@options[:git_options]} -F #{temp.path}`
111
+ else
112
+ commit_template = `git config --get commit.template`
113
+ `git config commit.template #{temp.path}`
114
+ system "git commit #{@options[:git_options]}"
115
+ system "git config --unset commit.template"
116
+ `git config commit.template #{commit_template}` if commit_template && commit_template.size > 0
117
+ end
111
118
  end
112
119
 
113
120
  def get_config(git_repo)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-redmine-commit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 1
10
- version: 0.8.1
9
+ - 2
10
+ version: 0.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Robin Lu
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-12-01 00:00:00 +08:00
18
+ date: 2013-03-01 00:00:00 +08:00
19
19
  default_executable: git-redmine-commit
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency