On Sun, Oct 26, 2008 at 09:54:03PM +0000, Mike Clarke <clarkema@xxxxxxxxx> wrote: > a) fully 'clean' -- i.e., all changes checked in, no stashes; In case you want to ignore ignores: $ git ls-files -o otherwise: git ls-files -o --exclude-standard by 'stashes', I guess you mean those extra files, but using that term is confusing, given that stashes can be listed with git stash list and they are actually merge commits (so something totally different). > b) all changes checked in, but there are some stashes; or git update-index -q --refresh test -z "$(git diff-index --name-only HEAD --)" && echo "everything committed" > c) 'dirty' in some way -- new files, uncommitted changes, etc. git update-index -q --refresh test -z "$(git diff-index --name-only HEAD --)" && echo "dirty" see GIT-VERSION-GEN in git.git > 1) Is there already some way of doing this that I've overlooked? > 2) Would the preferred approach be an option (git status --is-clean) > or a sub-command (git is-clean)? A sub-command would probably result > in cleaner internal code, but would also clutter the interface. I guess you overlooked the fact that plumbing is supposed to be used from scripts and porcelain by the users. git status is porcelain, so in general just don't use it from scripts. > 3) Is a patch for such a feature likely to be accepted? I don't think so, see above.
Attachment:
pgpQ8NYdV84n3.pgp
Description: PGP signature