Last active
June 24, 2024 10:55
Revisions
-
inspector71 revised this gist
Jun 24, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[30;47m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[37m\]\H\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[35m\]\w\[\e[m\] \[\e[36m\]\`parse_git_branch\`\[\e[m\] \[\e[35m\]/\[\e[m\]\[\e[33m\]:\[\e[m\] " -
inspector71 renamed this gist
Mar 4, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[30;47m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[37m\]\h\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[35m\]\w\[\e[m\] \[\e[36m\]\`parse_git_branch\`\[\e[m\] \[\e[35m\]/\[\e[m\]\[\e[33m\]:\[\e[m\] " -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[30;47m\]\u\[\e[m\]@\[\e[36m\]\h\[\e[m\]\[\e[37m\]:\[\e[m\]\[\e[35m\]\w\[\e[m\] \[\e[36;40m\]\`parse_git_branch\`\[\e[m\]:\[\e[33m\]/\[\e[m\] " -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[30;47m\]\u\[\e[m\]@\[\e[36m\]\h\[\e[m\]\[\e[37m\]:\[\e[m\]\[\e[35m\]\w\[\e[m\] \[\e[36;45m\]\`parse_git_branch\`\[\e[m\]:\[\e[33m\]/\[\e[m\] " -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[30;47m\]\u\[\e[m\]@\[\e[36m\]\h\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[36;45m\]\`parse_git_branch\`\[\e[m\]\[\e[33m\]/\[\e[m\] " -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # Thanks to http://ezprompt.net/ # get current branch in git repo function parse_git_branch() { BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` @@ -45,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[35;44m\]\u\[\e[m\]@\[\e[42m\]\h\[\e[m\]:\[\e[35m\]\w\[\e[m\] \[\e[36m\]\`parse_git_branch\`\[\e[m\] \[\e[33m\]/\[\e[m\] " -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ # get current branch in git repo function parse_git_branch() { BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` @@ -46,4 +45,4 @@ function parse_git_dirty { fi } export PS1="\[\e[35;44m\]\u\[\e[m\]@\h-\w\[\e[36m\]\`parse_git_branch\`\[\e[m\]/: " -
inspector71 revised this gist
Sep 24, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ function parse_git_dirty { fi } export PS1="\[\e[35;44m\]\u\[\e[m\]@\h-\H:\w\[\e[36m\]\`parse_git_branch\`\[\e[m\]/ " -
inspector71 created this gist
Sep 24, 2017 .There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ # Thanks to http://ezprompt.net/ # get current branch in git repo function parse_git_branch() { BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` if [ ! "${BRANCH}" == "" ] then STAT=`parse_git_dirty` echo "[${BRANCH}${STAT}]" else echo "" fi } # get current status of git repo function parse_git_dirty { status=`git status 2>&1 | tee` dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"` untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"` ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"` newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"` renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"` deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"` bits='' if [ "${renamed}" == "0" ]; then bits=">${bits}" fi if [ "${ahead}" == "0" ]; then bits="*${bits}" fi if [ "${newfile}" == "0" ]; then bits="+${bits}" fi if [ "${untracked}" == "0" ]; then bits="?${bits}" fi if [ "${deleted}" == "0" ]; then bits="x${bits}" fi if [ "${dirty}" == "0" ]; then bits="!${bits}" fi if [ ! "${bits}" == "" ]; then echo " ${bits}" else echo "" fi } export PS1="\[\e[35;44m\]\u\[\e[m\]@\H:\w[\`parse_git_branch\`]\\$ "