2 ms·
So what's a good example of a git command that you might reasonably run as part of your $PS1 that runs an external program? It's not like people have git push o
by zarzavat 5y ago
So what's a good example of a git command that you might reasonably run as part of your $PS1 that runs an external program? It's not like people have git push or git commit in their $PS1.
- faho 5y ago`git status`. This essentially has a "prompt" mode with `--porcelain`, which can even print branch and stash state, so it features all of the information for a prompt. Prompts have been mentioned in adding the v2 porcelain format[0] It will call the fsmonitor hook configured in core.fsmonitor - this is supposed to speed up figuring out which files to check. The official git-prompt.sh calls `git diff`, which will do the same[1]. [0]: https://github.com/git/git/commit/00d27937bf0348e7da615f04b65f535a58e096c1 https://github.com/git/git/commit/00d27937bf0348e7da615f04b6... [1]: https://github.com/git/git/blob/11cfe552610386954886543f5de87dcc49ad5735/contrib/completion/git-prompt.sh#L528 https://github.com/git/git/blob/11cfe552610386954886543f5de8...