8 ms·
Show HN: `fzf` * `Git` done right
- parentheses 6y ago(Author) Please reply to this comment with any bugs you face and I’ll do my best to fix them ASAP. I recommend you check out the log command. It’s quite powerful and the closest to a “git history search engine” I’ve ever seen.
- hesk 6y agoThe screenshot looks nice but I can't figure out how to get it working. I can mark files with TAB but how can I edit/stage/commit? The ALT-X hotkeys create characters which are used to refine the search.
- parentheses 6y agoDepends on how your terminal is set up. Often times folks remap those keys and that prevents `fzf` from receiving them. If that’s the case, try a new terminal emulator as an experiment.
- hesk 6y agoI tried the macOS terminal, iTerm2, and the xterm that ships with XQuartz. None of them work. I think the problem is that by default Alt+X creates printable characters on macOS. For example: Alt-E => € Alt-U => ¨ Alt-C => ç Disabling this is not really an option because I rely on them. EDIT: formatting
- soraminazuki 6y agoI think it's nicer if it used ctrl- bindings instead.
- parentheses 6y agoi'll have to make this configurable in some sort of way
- lloeki 6y agoOption as Meta "solves" that in prefs. In quotes because Terminal.app makes it apply to both Option keys so you can't have it as modifier to enter special chars at the same time on the other key (iTerm2 has such an option). This makes that checkbox useless on e.g French layout (which has the pipe, tilde, square brackets, and braces behind Option). Meta+<key> is actually sending ESC char followed by <key char> veryfastantaneously, so ESC+<key> (at almost the same time, and in that order) works, which has saved me from time to time. Also see timeoutlen in vim, keyseq-timeout in inputrc/deadline, maptimeout in screen, and escape-time in tmux.
- deleted 6y ago[deleted]
- AdamGibbins 6y agoThe doc seems to imply if I have delta installed, it will just automatically use it. But that doesn't seem to be the case, git fuzzy log output looks the same with and without? I have my git pager set to use delta, so I know it works.
- parentheses 6y agoTry `export`ing this env var: https://github.com/bigH/dotfiles/blob/master/configs/core.sh#L138 https://github.com/bigH/dotfiles/blob/master/configs/core.sh... In the meanwhile, I'll try to repro.
- AdamGibbins 6y agoAlso no change, oddly.
- IggleSniggle 6y agoI believe I ran into the same thing. If the other commenter is anything like me, the underlying cause is that `delta` did not support unified diffs until version 0.0.15 (ie only for the last 6 months). I don't even remember when I installed delta the first time, since I ultimately liked ydiff better for side-by-side diffing with line-numbers. I thought I'd give delta a try again only because of this fzf endorsement of it (context is a little different, too, obviously). My perfect diff tooling would support both drop-in replacement for `diff` but unfortunately I still haven't found the one that checks all the feature boxes I want yet. But this fzf wrapper is AWESOME! I tried to do something similar a few months ago and ran out of steam. Glad you didn't! Anyway, updating delta to latest did the trick for me. Note that if you are using homebrew, the formula name is git-delta
- AdamGibbins 6y agoI have 0.1.1 from homebrew.
- Myrmornis 6y ago(delta author here) Line numbers have been added to delta in a contributed PR: https://github.com/dandavison/delta/pull/190 https://github.com/dandavison/delta/pull/190. It will merge soon and be in the next release. And we have an open issue for side-by-side view: https://github.com/dandavison/delta/issues/86 https://github.com/dandavison/delta/issues/86. I definitely plan to get to it! The next release of delta will also provide diff-so-fancy and diff-highlight emulation modes. See https://github.com/dandavison/delta/issues/205 https://github.com/dandavison/delta/issues/205
- htfy96 6y agoThis looks nice! https://jonas.github.io/tig/ https://jonas.github.io/tig/ is another command-line UI for Git with similar two-column layout. git-fuzzy seems to also support two-column diff view which isn't in tig. Good job.
- avel 6y agoA nice tutorial on tig, now that you mentioned it. https://www.atlassian.com/blog/git/git-tig https://www.atlassian.com/blog/git/git-tig
- hivacruz 6y agoI really like the "git diff" example. Almost wants me to throw Git Tower after that! Nice job.
- atishay811 6y agoI personally love Laxygit https://github.com/jesseduffield/lazygit https://github.com/jesseduffield/lazygit. It makes sure I don't have to think.
- williamdclt 6y agoI really like the FZF approach and did some nice git integrations myself. Nothing close to this post, this is great work! But I find that lazygit does everything I want and more, better than I would have designed it!
- parentheses 6y agolazy git is sick!
- mekster 6y agogitin is easy to use to quickly check the state. https://github.com/isacikgoz/gitin https://github.com/isacikgoz/gitin
- beshrkayali 6y agoIf you're an emacs user, check out https://magit.vc/ https://magit.vc/
- gumby 6y agoLife changing
- tarruda 6y agoI've always been curious about how it compares with vim + fugitive, which provides a good git/vim integration
- elpatoisthebest 6y agoI'm a vim + fugitive user who tried emacs for a year about 2 years ago. I eventually moved back to vim but the thing I miss from emacs is magit. It made so much sense to me. Loved it.
- jperras 6y agoHi. Hardcore 10+ year vim zealot here. Magit on emacs is hands down the greatest interface to git that has ever been conceived. Vim + Fugitive doesn't even come close (sorry, tpope, I still love you). So much so that I started using emacs with evil-mode, so that I can use my vim muscle memory and have access to magit. That is how good magit is. It literally converted me to the light (dark?) side.
- dvcrn 6y agoCare to explain what you think is so good about it? I used emacs with evil a couple times but never understood the hype around magit
- BeetleB 6y agoNot a heavy magit user (or git, for that matter), so I can't say. However, you may want to look on Youtube for ideas: https://www.youtube.com/watch?v=7ywEgcbaiys https://www.youtube.com/watch?v=7ywEgcbaiys https://www.youtube.com/watch?v=j-k-lkilbEs https://www.youtube.com/watch?v=j-k-lkilbEs The second (long) one is from John Wiegley[1] whose various packages have a fairly high impact, so I expect the video will be very educational. https://github.com/jwiegley https://github.com/jwiegley
- danans 6y agoI was introduced to fzf by a co-worker about a year ago when I started working on a team that used git. Now I use it literally everywhere, from the command line as a quick git workspace switcher, to all sorts of git commands in vim using fzf.vim [1]. fzf is brilliant. 1. https://github.com/junegunn/fzf.vim https://github.com/junegunn/fzf.vim
- wyclif 6y agoI've been using fzf on the command line and within NeoVim for a about a year now, and it's made my workflow a lot faster. Highly recommended.
- throwaway_pdp09 6y agoCheck out magit. I tried to look at the web page but it has ~16MB in 3 images (please don't do that) and blew up my palemoon process by over 3GB (not MB). I have never seen that before. JS is disabled. There's something really nasty going on. Browser is palemoon, fairly recent.
- parentheses 6y agothose gifs are huge, but the author in me really wanted eye candy on those pages. aside: it's surprising that a browser requires 3GB to display 16MB of gifs. sadly, wouldn't be surprised if the same phenomenon plagues every browser.
- KitDuncan 6y agoUse webm instead of gifs.
- yuribro 6y agoIt takes ~120MB on Chrome. (compared to ~40MB for a different repo page on github). I think this warrants a bug report for palemoon
- throwaway_pdp09 6y agoWill do!
- throwaway_pdp09 6y agoDone. https://forum.palemoon.org/viewtopic.php?f=29&t=24497&sid=bcc88fa03b572914038b3f5446397950 https://forum.palemoon.org/viewtopic.php?f=29&t=24497&sid=bc...
- throwaway_pdp09 6y agoI checked again and it's actually about 4GB. It has to be a browser fault. There's no reason for it. The images shouldn't lead to that, and probably don't. As for the images, point for me is they actually told me nothing useful. It's just animated text, and there's little I can take from them. Perhaps a series of static images, annotated, would be more helpful. IMO
- alpb 6y ago"done right" is rather subjective. It would be better if mods can suggest a better title.
- parentheses 6y agohow about '`fzf` + `git` to melt your face'?
- OJFord 6y agoNice! I've been using my own `git fzsha` and `git fzfile` commands pretty much since I discovered fzf, as prefixes to standard commands which they pass the fzfound result on to. I just recently moved them out to their own repo (https://github.com/OJFord/fzutils https://github.com/OJFord/fzutils) having been asked about it a few times, but looks like I might be able to drop them in favour of this.
- andrewshadura 6y agoThere’s also https://github.com/andrewshadura/git-crecord https://github.com/andrewshadura/git-crecord.