Code Monkey home page Code Monkey logo

git-fuzzy's People

Contributors

bigh avatar chetan avatar chimurai avatar g-s-k avatar hhiranandani-spotnana avatar hirenhiranandani-at avatar hyperupcall avatar iloveitaly avatar jetzerb avatar leighmcculloch avatar marlonrichert avatar mataha avatar sleepybag avatar spywhere avatar viniciussalvati avatar vtimofeenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-fuzzy's Issues

Ignore remote branches when using "git fuzzy branch"

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.

Feature request: staging hunks

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.

fuzzy log highlight matches in preview

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?

Highlight git logs like in the preview

For the command git fuzzy log, the preview shows the commit history with colors.

2021-07-23_18-01 git log highlight

When I do git fuzzy log, the lines are all white. If I run git log --pretty=oneline --abbrev-commit directly in my terminal, then I have colors.

How is it possible to keep the colors or to set up them ?

Make merge base more easily configurable per repo

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.

Amend in status

Would be great in fuzzy status to have a short cut to git amend (I like commit --amend --reuse-message=HEAD) the current selection.

Unreadable colors

20220413_17h03m05s_grim

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.

Add files from folder separately

Hello

I enjoy using this tool but one thing annoys me (when I run git fuzzy status): if there is a new folder with files inside I am not able to:

  1. See what's inside this folder
  2. Add files separately

Here is a screenshot:
Screenshot 2022-04-08 at 5 17 31 PM

It would be awesome if this issue is fixed.
Thanks.

Fails on initialized git repositories without commits

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/.

Feature request: git log --patch fuzzy find

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.

Append to invoking shell's FZF_DEFAULT_OPTS

Currently it looks like a FZF_DEFAULT_OPTS string is built up from scratch here:

git-fuzzy/lib/core.sh

Lines 3 to 15 in 2f5aa9b

export FZF_DEFAULT_OPTS="\
--border \
--layout=reverse \
--bind 'ctrl-space:toggle-preview' \
--bind 'ctrl-j:down' \
--bind 'ctrl-k:up' \
--bind 'ctrl-d:half-page-down' \
--bind 'ctrl-u:half-page-up' \
--bind 'ctrl-s:toggle-sort' \
--bind 'ctrl-e:preview-down' \
--bind 'ctrl-y:preview-up' \
--bind 'change:top' \
--no-height"

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!

Allow custom key bindinding

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!

Status does not display diffs when relativePaths=false

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!

Missing dependency and fatal error

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.

Feature request: Add more commands to stash

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.

Default key bindings having uppercase letter do not work on MacOS

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

Install with brew?

It'd be easier to use this if it was installable with Homebrew.
Can you submit a formula?

Help wanted: Git fuzzy branch command not working as anticipated

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?

Add executable to path for Fish shell

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

Preview diff window is not showing up

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

Page/scroll up & down the right diff pane: needs keybinding configurability and in-app exposure

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:

  • PgDown, but it pages down the fzf cursor in the list of commits (left side)
  • Space/n/p/j/k, but it edits the query
  • Enter (thinking maybe I'd enter a mode of acting on the diff?), but it comes back to the main menu.

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 🙂.

Help section hides the git command result below on small height terminal

2021-07-26_09-09 git fuzzy help

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

Fixup

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.