wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.33k stars 136 forks source link

Feature Request: `forgit::pull` and `forgit::push` #244

Open Dentrax opened 1 year ago

Dentrax commented 1 year ago

Check list

Environment info

Problem / Steps to reproduce

I usually like to use forgit for mostly ga and gd commands. Unfortunately, it does not have push and pull commands. I want to interactively select both of remote and branch so that here is what I've been using the fzf command with git combined:

is_in_git_repo() {
  git rev-parse HEAD > /dev/null 2>&1
}

function fzfgb {
  is_in_git_repo &&
    _git_dbg branch -a -vv --color=always | grep -v '/HEAD\s' |
    fzf --height 40% --ansi --multi --tac | sed 's/^..//' | awk '{print $1}' |
    sed 's#^remotes/[^/]*/##'
}

function fzfgr {
  is_in_git_repo &&
    _git_dbg remote -v | awk '{print $1 " " $2}' | uniq |
    fzf --height 40% --tac | awk '{print $1}'
}

Maybe we can make similar or better UX by implementing forgit::push and forgit::pull commands. Wdyt? Waiting your thoughts!

carlfriedrich commented 1 year ago

Hi @Dentrax, thanks for your suggestion. In my opinion this would be a useful extension.

@wfxr @cjappl What do you think?

wfxr commented 1 year ago

@carlfriedrich Have the same opinion as you.

cjappl commented 1 year ago

Works for me!

On Mon, Oct 24, 2022 at 4:59 AM, Wenxuan @.***> wrote:

@.***(https://github.com/carlfriedrich) Have the same opinion as you.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

carlfriedrich commented 1 year ago

Cool! So @Dentrax would you provide a PR for this yourself?

cjappl commented 1 year ago

Pinging @Dentrax

Dentrax commented 1 year ago

Pong! @cjappl

I couldn't find to get into it but if anyone want to submit a PR for this please feel free.