Live data from Hacker News

A Git client for simultaneous branches on top of your existing workflow

gitbutler.com

81–90 of 119 posts

Re: A Git client for simultaneous branches on top of your existing workflow

#81

Very cool, congrats Scott! I have been getting very into jj over the last few weeks, which is larger in scope, but also currently uses git as a backend of sorts and supports similar workflows. Do you have any thoughts/opinions/comparisons to it? EDIT: I just mentioned this in the jj Discord and schacon is already in there, I didn't realize!

I think jj is super cool. But I like the idea of a killer GUI that makes so many things so fast and easy to do that I would use it instead of the cli. Ive never used a git gui for more than a day. Ive used GB daily for months and I love my dogfood.

But re:jj, Im pro anyone trying to do interesting things around VCS/Git. Its been a very long time of general complacency.

Re: A Git client for simultaneous branches on top of your existing workflow

#82
post #80
post #70

Earlier quoted context omitted.

Sort of, but it's honestly closer to normal git branches. If I'm not mistaken, you can't have multiple changelists applied simultaneously. You still have to switch between active groups of changes, no?

you can have any number of changelists (or changesets) active at once. You can actually have changes in the same file with some lines in different changesets. When needed, you can commit changes to git (when you finish doing work) to make them visible to coworkers.

I see. Well then there are some similarities. Though you can use ours with any editor :)

Re: A Git client for simultaneous branches on top of your existing workflow

#83
post #81

Very cool, congrats Scott! I have been getting very into jj over the last few weeks, which is larger in scope, but also currently uses git as a backend of sorts and supports similar workflows. Do you have any thoughts/opinions/comparisons to it? EDIT: I just mentioned this in the jj Discord and schacon is already in there, I didn't realize!

I think jj is super cool. But I like the idea of a killer GUI that makes so many things so fast and easy to do that I would use it instead of the cli. Ive never used a git gui for more than a day. Ive used GB daily for months and I love my dogfood. But re:jj, Im pro anyone trying to do interesting things around VCS/Git. Its been a very long time of general complacency.

Cool, thanks! I am also in the "never used a git gui for more than a day" camp, so that makes a ton of sense! Looking forward to giving this a shot.

Re: A Git client for simultaneous branches on top of your existing workflow

#84
As usual couldn't recommend stacked git [1] enough. If you prefer CLI it greatly reduces cognitive load about branches/rebases especially if your work with review server allowing to see changes between force pushes (gitlab, gerrit).

[1]: https://stacked-git.github.io/

Re: A Git client for simultaneous branches on top of your existing workflow

#85
post #45

Earlier quoted context omitted.

GitButler will literally not work when you use raw git, or other tools.

It works fine. The only thing that is a problem is “branch” and “commit”, things that use the index. But that makes sense. If you have setup two virtual branches and then from the cli run “git commit”, which branch do we commit to?

> The only thing that is a problem is “branch” and “commit”, things that use the index.

A git branching tool that breaks git branch and commit - what a novel concept!

Re: A Git client for simultaneous branches on top of your existing workflow

#86

An aside but this is giving me ClearCase config_spec vibes. Memory is hazy - possibly due to trauma - but you could create a config_spec which would make your view (roughly: working tree) pick up different bits of the filesystem from different branches. Branches might only exist on some of the filesystem, depending on how you set up auto branching and what you checked out, and you had to know what the config_spec rul…

Spec was a huge pain. For our project it contained around 50 directories to fetch from. Directory per component with own versioning. Only a few persons know working combinations you could use.

Re: A Git client for simultaneous branches on top of your existing workflow

#87
This looks awesome. I've used git for over a decade and I always have to look up rebase, reset head, etc commands that I use maybe a few times a month.

> Undo, squash and amend your work by just dragging and dropping. No need to wrestle with rebase -i.

I think one thing that would be really cool to add to this and other git actions is to put the git commands that will be run based on the users inputs somewhere on the screen so the user doesn't COMPLETELY forget how to use git, and actually may get better at it with the additional help. Some may think that would lead people to not using gitbutler anymore, but no way, I am absolutely happy never having to write another git command beyond commit and push. Every time I have to do something I don't usually do in git it slows me down by 5+ minutes and it's super annoying and god forbid its a too-big PR that I have to cherry pick etc.

Also, another thing I am DYING for, none of my IDEs (intellij/vscode) as far as I know have extensions/options for it - if I do a commit and push in a vscode session, COLOR THE FILES SO I STILL KNOW WHAT I EDITED. DON'T UNMARK THEM AS EDITED. Make them yellow or blue or something, I don't care, just color them. You can absolutely track git diff / cache etc against 1 or 2 previous merges and base file colors on it. I do this all over my CI/CD scripts to determine whether or not we need to do a docker build/deploy etc or not based on files that diff from origin/main + your current branch 1 behind. If you didn't modify a Dockerfile, we don't do a docker buildx with your push.

I HATE when I have to commit/stash a massive PR with 30+ files edited because I need someone else to pull it or whatever and then have NO easy way to see what I changed in the commit vs main in my UI because as soon as I commit and push all of the tracked files change color to the "im just a file" grey color.

It causes me to commit a lot less when I should commit more. I'm pretty sure at some point I'll have to dive into js and write this myself. Probably just store modified files in a list and diff against main. I have an extension (wakatime) that tracks how long I've written code (not idle time at all, actual typing) in a BRANCH so you can definitely track a session based on something like your time writing code in a branch and cross reference that vs modified files.

The current branch I'm in I've written 4 hours of code in over 1-2 weeks, so I just need to know in that 4 hours what files I touched.

Re: A Git client for simultaneous branches on top of your existing workflow

#88
post #82
post #80

Earlier quoted context omitted.

you can have any number of changelists (or changesets) active at once. You can actually have changes in the same file with some lines in different changesets. When needed, you can commit changes to git (when you finish doing work) to make them visible to coworkers.

I see. Well then there are some similarities. Though you can use ours with any editor :)

yours is GREAT!

Re: A Git client for simultaneous branches on top of your existing workflow

#89
post #68
post #41

Earlier quoted context omitted.

Yeah, this sounds very much like a 'view' in clearcase. It's a good feature especially with big monorepos where it is helpful to pick and choose a known good version of specific module or subset of files without polluting the history. Tracking good versions of every single file with huge number of files changing was a pain though.

I haven't used ClearCase, but from the description, I don't think it's much like a view. It's closer to IntelliJ's changelists, but without many of the limitations. It's effectively a way to take changes you're making and pretend like you did them in worktrees without having to switch back and forth. Or maybe, to work on several branches, achieve the merged state you want, then split the work up into reviewable branc…

Typical use case for worktree(s) is to work on feature/hotfix branch without touching the current master/wip branch.

So, in the context of worktrees I read _"The way we're doing it, the branches are both in the same working directory at the same time"_ as having both the branch's files (not changes) available in the same worktree.

Thanks for clarifying that it is similar to changelists.

Re: A Git client for simultaneous branches on top of your existing workflow

#90
post #64
post #56

Earlier quoted context omitted.

This makes sense, but I have to say I would find it much less concerning if doing "commit" would apply to some well-defined selection. Either something marked in the UI as "default" or "first" or something so that normal git operations wouldn't cause failure. I realize it makes one of the virtuals special, which is unfortunate, but it means normal command line workflows would be _safe_ even if they wouldn't always pr…

Two things. One is there is a commit dialog per virtual branch. You do a commit on a branch. The selection is all the files/hunks you see on that branch, or you can selectively commit parts of those changes (such as a add -i type commit). It's pretty much identical to how Git (or any other Git GUI) handles commit selection, except you can have more than one branch that you're working with, applied, at a time. Also, G…

That's great news, and I'll play with it some more to see if I misunderstood the docs. If so there may well be no issue here. Thank you for clarifying.
Post reply on HN