Live data from Hacker News

A heads up display for git

github.com

51–60 of 62 posts

Re: A heads up display for git

#51

Earlier quoted context omitted.

Have you thought about using an asynchronously rendered prompt?

That sounds disconcerting and distracting; I don't want my prompt to change while I'm typing a command. If I already have a command prompt, I can type "git status" easily enough. Also, how would that work?

It's not that bad actually - I've been using one since February. Here's a demo (+ code): http://www.anishathalye.com/2015/02/07/an-asynchronous-shell...

Re: A heads up display for git

#52

Earlier quoted context omitted.

That sounds disconcerting and distracting; I don't want my prompt to change while I'm typing a command. If I already have a command prompt, I can type "git status" easily enough. Also, how would that work?

It's not that bad actually - I've been using one since February. Here's a demo (+ code): http://www.anishathalye.com/2015/02/07/an-asynchronous-shell...

Ah, I see. Interesting zsh magic, and the right-prompt mechanism makes it more palatable. Two issues, though. First, I use bash. Second, and more importantly, you're using the same temporary file for all shells, so the prompts from different shells (in different working directories) will overwrite each other.

Re: A heads up display for git

#54
post #26

I use oh-my-git for a similar purpose. https://github.com/arialdomartini/oh-my-git Took some wrangling to get the fonts to work, but I find it to be quite helpful. The README is especially nice.

Wouldn't custom fonts lead to a problem when using ssh ?

Re: A heads up display for git

#55

Earlier quoted context omitted.

It's not that bad actually - I've been using one since February. Here's a demo (+ code): http://www.anishathalye.com/2015/02/07/an-asynchronous-shell...

Ah, I see. Interesting zsh magic, and the right-prompt mechanism makes it more palatable. Two issues, though. First, I use bash. Second, and more importantly, you're using the same temporary file for all shells, so the prompts from different shells (in different working directories) will overwrite each other.

Yeah, not sure if/how to do this in bash :P

Yeah, I thought about using a different temp file per shell, and I did use that for some time, but that got annoying when shells didn't exit gracefully and clean up the temp file.

I don't actually care about race conditions (okay, the wrong prompt may be displayed once, big deal), and it doesn't actually happen in real use because of the way timing works out.

Re: A heads up display for git

#56
post #9

I use a modified version of mislav's git prompt https://gist.github.com/mislav/1712320 which is pretty minimal but usually enough for me. For when I have to wrangle lots of files at once (like during interactive rebase to clean up history before push) I have a git watch alias that shows a high-level overview of changes that refreshes with inotify: [alias] watch = "!clear;inotifywait --quiet -mr -e modify,move,create,…

On my machine (archlinux, xterm) it flickers, as if there was a loop. Anybody sees the same ?

Re: A heads up display for git

#57
post #54
post #26

I use oh-my-git for a similar purpose. https://github.com/arialdomartini/oh-my-git Took some wrangling to get the fonts to work, but I find it to be quite helpful. The README is especially nice.

Wouldn't custom fonts lead to a problem when using ssh ?

I just got the fonts working in iTerm2 and after that I didn't have any issues that I recall.

Re: A heads up display for git

#58
post #19

Earlier quoted context omitted.

I wonder if an asynchronous approach could be implemented. Like starting the git status and the likes in a separate process and killing it after a certain timeout if it takes too long. While I like that there is a .noprompt feature it's mainly a workaround. Maybe there could be a toggle feature where the user can turn on and off the git prompt on demand, wouldn't be hard to implement. Maybe I will start hacking on it…

It can be done, and it actually works quite well. See this post for a demo + code: http://www.anishathalye.com/2015/02/07/an-asynchronous-shell...

Well this is awesome, thanks for the link.

Re: A heads up display for git

#59
post #9

I use a modified version of mislav's git prompt https://gist.github.com/mislav/1712320 which is pretty minimal but usually enough for me. For when I have to wrangle lots of files at once (like during interactive rebase to clean up history before push) I have a git watch alias that shows a high-level overview of changes that refreshes with inotify: [alias] watch = "!clear;inotifywait --quiet -mr -e modify,move,create,…

On my machine (archlinux, xterm) it flickers, as if there was a loop. Anybody sees the same ?

If you add an

  echo "$file"
inside the while loop, what do you see?

I deliberately set the .git directory to be ignored (using @) to avoid tons of repeating when the index.lock file is repeatedly recreated. Maybe that's what's going on here.

Re: A heads up display for git

#60
post #59

Earlier quoted context omitted.

On my machine (archlinux, xterm) it flickers, as if there was a loop. Anybody sees the same ?

If you add an echo "$file" inside the while loop, what do you see? I deliberately set the .git directory to be ignored (using @ ) to avoid tons of repeating when the index.lock file is repeatedly recreated. Maybe that's what's going on here.

index.lock CREATE index.lock DELETE

alternating very fast.

Post reply on HN