Last active
February 26, 2018 08:31
-
-
Save sirolf2009/238086e0797854eb8bc8d977285c8e69 to your computer and use it in GitHub Desktop.
fish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function commit | |
git status | |
git add --all | |
read commit_msg | |
git commit -m $commit_msg | |
git push | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_right_prompt --description 'Write out the right prompt, as the latest git commit author and message' | |
set -l is_git_repository (git rev-parse --is-inside-work-tree ^/dev/null) | |
if test -n "$is_git_repository" | |
set -l commit_message (git log -1 --pretty=%B) | |
set -l commit_author (git log -1 | sed -n 2p | sed '0,/Author: /{s/Author: //}') | |
echo -n "$commit_author $commit_message" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment