diff options
Diffstat (limited to 'pairing.zsh')
-rw-r--r-- | pairing.zsh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pairing.zsh b/pairing.zsh new file mode 100644 index 0000000..73dad38 --- /dev/null +++ b/pairing.zsh @@ -0,0 +1,23 @@ +# The following functions help me put git author information into a file, later +# loaded when committing (e.g git commit --template .git-commit-authors.txt) +export GIT_AUTHORS_FILE=".git-commit-authors.txt" + +function find_author () { + cat $DOTFILES_PATH/git-authors.txt | fzy +} + +function add_author () { + echo "Co-authored-by: $(find_author)" >> $GIT_AUTHORS_FILE +} + +function show_authors () { + cat $GIT_AUTHORS_FILE +} + +function clear_authors () { + rm $GIT_AUTHORS_FILE +} + +function pair_commit () { + git commit -t $GIT_AUTHORS_FILE +} |