From: Eric Gerlach <egerlach@feds.uwaterloo.ca>
To: git@vger.kernel.org
Subject: Is "show-ref -h" a good test for an empty repository?
Date: Fri, 05 Sep 2008 20:45:34 -0400 [thread overview]
Message-ID: <48C1D2AE.3010001@feds.uwaterloo.ca> (raw)
Hi,
I'm trying to test to see if "git diff --cached" will fail because there
are no existing commits. I've come up with running "git show-ref -h -q"
and testing its return value. My hypothesis is: If and only if
git-show-ref succeeds then git-diff will succeed.
Are my logic and assumptions sound? I'm a bit out of my git comfort
zone here, so I'd like to get some validation from some people who know
better.
Thanks in advance for the help!
Cheers,
--
Eric Gerlach, Network Administrator
Federation of Students
University of Waterloo
p: (519) 888-4567 x36329
e: egerlach@feds.uwaterloo.ca
next reply other threads:[~2008-09-06 1:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-06 0:45 Eric Gerlach [this message]
2008-09-06 1:29 ` Is "show-ref -h" a good test for an empty repository? Jeff King
2008-09-07 14:21 ` Eric Gerlach
2008-09-07 15:50 ` Jeff King
2008-09-07 17:31 ` Junio C Hamano
2008-09-07 17:34 ` Jeff King
2008-09-08 13:24 ` Eric Gerlach
2008-09-08 14:42 ` Jeff King
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=48C1D2AE.3010001@feds.uwaterloo.ca \
--to=egerlach@feds.uwaterloo.ca \
--cc=git@vger.kernel.org \
/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).