thefuck: No longer works with an alias to “git push”

Hi,

I recently installed a new system, but kept my old oh-my-zsh aliases. Before, I could type gp (alias for git push), and use thefuck to do the gp --set-upstream origin branchname for me. However, now the suggestion is gyp:

 dev-ipfs@particle  ~/rust-multiaddr   fix-protocol-codes  gp
fatal: The current branch fix-protocol-codes has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin fix-protocol-codes

 ✘ dev-ipfs@particle  ~/rust-multiaddr   fix-protocol-codes  f
gyp [enter/↑/↓/ctrl+c]

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 6
  • Comments: 25 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@scorphus Thanks, that fixed it!

You were right, I had an old alias fuck='eval $(thefuck $(fc -ln -1)); history -r' in my .zshrc, replacing that with eval $(thefuck --alias) gives this:

94% [hugo:~] 1 % which fuck
fuck () {
	TF_PREVIOUS=$(fc -ln -1 | tail -n 1)
	TF_CMD=$( TF_ALIAS=fuck TF_SHELL_ALIASES=$(alias) PYTHONIOENCODING=utf-8 thefuck $TF_PREVIOUS THEFUCK_ARGUMENT_PLACEHOLDER $* )  && eval $TF_CMD
	test -n "$TF_CMD" && print -s $TF_CMD
}
⌂71% [hugo:~/github/test] delete-me3 ± gp
fatal: The current branch delete-me3 has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin delete-me3

⌂71% [hugo:~/github/test] delete-me3 128 ± fuck
git push --set-upstream origin delete-me3 [enter/↑/↓/ctrl+c]
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/hugovk/test
 * [new branch]      delete-me3 -> delete-me3
Branch 'delete-me3' set up to track remote branch 'delete-me3' from 'origin'.

Just tried out today, and seems fixed with 3.25 AFAIC this issue can be closed