Slow prompt in large git repos? speed up with lilgit

Hi all,

If you have git-status info in your prompt, you likely find large repos annoying. @colemickens kindly nerd-sniped me on Christmas Eve by pointing out gitstatusd (gitAndTools.gitstatus).

I’m a git-status minimalist, so I tried to out-perform gitstatus when I noticed how much detail it collects. This went far better than I imagined, and I’m excited to share lilgit now that its dependencies are in *-unstable channels.


If you find it promising, I could use a little help improving the daemonization/IPC implementation. The MVP uses bash coproc for simplicity, but it has some downsides:

  • Currently limited to bash (but this isn’t intrinsic!)
  • It launches one lilgitd per terminal/shell for now. Rewriting the daemon in Rust improved memory use (~13 → 2.3MB /instance), but a multi-client daemon would further improve memory use.
  • Your terminal may nag about the active lilgitd process on close. In I add lilgitd to a list of running executables to ignore on close.

I’ve pushed an update today rewriting the Python ~daemon component in Rust. This:

  • brings a nice improvement to startup time
  • drops per-instance memory use from ~13MB → 2.3MB
  • further improves the speed when it can respond without shelling out to git

I’m hoping the increased performance means there are some places where it currently shells out that it can handle without doing so, but I haven’t played around with it yet.


Forgot to mention that I also added a flake for this back in January.

1 Like

Could you add a example for somebody who hasn’t messed with $PS1 before?

It might help to know what you’re hoping to see demonstrated?

The most-basic example is in the readme already:

People and platforms/distros often customize PS1, so you’d generally just include that wherever your PS1 is already set.

You can also see the PS1 used for the demo (GitHub - abathur/lilgit: a smol (quick) git status prompt plugin) in:

The readme also links out to my bashrc flake which has a more complex example:

Are you hoping for something none of these cover?

1 Like