ephemient
2009-06-07 03:13:48
Don't use git-status. Use git-ls-files and git-diff / git-diff-files instead.
Jakub Narębski
2009-06-07 17:44:12
What’s wrong with git-status?
Bombe
2009-06-08 08:53:36
git-status is so called porcelain and it meant for user, and not for scripting. Its output can change without notice.
Jakub Narębski
2009-06-09 11:05:46
A:
You can use "git ls-files --modified --deleted --exclude-standard" to list all modified and deleted files (--exclude-standard
is not probably needed there, but just in case you want to list all unknown files that are not ignored with --other
...). You can then check if the output of this command is empty.
Or you can check the exit status of "git diff --quiet HEAD" if you want to check if "git commit -a" would pick up anything, or "git diff --cached --quiet HEAD" if you want to check if "git commit" would pick anything (or one of its plumbing relatives: git-diff-files
or git-diff-index
).
Jakub Narębski
2009-06-09 15:05:00