Skip to content
New issue

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

Make it easier to select co-author to pair with #91

Open
rkotze opened this issue Nov 5, 2022 · 2 comments
Open

Make it easier to select co-author to pair with #91

rkotze opened this issue Nov 5, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rkotze
Copy link
Owner

rkotze commented Nov 5, 2022

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

@rkotze rkotze added enhancement New feature or request help wanted Extra attention is needed labels Nov 5, 2022
@jonsmithers
Copy link
Contributor

jonsmithers commented Jan 17, 2023

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)
}

@rkotze
Copy link
Owner Author

rkotze commented Jan 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants