[ANN] zbg: Zero Bullshit Git

Good morning everyone! :sunrise:

I’ve started learning OCaml only recently, and I would like to share my OSS project with everyone:

I’ve been using git for many years, and I came up with a workflow that works perfectly for me but it was tedious to type all the commands manually, and .gitconfig aliases weren’t powerful enough. So I decided to package my workflow into a CLI tool. I also added prettier versions of some commands. Maybe you’ll enjoy them too :hugs:


I started learning OCaml only recently; this is my first OSS project with OCaml. Before that, I was mostly using Haskell for the last 7 years. Still, I would greatly appreciate suggestions on improving the code, making it more idiomatic, utilizing OCaml tooling, and everything else. Feedback is welcome!

There’s still some work to be done in zbg, so if you want to have fun and join the development, have a look at open issues.

21 Likes

This is a cool project, but what I really want is the details for your terminal prompt.

Haha, thanks! :sweat_smile:

I’m using starship.rs for my terminal prompt. And here’s my starship.toml config (currently supports only OCaml, Haskell and Rust languages).

What I especially like about this tool is that I don’t need to learn another shell like zsh or fish to get pretty prompt. I can download a starship executable to a directory inside my $PATH, add a line to my ~/.bashrc and write a custom starship.toml config, and it’ll work automagically!

3 Likes

Nice project! Will be trying it out over a few weeks (on my macOS; not sure if it works on Windows). I’ll be trying starship as well because it is cross-platform; two things I learned about today!

You may want to have something like the following instructions to help new users:

opam switch create x-zbg 4.14.0
opam pin --switch x-zbg -y 'git+https://github.com/chshersh/zbg.git#v0.1.0'

install -d ~/.local/bin
install -v "$(opam var --switch x-zbg bin)/zbg$(ocamlc -config-var ext_exe)" ~/.local/bin/zbg

(Wouldn’t it be nice if there was a opamx git+https://github.com/chshersh/zbg.git#v0.1.0 or dunex git+https://github.com/chshersh/zbg.git#v0.1.0 command that did the first two steps, just like npx?)

Also, you may want to consider using my https://github.com/diskuv/dkml-workflows to distribute native binaries. (There is also a static linking alternative floating around which works for Linux).

1 Like

Thanks for these great suggestions! Always happy to learn from each other :hugs:

Tbh, I’m still not too comfortable with the concept of switches in OCaml. I followed the installation instructions to get the compiler version 5.0.0 and been using it ever since. If you have any good recommendations of docs or articles to read, I’d be happy to hear from you! :pray:

I’m not sure zbg even build with OCaml compiler version 4.14.0 but I believe it should be easy to test on CI.


The dkml-workflows repo looks great! Indeed, I would like to distribute statically linked executables of zbg eventually, but so far I’ve found only this blog post and haven’t read it thoroughly yet.

1 Like

Hi chshersh, Dario here,

Quite a late response on my part but I read that you felt a bit of confusion on the concept of switches in opam, maybe this blogpost would interest you: opam 101.

I’ve co-authored it with @rjbou, one of opam’s maintainers, and we both are working hard on releasing more of these articles in the future, hopefully they will be of help to you!

Kind regards

2 Likes

Hi @radiopotin :waffle:

Indeed, this is a great blog post! :rocket:

I remember reading it when it was published, and I even left my comment under the original post :sweat_smile:

I just wish I had before starting my first OCaml project! It would really help me to reduce some confusion around opam switches.

Nowadays, I feel that I understand the concept better, and your article contributed significantly to improving my understanding :relieved:

Hi @chshersh !!

Oh yes indeed ! My bad I did not remember with whom I had interacted on release date but you are most definitely right ! :smile:

I’m so glad to hear it, thank you for your kind words!

See you on the next release (which is soon) !

1 Like