Re: Determining if a tree is clean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 6, 2010 at 13:23, Junio C Hamano <gitster@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]