junegunn / fzf-git.sh

bash and zsh key bindings for Git objects, powered by fzf
520 stars 47 forks source link

Hashes from any branch? #36

Closed urob closed 3 months ago

urob commented 4 months ago

Thanks so much for making these tools - fzf has long become an invaluable tool in my daily workflow!

Quick question: Is there a streamlined way to search for hashes from branches that aren't currently checked out? I often find myself doing something along the following lines:

git log [options] <feature_branch>  # manually find commit in <feature_branch>
git cherry-pick <hash>

I am aware that I can pipe the git log <branch> output to fzf and then use sed or awk to get the hash. But this is duplicating much of what _fzf_git_hashes is doing. So I was wondering if there's an easy way to leverage _fzf_git_hashes in its current form? Alternatively, would it be hard to add a binding to _fzf_git_hashes to select a branch and then reload git log for that branch?

junegunn commented 3 months ago

Implemented ALT-A binding to switch to --all mode. Please try it out and let me know what you think.

urob commented 3 months ago

Thanks! That's perfect!