Open rkotze opened 2 years ago
This can be DIY'd with fzf
# in ~/.zshrc or ~/.bashrc
function gmob() {
git mob $(git mob -l | fzf --multi | awk '{print $1;}' | tr '\n' ' ')
}
You can also get really fancy with it:
# in ~/.zshrc or ~/.bashrc
function gmob_fancy() {
git mob $(cat ~/.git-coauthors | jq -r '.coauthors | to_entries[] | .key+" "+.value.name' | fzf --multi --height=10% --preview='git log --author={2..} --color=always' | awk '{print $1;}' | tr '\n' ' ')
}
update Aug 2023:
# in ~/.zshrc or ~/.bashrc
function gmob() {
local selected=$(git mob -l \
| fzf --multi \
--layout=reverse \
--height=11 \
--border=rounded \
--prompt='🦜 Pair with ' \
| awk '{print $1;}' \
| tr '\n' ' ' \
| sed 's/,//g' )
[[ -n "$selected" ]] && git mob $(echo $selected)
}
These are great suggestions.
But I'm thinking this would be helpful for people not familiar with making custom bash functions.
I'm not 100% if this is a valuable feature
Summary
It can be tricky to remember all your co-authors and it could be a better experience if you can have an interactive cli selector.
Motivation
This will reduce the cognitive load to remember your co-author list and reduce the number of commands to run to append co-author data.
Describe alternatives you've considered
Currently, you can run
git mob -l
and then you can run the mob command.Ideas
Maybe Inquirer library can be used to create an interactive select cli command