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

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

Open
5 of 10 tasks
Dentrax opened this issue Oct 21, 2022 · 6 comments
Open
5 of 10 tasks

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

Dentrax opened this issue Oct 21, 2022 · 6 comments

Comments

@Dentrax
Copy link

Dentrax commented Oct 21, 2022

Check list

  • I have read through the README
  • I have the latest version of forgit
  • I have searched through the existing issues

Environment info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Others:
  • Shell
    • bash
    • zsh
    • fish

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}'
}
  • $ git push $(fzfgr) $(fzfgb)
  • $ git pull $(fzfgr) $(fzfgb)

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

@carlfriedrich
Copy link
Collaborator

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

@wfxr @cjappl What do you think?

@wfxr
Copy link
Owner

wfxr commented Oct 24, 2022

@carlfriedrich Have the same opinion as you.

@cjappl
Copy link
Collaborator

cjappl commented Oct 24, 2022 via email

@carlfriedrich
Copy link
Collaborator

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

@cjappl
Copy link
Collaborator

cjappl commented Mar 16, 2023

Pinging @Dentrax

@Dentrax
Copy link
Author

Dentrax commented Mar 16, 2023

Pong! @cjappl

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants