FWIW, I agree. Jujutsu seems fine, but Magit is fine too. Maybe Magit is the Blub of version control, and Jujutsu would change my life for the better, but … I seem to be able to run in circles around my Git-CLI–using colleagues as it is.
2. `jj evolve` is excellent.
3. First-class conflicts. Even just deferring conflict resolution later is convenient.
Here's the motivation for jj, described by its creator (this will be on the FAQ in the next release:
The project started as an experiment with the idea of representing the working copy by a regular commit. I (@martinvonz) considered how this feature would impact the Git CLI if it were added to Git. My conclusion was that it would effectively result in deprecating most existing Git commands and flags in favor of new commands and flags, especially considering I wanted to also support revsets. This seemed unlikely to be accepted by the Git project.
Fundamentally, jj is a different VCS, not just a UI layer on top of git. And so there's a lot of differences, but they sort of sound more generic than specifically "vs what magit gives you."
I don't have time to be more lengthy at this exact moment, but I'll be curious to hear what others say, and I can come back and say more later if you're curious.
- No staging needed, edit your commit directly in your working directory
- Rebasing is automatic, I regularly edit historic commits and the messages
- jj absorb will automatically split and merge hunks into related ancestry commits
- Defer conflict resolution; many conflicts are resolved later by splitting/squashing/moving commits/hunks further (possible only for first-class conflicts)
- No interactive rebase needed, since jj commands automatically rebase while editing historic commits, it feels like constantly living within an interactive rebase
- Easily refer to the same revision (change) across rebase commands by using a jj change_id, without scribbling down Git commit hashes that change across a rebase
- Easily undo (+redo) your last commands through the jj operation log without having to backup the entire git repo at each step
And jj-fzf (https://github.com/tim-janik/jj-fzf/) gives me every useful jj command with a single hotkey (e.g. Ctrl-P for push, Ctrl-N for a new commit with 1+ parents, Alt-B to edit bookmarks/tags, Alt-R to rebase, Alt-Z for undo, …) while browsing the log with commit+diff preview.
Yeah, I know I should have given up Windows instead...
Your move.
Lots of HN users like:
1. Emacs
2. Magit
3. Jujutsu
Just mention these three in a blog post and you'll hit the front page too!
I think git will be "good enough" version control for many years to come.
Also I'll have to say magit simply chose much better names than git. I never understood the `--onto` argument of `git rebase` because it's such a bad name. On the other hand magit calls it rebase subset and it's immediately clear; I now use this kind of rebase almost every day.
These days, I find myself just using the smallest subset of commands possible to do my job, and it is enough. Just add, commit, push/pull and occasional stash or merge is like 99.9% of my daily usage. I don't even remember how to revert (was it checkout -- <filename> or reset <filename> or restore <filename>?) and I'm just fine with it.
I think that git is easy. Just learn the happy path, and maybe a way or two for restoring to a known good state without deleting the whole repo, it's enough.
I try not to torture anyone with it (VCS repair) who hasn’t already exhibited a knack for graph theory. I just tell them where the man traps are and to ask if they feel like they need to go there.
For work and all my older hobby projects still only use git and I used that for ages and know it quite well, but that does not mean I always feel like I need to use it instead of something simpler.
(It is also FUN to use some other tool and not just git year after year. Got to learn something new now and then.)
However I find there is a huge difference between me working solo on a repo or with one or two other people versus managing a complex project with 10+ developers and multiple SKUs in the same codebase (as an example).
That's when the "neurosurgery" aspects come in. Problems were frequently caused by junior devs making mistakes in their repo management that could be a headache to untangle (again, as an example).
https://github.com/jesseduffield/lazygit
I have no connection to this program, other than that I love it, and shill for it every time I get the chance.
Today I'd honestly suggest to skip learning about git altogether (besides the basics, like branching, staging etc) and just start using lazygit immediately.
I've seen people claim that having a clean git commit history is not worth the time, it takes too long to have it nice etc, opting to just stuff their refactor, renaming and new feature changes into one commit. With lazygit I spend a few extra minutes a day to make it nice and I've gotten compliments for it from others when they review my PRs, because it makes the review much easier.
That said, you'll pry that app from my cold, dead fingers.
I’ve been using Magit at work because it’s what everyone uses, and it just does useful shit I need to do, like help me revert specific chunks from an old commit, or migrate chunks to a different branch, or whatever. Stuff that I know how to do in Git, but I’m tired and it turns out Magit is just a lot faster and more interactive.
I have a long history of hating Git UIs but somehow Magit is the one exception. I’ve done a lot of surgery on Git repos in the past so I’m no slouch on the command-line, Magit just lets me do it all faster.
Usually the upvotes come from the casual users and the muttering from the heavy ones. In light of what I said, would you still recommend magit?
I share your horror for GUIs ineffectively hiding the version control reality; but then, despite being an emacs and casual magit user, I still mostly git add files one by one, having git diff the files one by one, and assembling the changed files into coherent groups.
There are definitely shortcuts I could take in some scenarios but walking the safe path even though it's a little longer is the sane response especially when you can type as fast as most of us and you've been using a bourne shell as long as I have.
Or if I'm being more charitable, it's about staying outside the yellow tape lines on the factory floor. No exceptions.
If anything, Magit has helped me AVOID getting in a bad state, because it automatically shows me more information and context than what I get from the Git command line (despite all this fancy Git stuff I put in my prompt). When I’m committing in Magit, I see some weird hunk I didn’t mean to commit, and I can seamlessly edit it, because I’m already in the editor.
magit is a (somehow) thin layer on top of git output, and the brilliance comes from
- keeps the information similar to git cli
- depending on the context it allows to use indirect features (chunk staging) live from the diff
- for most use cases it will infer obvious flags/parameters from where you're at.
e.g: if you're on branch and start rebasing, it will soft-infer the source and target branch.
another one, in the log view, selecting a few commits and diff will get you the diff for that range
it basically reify the informations from the output transparently for you and reuse it where useful, saving you input and efforts multiple times per day
- lastly very low complexity so it's quick and out of your way. every time I have to pair, my colleagues say they couldn't follow what I did because by the time I started talking about staging/pushing, I'm already finished and back to source
Where do you work?
The only pain point is that last time I checked (2020), it was painfully slow on Windows, but as I haven't touched Windows (other than doing a bit of tech support for my parents) since then, that is not a problem for me.
It's true that there's more to jj than just the stuff magit gives you, but also, people should use the tools they find useful. If you're happy with magit, it's totally reasonable to keep using magit.
You don't need to learn the JVM (beyond getting it installed) to play Minecraft and you don't need to learn Emacs to run Magit.
Or, if you're into neovim, there's Neogit, which is inspired by magit. And if you're not, there's https://github.com/altsem/gitu
I settled for Doom emacs since it's in evil mode by default so I can still do both without running another process.
I prefer Spacemacs though.
glitchc•3h ago
anlsh•2h ago
So in my .profile I've got
``` alias gg="NEOGIT_SLAVE=1 nvim" ```
It's definitely not perfect but it's good enough to work for basic committing/rebasing flows and it's faster than booting up emacs for the same purpose.
ckolkey•1h ago