Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Hacking the Git Shell Prompt (plover.com)
28 points by luu on Feb 7, 2021 | hide | past | favorite | 9 comments


Isn't this what starship-rs[1] was built for?

[1]: https://starship.rs/


Starship is so good, I’m finally back from zsh do bash without having to roll my own oh-my-zsh replacements.


tl;dr


I was going to downvote this but after skimming the article I'm inclined to agree. There's no intro/conclusion summarizing what the post is about, and without them the body is just a stream of consciousness that's hard to follow and unengaging.


There is a conclusion at the end if you bother to scroll down ;)


The author likes using long branch names, except for that this makes their prompt look ugly.

One workaround they've used is to use a shorter branch name locally which tracks the longer remote branch name.

This blogpost shows details about looking into abbreviating the branch name in the shell code for the git part of the prompt. The author found a way to do it by making use of a particular colorising hook.


TLDR "Some first-draft-quality notes on incorporating git-related info into the shell prompt"


It's far less interesting than finding an exploit in git-shell, which was how I read the headline :|


yeah. that's why I posted the (sadly, downvoted) tldr you responded to: trying to help others avoid wasting time on the OP.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: