News for hackers. Stuff that matters.
Re:GitUI: Terminal UI for Git by jblecanard on Saturday September 17, 2022 @04:51PM (#32881459)
Any tig users here ? I’m happy with it since then, looks like the feature set is pretty similar
Re:GitUI: Terminal UI for Git by synergy20 on Saturday September 17, 2022 @05:46PM (#32881906)
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.

Re:GitUI: Terminal UI for Git by zmmmmm on Saturday September 17, 2022 @06:03PM (#32882047)
looks like there's a key binding file to enable vim bindings.

Having said that, I'm also a tig user and at least at first glance, I prefer its simplicity. Gitui presents a huge amount of info on the default screen and spends quite a lot of real estate drawing borders around everything. Tig just takes me straight to the commit history, full screen and then I have single key actions to get to other views.

The only thing I don't like with Tig is how little it binds to keys with the expectation that you set up your own mappings to git commands. I would prefer it baked more of them in so they would be standard and documented ... but that is a minor complaint.

Re:GitUI: Terminal UI for Git by woleium on Sunday September 18, 2022 @09:30AM (#32887391)
+1 for opinionated-tig.
Re:GitUI: Terminal UI for Git by accountofme on Saturday September 17, 2022 @09:47PM (#32883563)
IIRC rust statically links crates used by the application, so it might not just be the stdlib that is causing this.
Re:GitUI: Terminal UI for Git by efficax on Saturday September 17, 2022 @08:32PM (#32883117)
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
Re:GitUI: Terminal UI for Git by elcritch on Saturday September 17, 2022 @10:16PM (#32883742)
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

Re:GitUI: Terminal UI for Git by stjohnswarts on Sunday September 18, 2022 @02:29AM (#32884976)
if you strip them you tend to lose a lot of the fat.
Re:GitUI: Terminal UI for Git by elcritch on Sunday September 18, 2022 @05:02AM (#32885763)
Nice, any tips on how to do that? Is there a Cargo thing or just run regular ole strip?
Re:GitUI: Terminal UI for Git by styluss on Sunday September 18, 2022 @03:44PM (#32890797)
Re:GitUI: Terminal UI for Git by synergy20 on Sunday September 18, 2022 @12:34PM (#32888923)
strip will help to some extent, like 20% downsize, just not enough
Re:GitUI: Terminal UI for Git by synergy20 on Saturday September 17, 2022 @11:49PM (#32884250)
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.
Re:GitUI: Terminal UI for Git by MarkSweep on Sunday September 18, 2022 @12:58AM (#32884548)
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 by synergy20 on Sunday September 18, 2022 @08:31AM (#32886998)
as far as i know,this is not officially supported.rust links to its stdlib statically by design. when you have to share this stdlib with a few dynamically linked rust crates it's hard to do in practice.

tried all size reduction tricks,still the size is much large,like 15x large than c,c++. even the stdlib is a 3x larger than to libstdc++

Re:GitUI: Terminal UI for Git by thayne on Sunday September 18, 2022 @12:21AM (#32884395)
by default rust doesn't statically link to libc.
Re:GitUI: Terminal UI for Git by thayne on Sunday September 18, 2022 @12:24AM (#32884410)
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 by comonoid on Sunday September 18, 2022 @04:04AM (#32885481)
The gitui has lto enabled.
Re:GitUI: Terminal UI for Git by comonoid on Sunday September 18, 2022 @05:39AM (#32885958)
gitui has much bigger feature set than tig. Rust binaries might be larger because Rust makes creating complex software possible.
Re:GitUI: Terminal UI for Git by carapace on Saturday September 17, 2022 @08:18PM (#32883017)
"With friends like these who needs enemies?" All these glowing recommendations and no one shares the URL?

https://jonas.github.io/tig/

Re:GitUI: Terminal UI for Git by vlunkr on Saturday September 17, 2022 @06:57PM (#32882448)
Tig combined with this vim plugin is big part of my workflow: https://github.com/iberianpig/tig-explorer.vim
Re:GitUI: Terminal UI for Git by samuell on Saturday September 17, 2022 @05:25PM (#32881728)
Tig is just awesome. So well thought out, with sensible shortcuts for every relevant action in each context. Must have gone a lot of thought into it.
Re:GitUI: Terminal UI for Git by petepete on Saturday September 17, 2022 @06:15PM (#32882144)
I use tig daily. I've never used anything I like as much for quickly browsing through commits in a repository or staging individual hunks.
Re:GitUI: Terminal UI for Git by weaksauce on Saturday September 17, 2022 @07:53PM (#32882853)
how does tig compare to something like magit?
Re:GitUI: Terminal UI for Git by petepete on Sunday September 18, 2022 @10:17AM (#32887754)
It only does a fraction of what magit does. I just use it for scrolling though the commit history, occasionally searching messages, and it's my tool of choice for staging/unstaging hunks.

It's the only tool I use to compliment the git cli.

Re:GitUI: Terminal UI for Git by weaksauce on Sunday September 18, 2022 @03:47PM (#32890821)
I see. have you tried magit as a comparison? while magit can do everything it's got a very easy interface for most tasks. I don't use emacs for anything but magit to the point where i have a magit command on the command line to open up emacs in the current directory and then a spc-g-g opens up magit. it's that good.
Re:GitUI: Terminal UI for Git by petepete on Sunday September 18, 2022 @05:06PM (#32891512)
So I use neovim as my editor, I'm familiar with fugitive but only use it for blaming.

I just prefer switching to my git tab in tmux and using the cli or tig deepening on what I'm doing.

Re:GitUI: Terminal UI for Git by georgyo on Saturday September 17, 2022 @04:53PM (#32881477)
Happy tig user. Viewing git history without it is painful.
Re:GitUI: Terminal UI for Git by mcbuilder on Saturday September 17, 2022 @07:29PM (#32882676)
I used tig way back in the day, but I have found `magit` to be superior and one of the most useful emacs packages that I use daily.
Re:GitUI: Terminal UI for Git by sys_64738 on Saturday September 17, 2022 @05:42PM (#32881880)
Yep tig is my world.
Re:GitUI: Terminal UI for Git by rvz on Saturday September 17, 2022 @06:04PM (#32882055)
Nothing wrong with tig. It just works.
Re:GitUI: Terminal UI for Git by corytheboyd on Sunday September 18, 2022 @12:25AM (#32884418)
tig is perfection
Re:GitUI: Terminal UI for Git by 29athrowaway on Saturday September 17, 2022 @09:53PM (#32883612)
tig is better