Class: GitCoauthor::Git
- Inherits:
-
Object
- Object
- GitCoauthor::Git
- Defined in:
- lib/git_coauthor/git.rb
Class Method Summary collapse
- .amend_commit_message(message) ⇒ Object
- .commit_message(sha) ⇒ Object
- .config_get(key) ⇒ Object
- .config_set(key, value) ⇒ Object
- .config_unset(key) ⇒ Object
Class Method Details
.amend_commit_message(message) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/git_coauthor/git.rb', line 13 def self.() Open3.popen2('git commit --amend --only --no-verify --file -') do |stdin, _, wait_thr| stdin.puts() stdin.close wait_thr.value.success? end end |
.commit_message(sha) ⇒ Object
8 9 10 11 |
# File 'lib/git_coauthor/git.rb', line 8 def self.(sha) = `git log --format="%B" --max-count=1 #{sha} 2> /dev/null` [$CHILD_STATUS.success?, ] end |
.config_get(key) ⇒ Object
21 22 23 24 |
# File 'lib/git_coauthor/git.rb', line 21 def self.config_get(key) value = `git config #{key} 2> /dev/null`.strip [$CHILD_STATUS.success?, value] end |
.config_set(key, value) ⇒ Object
26 27 28 29 |
# File 'lib/git_coauthor/git.rb', line 26 def self.config_set(key, value) `git config #{key} #{value} 2> /dev/null` $CHILD_STATUS.success? end |
.config_unset(key) ⇒ Object
31 32 33 34 |
# File 'lib/git_coauthor/git.rb', line 31 def self.config_unset(key) `git config --unset #{key} 2> /dev/null` $CHILD_STATUS.success? end |