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
12 13 14 15 |
# File 'lib/git_coauthor/git.rb', line 12 def self.() `git commit --amend --only --no-verify --message "#{}" 2> /dev/null` $CHILD_STATUS.success? end |
.commit_message(sha) ⇒ Object
7 8 9 10 |
# File 'lib/git_coauthor/git.rb', line 7 def self.(sha) = `git log --format="%B" --max-count=1 #{sha} 2> /dev/null` [$CHILD_STATUS.success?, ] end |
.config_get(key) ⇒ Object
17 18 19 20 |
# File 'lib/git_coauthor/git.rb', line 17 def self.config_get(key) value = `git config #{key} 2> /dev/null`.strip [$CHILD_STATUS.success?, value] end |
.config_set(key, value) ⇒ Object
22 23 24 25 |
# File 'lib/git_coauthor/git.rb', line 22 def self.config_set(key, value) `git config #{key} #{value} 2> /dev/null` $CHILD_STATUS.success? end |
.config_unset(key) ⇒ Object
27 28 29 30 |
# File 'lib/git_coauthor/git.rb', line 27 def self.config_unset(key) `git config --unset #{key} 2> /dev/null` $CHILD_STATUS.success? end |