0

I'm almost done constructing my own bash prompt. I understand how to parse git commands and show how ahead/behind one is from the remote. However, this is only useful if git fetch is first called, and I've seen some repos that do so asynchronously. Calling git fetch within each prompt reload takes ~.3 seconds each time; would it be worth it to investigate this, and how would one do so?

  • 4
    If you'd like to do a periodic fetch, consider how often you'd like to do it. If it's, say, once an hour, or N times per day, consider using a cron job (on Linux-like systems this is pretty easy to set up). – torek Aug 07 '20 at 00:58
  • 2
    If you really want to do this on every prompt (which seems like hammering if it's not your server) asynchronously like you describe, you'll probably have more luck with zsh or fish than bash. Cron job sounds more pragmatic. – that other guy Aug 07 '20 at 01:19
  • Thank you, after all software like PyCharm automatically do that; I should've realized that. – Barrett Ruth Aug 07 '20 at 01:36

0 Answers0