Live data from Hacker News

GitUI: Terminal UI for Git

github.com

71–80 of 94 posts

Re: GitUI: Terminal UI for Git

#71
post #49

Earlier quoted context omitted.

tig rules. gitui does not support vim keybinding for me, or I did not find out how. rust's size always surprise me: tig -- 600KB, gitui: 11MB similar size pattern for other utilties, in general, rust executable is about 200x larger than its c/c++ peers, and, they all linked to similar c/c++ libraries, looks like rust stdlib is pretty big in size to me.

rust binaries are statically linked, that's the big difference. If you included all the libc code statically in most c programs they'd probably also be pretty big

by default rust doesn't statically link to libc.

Re: GitUI: Terminal UI for Git

#72

Any tig users here ? I’m happy with it since then, looks like the feature set is pretty similar

tig rules. gitui does not support vim keybinding for me, or I did not find out how. rust's size always surprise me: tig -- 600KB, gitui: 11MB similar size pattern for other utilties, in general, rust executable is about 200x larger than its c/c++ peers, and, they all linked to similar c/c++ libraries, looks like rust stdlib is pretty big in size to me.

I bet that size could be brought down with link time optimization, at the cost of longer build times, and potentially slower performance.

Re: GitUI: Terminal UI for Git

#74
post #49

Earlier quoted context omitted.

rust binaries are statically linked, that's the big difference. If you included all the libc code statically in most c programs they'd probably also be pretty big

when i have an embedded board with say 64mb storage,a few rust executable will fill them up fast. problem is that rust does not give me option to do dynamic link to its stdlib.

Not that this is based on some Googleing and experimentation; I could not find official docs.

It actually is possible to dynamically link to the standard library. Add this to your project's .cargo/config.toml file:

    [build]
    rustflags = ["-C", "prefer-dynamic"]
And add a reference to this crate, which copies the stdlib's shared library to your output directory:

https://github.com/WilliamVenner/prefer-dynamic

After you do `cargo build --release`, you will notice you hello world EXE is much smaller than a typical rust binary. Like 10~20KB small. On Windows it runs just fine. On Linux, I has to change the exe's RPATH to look for the standard library in the current directory:

    patchelf --set-rpath '$ORIGIN' ./exe_name
Anyways, it is possible. The rustc compiler itself is shipped in this way.

Re: GitUI: Terminal UI for Git

#75

I'm by no means an expert, but is it really that hard to remember clone, pull, commit -a, push and maybe something else you'd need. That you need a GUI? And even then you can either use the help or man or just Google it and you'll remember the right command sooner than later. Or am I missing some quite important? I've been using this for most of the stuff that I do in github and it seemed to be enough. I use these on…

> Or am I missing some quite important?

Speaking as to "why would you not just use command line git, or VSCode integration".

Two aspects: Speed, and discoverability.

These are two things that magit massively improves upon the command line.

e.g. to make the commit, in magit, it's the key sequence " g g" (to open magit) then "c c" to commit. (Being able to quickly do this from the same place you edit code is very convenient).

In terms of discoverability, magit shows me the common options for commands (e.g. it shows `-a autostash` for git pull), or other commands which might be useful that I've not used (like git worktree).

Re: GitUI: Terminal UI for Git

#76

I'm by no means an expert, but is it really that hard to remember clone, pull, commit -a, push and maybe something else you'd need. That you need a GUI? And even then you can either use the help or man or just Google it and you'll remember the right command sooner than later. Or am I missing some quite important? I've been using this for most of the stuff that I do in github and it seemed to be enough. I use these on…

> Or am I missing some quite important?

I feel like you are. The operations you mentioned - clone, pull, “commit -a”, and push - are trivial. Nobody needs a nice UI for those.

But in real day-to-day use, I’m branching, merging, creating and applying stashes, cherry picking, rebasing, browsing the repo history, browsing specific file histories, diffing across branches, selectively committing specific changes in a file, etc. and it’s convenient to have a nice UI for the more advanced use cases.

Re: GitUI: Terminal UI for Git

#77
post #49

Earlier quoted context omitted.

rust binaries are statically linked, that's the big difference. If you included all the libc code statically in most c programs they'd probably also be pretty big

Go programs are also statically linked and Go based CLI tools generally only come in at 3-4 MB IIRC. I've used static linking in binaries in Nim and C programs too with similar (or smaller) sizes. Rust binaries are just impressively large. I'd guess part of it must be how Rust monomorphizes generics: https://rustc-dev-guide.rust-lang.org/backend/monomorph.html

if you strip them you tend to lose a lot of the fat.

Re: GitUI: Terminal UI for Git

#78

Is there a Web UI equivalent for tools like this, where one can spin up a web server pointing to a git repo on the server and do commit, diff, merging, graph visualisation etc. through a web interface?

Sounds like you want "ungit": https://github.com/FredrikNoren/ungit

Re: GitUI: Terminal UI for Git

#79
post #72

Earlier quoted context omitted.

tig rules. gitui does not support vim keybinding for me, or I did not find out how. rust's size always surprise me: tig -- 600KB, gitui: 11MB similar size pattern for other utilties, in general, rust executable is about 200x larger than its c/c++ peers, and, they all linked to similar c/c++ libraries, looks like rust stdlib is pretty big in size to me.

I bet that size could be brought down with link time optimization, at the cost of longer build times, and potentially slower performance.

The gitui has lto enabled.

Re: GitUI: Terminal UI for Git

#80

Earlier quoted context omitted.

Go programs are also statically linked and Go based CLI tools generally only come in at 3-4 MB IIRC. I've used static linking in binaries in Nim and C programs too with similar (or smaller) sizes. Rust binaries are just impressively large. I'd guess part of it must be how Rust monomorphizes generics: https://rustc-dev-guide.rust-lang.org/backend/monomorph.html

if you strip them you tend to lose a lot of the fat.

Nice, any tips on how to do that? Is there a Cargo thing or just run regular ole strip?
Post reply on HN