From: Adam Mercer <ramercer@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Determining if a tree is clean
Date: Sat, 6 Mar 2010 14:33:22 -0600 [thread overview]
Message-ID: <799406d61003061233w60633e26t4c2434042b7f216d@mail.gmail.com> (raw)
In-Reply-To: <7vy6i5fe5h.fsf@alter.siamese.dyndns.org>
On Sat, Mar 6, 2010 at 13:23, Junio C Hamano <gitster@pobox.com> 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
prev parent reply other threads:[~2010-03-06 21:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-06 15:12 Determining if a tree is clean Adam Mercer
2010-03-06 19:23 ` Junio C Hamano
2010-03-06 20:33 ` Adam Mercer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=799406d61003061233w60633e26t4c2434042b7f216d@mail.gmail.com \
--to=ramercer@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).