Live data from Hacker News

The lazy Git UI you didn't know you need

bwplotka.dev

171–180 of 224 posts

Re: The lazy Git UI you didn't know you need

#171
post #7

You might laugh, but in years of serious development, I have not come across a better git UI tool than SourceTree. If I want to be hard-core, I'd use the original git CLI. SourceTree is unmatched in how it makes using git so much more pleasant for when you need to do something relatively simple, but which would be quite cumbersome to do with the CLI and most other tools I've tried. Its file status and history view is…

On Windows I've been using TortoiseGit for over a decade now and in terms of Git power user features in a GUI I think it's unmatched. People who defend the CLI as the only real way to use Git simply haven't used a decent GUI for it. I consider myself a very advanced Git user, but I barely know the CLI commands off the top of my head. A GUI really makes a lot of sense for something like Git, most of the time what you…

There are two of us! I also espouse the virtues of TortiseGit any time I am able! I do take a bit of guff at work, but one feature of TG I've never seen equalled is how it handles what I call "drill-down git blame adventures". TG'a blame lets you easily keep going down through a files commit history in a way that is both intuitive and useful. My only issue with TG is that it is so Windows-focus and as I'm working more and more in Linux I will tragically need to leave it behind ;_;

Re: The lazy Git UI you didn't know you need

#173

Earlier quoted context omitted.

I think a big problem with Git is that it's not opinionated enough. Every team has their own Git flow because Git makes it possible to do so and most developers love nothing more than micro optimizing every minute aspect of any work that is not the task they've been assigned this sprint (myself included), or avoiding learning anything at all (half of my coworkers) thereby leaving the decisions to people like me. I'd…

If you could make it opinionated in one or two ways, how would you do it? I'm having a hard time thinking about situations that would be solved by this

Actually, the more I think about it, the more I realize the problem is that Git is too opinionated about a bad idea: attempting to make a DAG feel like a linked list in order to make it "easier" to use from the CLI because CLIs make it way too hard to visualize DAGs (don't come at me with your CLI DAG viz. Even the best ones are strictly inferior to the simplest GUI DAG viz).

There are really only two things I care about: the state of the files on disk and the state of the index. And I really only care about where I am and where I want to go, everything else in the middle is noise.

To me, the staging area isn't "real", it's just a tool for working with the other two. Git doesn't need to pitch a hissy fit about editing history. Allowing easy edits of history would obviate the need for the staging area. But because they called it "history", now we have emotional responses to the concept of editing it, like we're somehow committing political revisionism.

But the existence of the staging area and the attempt at making the DAG look linear makes reseting ridiculous. Every time I need to do some kind of reset that isn't --hard, I have to read my Git GUI's descriptions of what each type does, and yet somehow it still doesn't have the combination I actually want half the time. All these named reset types could just be two separate reset commands, both pointing to a commit, one resetting the files on disk, one resetting the index. Sometimes I end up having to do a two step reset of a combination of hard forward then soft backwards to get what I want.

Similarly, all the different merge strategies are dumb. None of them ever do the right thing. I'm always getting stupid shit like new blocks that insert a new ending curly brace after the previous block, followed by the new block body, then the original ending curly brace from the old previous block. Half the time I just use the reset hard/soft to then manually review changes to enact a manual merge rather than trust merge to do anything reasonable.

Sacred history makes it way too hard to organize commits in any logical way. I want my VCS to be a super-powered UNDO. I don't need it to be an audit log of who did what and when (auditability only matters for releases so why do I have to be saddled with it minute by minute?). I basically want to be able to edit two or more commits in a sequence as easily as I currently can edit the staging area, so I can easily guarantee ordering of changes to partially related modules that I'm working on together. C depends on B depends on A. I want to be able to work on all three at the same time, but make sure all changes to A come first, then B, then C, and I want to be able to do this incrementally over the course of the day, rather than all at once when everything is perfect.

But this fetish of not changing history even though we can totally change history biases all other Git tooling to attempt to appear like it operates in linear history. Like how there's the HEAD pointer that can be offset; uuuh, what happens if that offset reaches a fork (I've never tried, the poor DAG experience of the CLI has kept me in GUIs which makes the HEAD pointer completely unnecessary). Or how log is basically unreadable.

Don't even get me started on submodules vs subtrees. I have to get to work.

Re: The lazy Git UI you didn't know you need

#174
post #45

Something not mentioned in the article which has changed the way I interact with git repos (and the reason I will never not use LazyVim until something better comes along) is just how well the system plays with tmux floating panes. I have it so that anytime I press ctrl-g in a git repo, I open a floating tmux pane in my current working directory. This might sound "whatever", but it means I don't have to actually be i…

Indeed! I just found out about tmux display-popup recently. # ~/.tmux.conf bind-key C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 80% -h 75% "lazygit" Then, in tmux: ctrl-b ctrl-g will open a popup window with lazygit q to quit

Pretty much my config exactly. I make mine a bit bigger tho:

   bind-key -n C-g display-popup -E -w 90% -h 80% -T "LazyGit" -d "#{pane_current_path}" "lazygit"

Re: The lazy Git UI you didn't know you need

#175
post #5

I was a big fan of a good keyboard-driven git TUI like magit, neogit, lazygit, etc... (as long as you learn the CLI first and understand it). Now I no longer directly use git, but instead use jujutsu (jj). Once I became very proficient in the jj cli, I picked up jjui: https://github.com/idursun/jjui Also, as splitting commits is an extremely frequent operation, this neovim plugin is really nice: https://github.com/ju…

just to add to the chorus, I'm switching to jj as well. I haven't started using it in every project but it's only a matter of time I think. That said, I do which for a more jj aware GUI. For one, it's nice to be able to quickly see diffs across a bunch of changes. I use gg for this but I'd prefer a side-by-side diff and, ATM it only has a traditional diff. Also, watching the video of git butler, it seems like a jj UI…

You can use VisualJJ to rebase via drag & drop, split interactively etc.

https://www.visualjj.com - I'm building it and would appreciate any feedback!

Re: The lazy Git UI you didn't know you need

#176
Wait, no one mentions the default JetBrains IDE git UI? I mean, I get it if you're working from another IDE/text editor that doesn't have good git UI support out of the box, but JB's git UI is reasonably good enough that I don't want anything else.

Things that I use (and I like): 1. quick checkout to another branch and automatically stash and unstash your local changes; when I just need to inspect code elsewhere I find it really useful. My changes are small so I can always remember to stash them later; 2. compare branch/commit etc via UI; again I know you can do that in git diff, but then you would need to know the command and the commit SHA to compare; in UI it comes in really handy, just select the branch or commits you want to compare and that's it. I've seen my coworkers trying to come up with the command and I just say: use IDE and a couple of clicks they got it working. 3. filter commits by user and by folder.

Re: The lazy Git UI you didn't know you need

#177
post #88

Earlier quoted context omitted.

Same. I have not been able to find an explanation of anything jj supports that I don't have already with magit, but I am open to learning :)

I think the big thing (potentially, for me) is the ability to postpone conflict resolution during a rebase. That can be quite painful in regular old git, but git-mediate helps make that less painful in practice in my particular situation and workflow. We'll see once better non-cli UX appears. I'm low-key excited for what could be possible in this space.

I am excited too! It is probably too much to hope, but I nonetheless am hoping that magit gets a jj backend before I have enough motivation or need to learn a new tool to do the same old stuff :D

Re: The lazy Git UI you didn't know you need

#179

Earlier quoted context omitted.

> I'm sure svn got decent merging. That's definitely not my experience. SVN has merging, but I've found it extremely frustrating in a team context.

When did you experience it last time? I remember it being bad, but it was before git was created.

Last year, unfortunately. Most modern utilities, even svn-to-git migration utilities, have been abandoned now that git has become the de-facto standard and everyone who can reasonably be expected to switch to git has done so already.
Post reply on HN