frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Rebasing in Magit

https://entropicthoughts.com/rebasing-in-magit
86•ibobev•2h ago

Comments

mschulze•1h ago
I use magit daily for over 8 years now. Over that time I have showed it to many other peers, out of excitement for a tool that made me more productive and helped me learn - but I never could convince even one to use it. Maybe it's my persuasion skills, maybe tool usage is too personal - I don't know, but it makes me kind of sad. The UX of magit is just out of this world.

Especially for rebasing, subset rebases (using --onto, see https://git-scm.com/book/en/v2/Git-Branching-Rebasing#_more_...) are a breeze with Magit. I can't remember the order of branches to use on the CLI, in Magit it's just "r s" basically. It's really magic.

lambda•1h ago
Magit is absolutely the best Git GUI ever.

Unfortunately, for most people the fact that it's part of Emacs is a blocker.

And because most people use worse Git tools, they tend to use workflows that are easier with more cumbersome tools; generally just committing all kinds of junk commits to a branch, and using the "squash and merge" feature of GitHub or GitLab to clean everything in a PR/MR up into a single commit.

So yeah, it's sad that people don't use Git to its full potential because almost no other Git interface works as well, and most people aren't going to learn Emacs just for a Git UI.

troupo•1h ago
The best gut GUI is GitUp: https://gitup.co/

Magit is not even close to be on the same level.

Any insane operation you want at your fingertips.

jbstack•42m ago
It's Mac-only. That's a pretty serious limitation for a modern Git tool.
w4rh4wk5•45m ago
I've looked at Magit and indeed Emacs is a blocker as it's not something I'd like to pick up and maintain. I am using Fork as my primary Git GUI and am pretty happy with it. Lazygit and tig cover the few use-cases which Fork does not cover.
erksa•1h ago
Same, emacs being the barrier for most.
jayd16•1h ago
What makes something easier in magit than, for example, SmartGit?
mschulze•1h ago
I haven't used SmartGit, so I can't really compare.

I would single out the following for Magit:

1. Single key strokes for actions and toggles 2. Discoverability through "slide-ins" (TFA also explains this)

For 2, this means I press "c" for commit, this opens a popup showing me the next keypresses and what they do. So I can build up muscle memory for commands I know that are fast due to 1, and I can discover options that might help me due to 2.

If I don't know what to do at all, there's Ctrl+c, Ctrl+c to discover "entry-points" for Magit shortcuts.

masklinn•1h ago
I personally don’t care for rebasing in emacs (I actually find it confusing when hitting conflicts).

My primary reason for using it is reviewing and staging commits. The non-linear staging with line granularity (which also lets you revert changes at the same time), is so, so very good when you care about crafting commits.

mschulze•1h ago
Right - actually, for conflicts I switch to IntelliJ.
taude•1h ago
I used to use Magit, but once I discovered LazyGit four years ago, I never looked back. No Emacs bloat and a great TUI-based UX with quick single key press actions.
jwr•9m ago
> I never could convince even one to use it

Most people think it's "just another interface on top of git" — without several in-depth examples it's difficult to realize that it actually allows you to complete really complex tasks quickly. I've seen this superficial take many times.

skydhash•1h ago
Magit does give you a surgeon control over the scapel that git is. Most git GUI wants to give you a nice dashboard. The latter is OK if you just want some logs stored (aka git commit and git push), but version control can be a powerful tool especially considering how non linear programming can be.

A patch is an idea, not some snapshot of time. git allows for ideas manipulation. The rebase operation is adjusting ideas to fit a context. And with the reflog (which tracks every operations), you have undo for ideas manipulation.

tambourine_man•1h ago
Magit is one of the few things that makes me, as a Vim user, envy Emacs. And org-mode, since I'm being honest.
kqr•1h ago
You can use Magit even if you're a Vim user. You don't have to buy into the whole Emacs system – you can treat Emacs as the virtual machine that runs Magit.
mschulze•1h ago
Yes, I use Emacs 90% just for magit (and 10% for org-mode for some time tracking), but no text editing or coding at all.
tambourine_man•1h ago
Yeah, but it's not as convenient.
scocide•1h ago
Magit was the only thing keeping me in emacs for a long time, but the neovim clone, neogit, is now 90% of the way there for my use cases, same interface same everything
tambourine_man•1h ago
I need to move to Neovim. Thanks for the nudge.
codingcareer•1h ago
Awesome! I had no idea! I will give it a shot :) Thanks ~
veilrap•1h ago
If you haven’t seen it you may want the fugitive plugin for vim. It seems to give a reasonable level of git magic within vim. Maybe not as magic as magit, but it does a lot including good handling of interactive rebases.
baq•34m ago
jj/jjui should have you covered
nopurpose•1h ago
I was missing magit, but then found `gitu` CLI and now use it happily for rebasing.
sandinmyjoints•1h ago
Rebasing in magit is so choice. I especially love magit-rebase-subset.
jonpalmisc•1h ago
Tangential, but I really wish there would be a performance renaissance with Emacs.

Native-comp was a good step forward, but Emacs is still so much slower than Neovim, even in the case of launching and immediately quitting, with no config:

    $ time emacs -Q -e kill-emacs
    /Applications/Emacs.app/Contents/MacOS/Emacs -nw -Q -e kill-emacs  0.18s user 0.03s system 98% cpu 0.213 total
    
    $ time nvim -es --cmd 'vim.cmd("q")'
    nvim -es --cmd 'vim.cmd("q")'  0.02s user 0.01s system 82% cpu 0.034 total
Even with a very minimal set of packages, text insertion, etc. is slower, and opening Magit (when it hasn't been loaded yet) takes about a second due to slow package loading.

Emacs is my favorite editor, full stop.

But every time I open Neovim or Sublime for quick tasks, it's always painfully apparent how much faster they are when I CMD+Tab back to Emacs.

ahoka•1h ago
/usr/bin/time emacs -Q -e kill-emacs 0.03 real 0.02 user 0.00 sys

Altough I'm not using Emacs.app.

jonpalmisc•1h ago
Not using Emacs.app because you aren't on macOS, or using some other build/setup? If the latter, I'm curious.
ishouldbework•1h ago
While faster Emacs would always be nice, I think the idea is you just keep it running. Hence emacsclient program. So startup time is not such a big deal.
jonpalmisc•1h ago
Personally, I don't buy into this argument. I think having a globally shared buffer state, etc. is an antifeature. Plus, there's no reason that starting a TUI program should be that slow.

Either way, this only addresses startup time too. The rest of the issues: text insertion lag, `project-find-file` being slow in large repos, etc. all remain.

dietr1ch•26m ago
> having a globally shared buffer state, etc. is an anti-feature

Yeah, it feels a bit weird to not have some isolation.

Spacemacs offers layouts[^1] that give you some buffer-isolation. Each window has a "layout", and layouts have sets of buffers. It works well, but you can run into extra prompts if you open the same buffer from two layouts and try to kill it from one of them (kill the buffer (for all layouts)? just remove from this layout? In my mind the latter should just be the default).

[^1]: https://www.spacemacs.org/doc/DOCUMENTATION.html#layouts-and...

smitty1e•23m ago
> I think having a globally shared buffer state, etc. is an antifeature.

Maybe, but I'd like to hear why you think this is such an antifeature for a single-threaded application.

Given the extra resources available these days, for example, why not just bring up a stand-alone ERC instance for chatting, if shared state is a concern?

chriswarbo•17m ago
> I think having a globally shared buffer state, etc. is an antifeature.

As someone who mostly lives in Emacs, I like it. If I'm away from a machine, I can SSH into it and carry on with whatever I was in the middle of.

It's also nice to set emacsclient as EDITOR, so that e.g. running `git commit` will open up a buffer in the existing Emacs session. This is especially useful since I use shell-mode, and it would be confusing/weird to have new Emacs instances popping up when I'm already in an editor! (They open in a "window" (i.e. pane) in the existing "frame" (i.e. window) instead)

dietr1ch•39m ago
> Emacs is still so much slower than Neovim, even in the case of launching and immediately quitting

I agree, but there's ways around it. On my machine the Emacs daemon is ready before I even log-in (lingering [^0]).

I think I only restart the daemon when I update emacs and its packages, and yeah, Emacs and Spacemacs are slow, but do not slow me down.

[^0]: https://wiki.archlinux.org/title/Systemd/User#Automatic_star...

8s2ngy•27m ago
I share your wish. Emacs, as wonderful as it is, has accumulated a lot of cruft over the decades and would benefit immensely from a rewrite. A "Neo-Emacs" could be multithreaded from the ground up and drop support for archaic platforms. The rewrite could even be in Rust to attract younger developers.
umanwizard•23m ago
There would be no point to writing emacs in a language that can’t be developed interactively in a repl. Emacs being written in lisp is an essential quality.
BigTTYGothGF•7m ago
> Emacs being written in lisp is an essential quality

Not for the parts of it I use.

chriswarbo•25m ago
Emacs can certainly be sluggish, but I'm not sure how much that's e.g. inherent to ELisp, or due to synchronous/single-threaded code, or choosing slow algorithms for certain tasks, etc.

For me, the best performance improvement has been handling long lines; e.g. Emacs used to become unusable if it was given a line of around 1MB. Since I run lots of shell-mode buffers, that would happen frustratingly-often. My workaround was to make my default shell a script that pipes `bash` through a pared-down, zero-allocation copy of GNU `fold`, to force a newline after hitting a certain length (crossing a lower threshold would break at the next whitespace; hitting an upper threshold would force a break immediately). That piping caused Bash to think it wasn't interactive, which required another work-around using Expect.

Thankfully the last few versions of Emacs have fixed long-line handling enough for me to get rid of my awful Rube-Goldberg shell!

BigTTYGothGF•11m ago
I'm not sure I'm capable of noticing or caring about the difference between 0.18 and 0.02 seconds for something that doesn't happen on a rapid cadence.
spudlyo•10m ago
On my M1 Mac Pro I get 0.13s wall, so not much faster than your Mac. On my i9-9900K Linux box I get 0.04s. I would think my M1 single core performance would be on par, if not faster. Perhaps it has something to do with macOS and gatekeeper, as I notice I'm not getting as high of a CPU utilization.

    $ gtime /opt/homebrew/bin/emacs --batch --eval '(princ (format "%s\n" emacs-version))'
    30.2
    0.07user 0.03system 0:00.13elapsed 78%CPU (0avgtext+0avgdata 46064maxresident)k

    $ /usr/bin/time ~/bin/emacs --batch -eval '(princ (format "%s\n" emacs-version))'
    30.2
    0.02user 0.01system 0:00.04elapsed 95%CPU (0avgtext+0avgdata 57728maxresident)k
Joe_Cool•8m ago
What hardware are you on?

On my old Ryzen 3600X running Arch it's a lot faster. Does the UI eat so much performance on OSX?

  $ time emacs -Q -e kill-emacs
  real    0m0.076s
  user    0m0.058s
  sys     0m0.018s

  $ time nvim -es --cmd 'vim.cmd("q")'
  real    0m0.028s
  user    0m0.005s
  sys     0m0.003s
vim still is a lot faster though.
gnuduncan•1h ago
magit is still my best firend in emacs :)
codingcareer•1h ago
A couple years back I was tinkering with a spacemacs setup and I loved Magit!

Over the years I opted to substitute most tools with simpler, UI-based ones (like LogSeq for org-mode) but I never found a good substitution for Magit.

Having a whole spacemacs setup just for one tool is a bit overkill though, so I just use basic git and accept having to deal with interactive rebases manually.

vvillena•6m ago
I have a Emacs + Spacemacs setup only for Magit. The base Spacemacs config works well, so I never had the need to tinker with it. Nowadays I don't care much about the rest of Emacs. It stays out of the way, and I keep happily using Magit.
antonyh•1h ago
I bounced for a while between Magit and Tig, then ended up just using whatever the IDE provided combined with the CLI. I'm a frequent-but-not-daily Emacs user, so it boils down to the friction of switching tools. I should give up the Jetbrains IDEs and go all in on Emacs.
skrebbel•59m ago
Ilove everything about this post.

"It's super easy! Just do l-Akqr␍=u2025-06-01␍-s--tests␍b!"

PaulDavisThe1st•27m ago
from TFA:

> That looks complicated, but remember how we built it: we looked at the hints and selected one option at a time. Now, if this is a log type we’ll use often, we are going to start to be able to write out that incantation without even looking at the hints. It’s both discoverable and efficient.

shpx•49m ago
I want to quit Magit because it's unbearably slow. In a repo with 6000 files `git status` takes 100ms but the Magit equivalent takes 2-4 seconds.
ashton314•36m ago
This will probably help:

    ;; Speed up magit status by removing some things
    (remove-hook 'magit-status-sections-hook 'magit-insert-tags-header)
    (remove-hook 'magit-status-sections-hook 'magit-insert-status-headers)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-pushremote)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-pushremote)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-upstream)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-upstream-or-recent)
chriswarbo•36m ago
I've been using magit for years, and it's the reason I avoided giving the jujutsu VCS a try: the `jj` workflow/UI is supposedly much nicer than the `git` workflow/UI; but since I use magit more than bare `git` commands, that wasn't enough to sell me.

I finally gave it a try when I came across the majutsu package, which is a magit-like interface for jujutsu. I recommend it for Emacs/magit users wanting to try `jj`!

jwr•10m ago
Magit is absolutely wonderful. It is one of the main tools I use daily to get my work done, especially now that AI does a lot of the work for me. I spend a lot of my time in magit looking at diffs!

I would encourage anyone who relies on magit to sponsor tarsius to make his fantastic work sustainable.

Tony Hoare has died

https://blog.computationalcomplexity.org/2026/03/tony-hoare-1934-2026.html
180•speckx•59m ago•14 comments

Rebasing in Magit

https://entropicthoughts.com/rebasing-in-magit
88•ibobev•2h ago•51 comments

Intel Demos Chip to Compute with Encrypted Data

https://spectrum.ieee.org/fhe-intel
105•sohkamyung•2h ago•22 comments

RFC 454545 – Human Em Dash Standard

https://gist.github.com/bignimbus/a75cc9d703abf0b21a57c0d21a79e2be
45•jdauriemma•1h ago•26 comments

I put my whole life into a single database

https://howisfelix.today/
281•lukakopajtic•5h ago•130 comments

Debian decides not to decide on AI-generated contributions

https://lwn.net/SubscriberLink/1061544/125f911834966dd0/
53•jwilk•56m ago•43 comments

Launch HN: Didit (YC W26) – Stripe for Identity Verification

10•rosasalberto•41m ago•15 comments

FreeBSD 14.4-Release Announcement

https://www.freebsd.org/releases/14.4R/announce/
129•vermaden•5h ago•33 comments

Online age-verification tools for child safety are surveilling adults

https://www.cnbc.com/2026/03/08/social-media-child-safety-internet-ai-surveillance.html
195•bilsbie•2h ago•101 comments

The Gervais Principle, or the Office According to "The Office" (2009)

https://www.ribbonfarm.com/2009/10/07/the-gervais-principle-or-the-office-according-to-the-office/
186•janandonly•3d ago•73 comments

Sending Jabber/XMPP Messages via HTTP

https://gultsch.de/posts/xmpp-via-http/
23•inputmice•2h ago•3 comments

Amazon is holding a mandatory meeting about AI breaking its systems

https://twitter.com/lukolejnik/status/2031257644724342957
45•lwhsiao•48m ago•6 comments

Yann LeCun's AI startup raises $1B in Europe's largest ever seed round

https://www.ft.com/content/e5245ec3-1a58-4eff-ab58-480b6259aaf1
299•ottomengis•4h ago•157 comments

PgAdmin 4 9.13 with AI Assistant Panel

https://www.pgadmin.org/docs/pgadmin4/9.13/query_tool.html#ai-assistant-panel
37•__natty__•3h ago•14 comments

A New Version of Our Oracle Solaris Environment for Developers

https://blogs.oracle.com/solaris/announcing-a-new-version-of-our-oracle-solaris-environment-for-d...
24•naves•2d ago•12 comments

Show HN: How I Topped the HuggingFace Open LLM Leaderboard on Two Gaming GPUs

https://dnhkng.github.io/posts/rys/
34•dnhkng•2h ago•14 comments

Practical Guide to Bare Metal C++

https://arobenko.github.io/bare_metal_cpp/#_abstract_classes
76•ibobev•3d ago•27 comments

How many options fit into a boolean?

https://herecomesthemoon.net/2025/11/how-many-options-fit-into-a-boolean/
4•luu•3d ago•0 comments

Caxlsx: Ruby gem for xlsx generation with charts, images, schema validation

https://github.com/caxlsx/caxlsx
36•earcar•3d ago•3 comments

Show HN: DD Photos – open-source photo album site generator (Go and SvelteKit)

https://github.com/dougdonohoe/ddphotos
21•dougdonohoe•2h ago•7 comments

Meta hires duo behind Moltbook

https://www.axios.com/2026/03/10/meta-facebook-moltbook-agent-social-network
33•mmayberry•1h ago•19 comments

LoGeR – 3D reconstruction from extremely long videos (DeepMind, UC Berkeley)

https://loger-project.github.io
104•helloplanets•9h ago•24 comments

TCXO Failure Analysis

https://serd.es/2026/03/06/TCXO-failure-analysis.html
73•zdw•3d ago•33 comments

Two Years of Emacs Solo

https://www.rahuljuliato.com/posts/emacs-solo-two-years
319•celadevra_•15h ago•118 comments

Lotus 1-2-3 on the PC with DOS

https://stonetools.ghost.io/lotus123-dos/
154•TMWNN•3d ago•56 comments

No, it doesn't cost Anthropic $5k per Claude Code user

https://martinalderson.com/posts/no-it-doesnt-cost-anthropic-5k-per-claude-code-user/
371•jnord•16h ago•261 comments

Redox OS has adopted a Certificate of Origin policy and a strict no-LLM policy

https://gitlab.redox-os.org/redox-os/redox/-/blob/master/CONTRIBUTING.md
277•pjmlp•6h ago•282 comments

Traffic from Russia to Cloudflare is 60% down from last year

https://radar.cloudflare.com/traffic/ru?dateRange=52w
63•secondary_op•2h ago•41 comments

Building a Procedural Hex Map with Wave Function Collapse

https://felixturner.github.io/hex-map-wfc/article/
543•imadr•22h ago•79 comments

Is legal the same as legitimate: AI reimplementation and the erosion of copyleft

https://writings.hongminhee.org/2026/03/legal-vs-legitimate/
539•dahlia•1d ago•537 comments