8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for git-who.
git-who
I have this script:
#!/bin/zsh DIR="${1:-$PWD}" if [[ -z "$(get_top_level $DIR)" ]]; then echo "$DIR is not in a Git repository" else BRANCHES="$(git -C $DIR branch --all --sort=committerdate | sed 's/* //g' | sed 's/ //g' | grep --invert-match remote)" BRANCH="$(echo $BRANCHES | fzf --prompt 'Select branch:')" BASENAME="$DIR:t" PARENT="$DIR:h" SUBDIRECTORIES="$(fd --type directory --max-depth 1 --base-directory $PWD)" DIRECTORIES=".\n$SUBDIRECTORIES" DIRECTORY="$(echo $DIRECTORIES | fzf --prompt 'Select directory:')" echo "$fg_bold[yellow]$fg_bold[green] $BRANCH" echo "$fg_bold[yellow]$fg_bold[green] $PWD/$DIRECTORY" | sed 's/\/Users\//~/g' | sed 's/\/\.$//g' echo "$reset_color" git who $BRANCH -l -- $DIRECTORY fi
It produces this result:
It looks pretty good, but it also makes me wonder whether you have considered adding options for colourising the borders, columns, headers, etc...?
The text was updated successfully, but these errors were encountered:
(I just fixed sed 's/\/Users\//~/g' in my own copy of the script but I won't post a new screenshot.)
sed 's/\/Users\//~/g'
Sorry, something went wrong.
A better version, in case anyone finds it handy
#!/bin/zsh DIR="${1:-$PWD}" TOP_LEVEL="$(get_top_level $DIR)" if [[ -z "$TOP_LEVEL" ]]; then echo "$DIR is not in a Git repository" else BRANCHES="$(git -C $TOP_LEVEL branch --all --sort=committerdate | sed 's/* //g' | sed 's/ //g' | grep --invert-match remote)" BRANCH="$(echo $BRANCHES | fzf --prompt 'Select branch:')" BASENAME="$TOP_LEVEL:t" PARENT="$TOP_LEVEL:h" SUBDIRECTORIES="$(fd --type directory --max-depth 2 --base-directory $TOP_LEVEL)" DIRECTORIES=".\n$SUBDIRECTORIES" DIRECTORY="$(echo $DIRECTORIES | fzf --prompt 'Select directory:')" echo "$fg_bold[yellow]$fg_bold[green] $BRANCH" echo "$fg_bold[yellow]$fg_bold[green] $TOP_LEVEL/$DIRECTORY" | sed 's/\/Users\/steven/~/g' | sed 's/\/\.$//g' echo "$reset_color" if [[ "$DIRECTORY" == "." ]]; then git -C "$TOP_LEVEL" who $BRANCH -l else git -C "$TOP_LEVEL" who $BRANCH -l -- $DIRECTORY fi fi
No branches or pull requests
Thanks for
git-who
.I have this script:
It produces this result:
It looks pretty good, but it also makes me wonder whether you have considered adding options for colourising the borders, columns, headers, etc...?
The text was updated successfully, but these errors were encountered: