kahole / edamagit

Magit for VSCode

Home Page:https://marketplace.visualstudio.com/items?itemName=kahole.magit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extension gets stuck if HEAD is way behind upstream

bjackman opened this issue · comments

When working on large repos like the Linux kernel it's common to be thousands or tens of thousands of commits behind the upstream. It looks like magit.status tries to inspect every one of those commits, which is not great for performance of course, but actually I've seen it getting stuck completely: my machine gets very busy doing Git ops and then at some point it goes idle and the status view just never renders.

Not sure if this is VS Code throttling the extension or something?

Anyway I guess the simple fix is to just avoid looking at every commit. Not sure what the original Magit does here...

OK I went into the darkest dustiest corner of computer and found my Emacs, swept out the old broken config and put this in there:

(require 'package)
(add-to-list 'package-archives
        '("melpa-stable" . "http://stable.melpa.org/packages/"))
(add-to-list 'package-archives
        '("melpa" . "http://melpa.milkbox.net/packages/"))
    
(package-initialize)
(package-refresh-contents)
(package-install 'use-package)
    
(use-package magit
  :ensure t
    :pin melpa-stable)

(Hey, a totally vanilla Emacs... kinda fun to use!)

Anyway here's what it does on my kernel repo which is 15k commits behind Linus:

image

I'll see if I can implement something similar if I can make some time....

I did a bit of hacking on this, we can actually do this with a single git operation. It's pretty fast, but it still renders all 15k commits in the status view which looks silly!

Needs a couple more hours to clean it up (learning TypeScript as I go, think I took some wrong turns with the coding details) and update the view code.

I'm going on holiday next week so might be a few weeks before I can get it ready.

Oh, that went quicker than expected. PR sent!