bigh / git-fuzzy Goto Github PK
View Code? Open in Web Editor NEWinteractive `git` with the help of `fzf`
License: MIT License
interactive `git` with the help of `fzf`
License: MIT License
Currently it looks like a FZF_DEFAULT_OPTS
string is built up from scratch here:
Lines 3 to 15 in 2f5aa9b
Would it be possible to incorporate existing configuration here, or is there too much of a risk of conflicts? In my case, I want the --color=light
flag to propagate (dark mode fzf looks bad in a light terminal).
Thanks!
just wondering if there's native powershell support.
thanks.
I've installed both fzf and git-fuzzy, and I'm attempting to use the git fuzzy branch
command to switch branches within a Git repository.
When I use this command I receive a prompt of the list of branches that I can choose from, however once I use one of the supplied key-bindings to switch branch Alt-B
or Alt-F
, the prompt exits and I still remain on the same branch.
I'm using iTerm, and I've also checked to see if my Alt keys were mapped correctly and they are.
Do you have any ideas as to what could be causing this issue?
Just found this project and I love it so far!
Is it possible to make the diff preview in git fuzzy log
highlight matches the same way git fuzzy diff
does?
Running git fuzzy
on a newly initialized repository fails with the message "not in a git repo", while normal git commands like git status
obviously work fine. Not sure if this is an oversight.
Note: git s
is an alias to git status
~/builds/git-fuzzy-git Δ git s
A .SRCINFO
A PKGBUILD
?? git-fuzzy/
~/builds/git-fuzzy-git ♦ git fuzzy status
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[ERR] not in git repo
?=1
On another note, I just submitted this to the AUR https://aur.archlinux.org/packages/git-fuzzy-git/.
Hi! Is there a way to only use local branches for git fuzzy branch
? I work on a huge project that thousands and thousands of remote branches and it can slow down the command a bit...
I've tried just setting GF_BRANCH_REMOTE_BRANCHES
to "" but that didn't seem to work.
I'm running Arch Linux, pretty up-to-date and fairly standard, running zsh and installed fzf through the community packages.
I had to install bc
as a dependency, which wasn't mentioned anywhere.
Additionally, I cannot run git-fuzzy status
on any of the repositories I have cloned (including this one).
On the repos I have committed in, the following error shows up, and git-fuzzy
returns 1:
fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
On other repos, it just returns 1.
I realize this is a real corner case but the fix seems to be simple.
Context: for my dotfiles I use a bare repository and a shell alias to call git with custom work tree and git dir flags: git --work-tree=$HOME --git-dir=$HOME/src/dotfiles.git $@
.
git-fuzzy
works fine with this except if I set status.relativePaths=false
the diff in the status view is empty when I run it not from my home directory.
I understand it's a complicated setup, hope I explained clearly enough.
This happens because the preview diffs in gf_helper_status_preview_content()
are being done from the current directory, and the paths are from the root of the repository.
I am not sure it is the correct solution but this fixes the problem for me:
diff --git a/lib/modules/status.sh b/lib/modules/status.sh
index 95c8228..c484fdf 100644
--- a/lib/modules/status.sh
+++ b/lib/modules/status.sh
@@ -59,6 +59,7 @@ gf_status_interpreter() {
gf_status() {
gf_snapshot "status"
if [ -n "$(git status -s)" ]; then
+ gf_go_to_git_root_directory
# shellcheck disable=2086
git fuzzy helper status_menu_content | gf_fzf_status | gf_status_interpreter
else
another option would be to change gf_helper_status_preview_content()
to prepend $GIT_DIR
to the file paths.
Great tool, thank you!
https://github.com/wfxr/forgit A similar project that I use day to day, maybe will give some inspiration.
Thank you for this cool tool.
You can add this to the README for fish users:
While, if you're running fish:
git clone https://github.com/bigH/git-fuzzy.git
# add the executable to your path
echo set -x PATH (pwd)/git-fuzzy/bin:{$PATH} >> ~/.config/fish/config.fish
Would be awesome to add fixup as an option to the git commit view. Ability to select which commit (filtered by those that have edited the file(s) in staging) to fixup against.
It'd be easier to use this if it was installable with Homebrew.
Can you submit a formula?
As the title mentions. Exa seems to be abandoned and is now forked to eza
When viewing a commit or a file in a commit (viewed with delta
+ bat
), I couldn't find how to scroll down/up the diff in the right side of the screen (to view more than the first page of the diff). Here's what I intuitively tried:
I'm sure there is a keyboard binding, but I couldn't find it, neither in the tool itself nor in the readme. It would be nice if it was explicitly listed in the top-left summary of the bindings (near∆ working copy Ctrl-P
, ∆ merge-base Alt-P
, etc.)
Thanks for the nifty tool! In particular, lack of delta/diff-so-fancy support in tig makes me like git-fuzzy 🙂.
Almost every command in git fuzzy
results in the following error when first installed:
fatal: ref refs/remotes/origin/HEAD is not a symbolic ref
Upon reviewing the README, I realized that this is configurable using an environment variable.
Using an environment variable requires this change to be made within the shell (or .bashrc
, for example), and makes it very difficult to have it set differently for different repos.
I suggest instead using a git config value.
E.g.:
git config gf.remote upstream
git config gf.branch main
This allows you to have a single global value set, and then override it on a repo-specific basis. Additionaly, it keeps git
configuration within git
, rather than having it within the shell.
I want to find file change log by git log, bug git commit message was so simple and short, I like fzf , but I have not find any way to solute it. I think somebody also like this feature.
git-fuzzy/lib/modules/branch.sh
Line 20 in ecdcd15
I would like to checkout a branch also when there are unversioned files (and sometimes even when there are modified ones), with possible rejection at git level.
Thanks for useful tool!
I've made my own colorblind colorscheme for the terminal. It's still a work in progress.
As it is, my black and white colors are identical to my default background and foreground colors respectively. I could possibly change this so that the black or the white or both are instead a variation of gray. But I can't set any more colors (including grayscale) because I can't differentiate between them.
In other words, I could possibly gain one more color definition (gray), but that's it.
Any solutions to this? Would be nice to customize the colors from within the app.
Hi,
PR #16 make it possible to override key bindings for various commands like "diff to merge base", "view log" or "diff to working copy" in a fuzzy finder screens.
However, key binding is now defined with an uppercase letter, e.g. Ctrl-P
, Alt-P
. IMO, it seems like fzf --bind
expects those mappings to be defined in lowercase, like alt-p
.
GIT_FUZZY_BRANCH_WORKING_COPY_KEY=${GIT_FUZZY_BRANCH_WORKING_COPY_KEY:-Ctrl-P}
GIT_FUZZY_BRANCH_MERGE_BASE_KEY=${GIT_FUZZY_BRANCH_MERGE_BASE_KEY:-Alt-P}
So the issue is, unless I manually override those environment variables like this with all chars in lowercase, mappings do not work.
export GIT_FUZZY_BRANCH_WORKING_COPY_KEY="ctrl-p"
export GIT_FUZZY_BRANCH_MERGE_BASE_KEY="alt-p"
Regarding local environment I have:
# fzf v0.25.0 (8c533e3)
# zsh 5.8 (x86_64-apple-darwin19.6.0)
# tmux 3.1c
# iTerm2 3.3.7
# MacOS Catalina 10.15.7
Thank you for your amazing work.
I have a problem when I run git fuzzy diff
or git fuzzy log
. The preview diff window is not showing up as it appears in the presentation. delta
is installed and exported GF_PREFERRED_PAGER
to use it. The rest works fine; just the preview diff window is not showing up.
With debug enabled, this is the output:
$ git fuzzy diff
[DBG] `hub` not found, disabling GitHub support.
[CMD] (internal) $ gf_diff_direct
[CMD] $ fzf --ansi --no-sort --no-info --multi --bind "alt-d:deselect-all" --bind "alt-a:select-all" --preview-window=right:59% -m --phony --header-lines=2 --header $'\n Query above is with these args \'\E[35m-G query\E[m\017\'\n\n' --preview git\ fuzzy\ helper\ diff_direct_preview_content\ \{q\}\ \{\}\ --bind change:reload\(git\ fuzzy\ helper\ diff_direct_menu_content\ \{q\}\ \)
[CMD] (internal) $ gf_helper_diff_direct_menu_content ''
Using:
$ zsh --version
zsh 5.8.0.2-dev (x86_64-pc-linux-gnu)
$ fzf --version
0.27.2 (e086f0b)
$ delta --version
delta 0.8.3
$ export GF_PREFERRED_PAGER="delta --highlight-removed -w __WIDTH__"
Please, let me know if I can provide more information
It would be really cool to be able to stage hunks (parts of a diff) indepedently, simliar to the workflow exposed by git add -p
.
Hey there, I really like working with git fuzzy
for some days now :)
I just tried to work with stashes and saw that there is only the drop
command available so far. It would be awesome to have pop
for example as well. wdyt?
If this is a good idea, I would be happy to dive into this project and try to contribute it. Although it might take a while for me to get around shell scripting.
Good work!
I suggest not overriding Ctrl-P
as it us usually used along with Ctrl-N
to go Up and Down respectively.
Relates to #7
Git provides comprehensive documentation in man form. Same goes with various external git tools, for example https://github.com/tj/git-extras and https://github.com/arzzen/git-quick-stats.
Please add man page for git-fuzzy too.
The help section is very helpful and beautiful :) However it takes so much space that in an IDE integrated terminal, I often did not see the list below.
Would it be possible to add a setting to hide it and maybe a shortcut to toggle it ? Also, an idea is to make it visible on terminal with the height bigger than a size to define ?
The same for the git command. I am not sure it is very helpful on a daily basis for every body. Maybe it would be worth making it visible as a setting (even debug ?) or shortcut.
Any time git command output is used in preview or listing, there is a header with the command run (useful for copy-pasting or just knowing what's happening). You can optionally enable debugging switches to see other commands being run in the background or how commands are routed.
The copy/paste use case is a bit broken because one will miss all the parameters passed through variable like GF_LOG_MENU_PARAMS
Would be great in fuzzy status
to have a short cut to git amend
(I like commit --amend --reuse-message=HEAD
) the current selection.
Hello, I will like to have a way to define my own key binding, since I'm on MacOS, we don't have the ALT key. So the current key mapping doesn't work.
BTW, very good tool, thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.