From: Adam Mercer Date: Sat, 06 Mar 2010 20:33:22 GMT Subject: Re: Determining if a tree is clean Message-ID: <799406d61003061233w60633e26t4c2434042b7f216d@mail.gmail.com> In-Reply-To: <7vy6i5fe5h.fsf@alter.siamese.dyndns.org> On Sat, Mar 6, 2010 at 13:23, Junio C Hamano wrote: > It is expected that a Porcelain script that implements a custom feature > may call diff-files, diff-index and other plumbing commands many times > during its lifetime, and that it knows what it is doing (namely, when > it touches the working tree itself and why). Makes sense. > Your Porcelain script should look something like: > >    git update-index --refresh >    git diff-files -q || { echo "modified working tree"; exit 1 } >    git diff-index --cached -q HEAD || { echo "modified index"; exit 2 } > > See contrib/examples/*.sh for examples Thanks, Junio. That does the trick, I'd recently found the update-index command and had run into the problem (but not the solution) that the call to diff-files addresses. Cheers Adam