From: Jeff King <peff@peff.net>
To: Romain Geissler <romain.geissler@gmail.com>
Cc: git@vger.kernel.org, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Subject: Re: Git global usage and tests
Date: Mon, 30 May 2011 11:36:20 -0400 [thread overview]
Message-ID: <20110530153620.GA24431@sigill.intra.peff.net> (raw)
In-Reply-To: <754E784F-51C6-4B8D-B15D-3FF8B7AF1321@gmail.com>
On Mon, May 30, 2011 at 04:58:14PM +0200, Romain Geissler wrote:
> Indeed the test t2050-git-dir-relative.sh run :
>
> echo changed >top &&
> git --git-dir subdir/.git add top &&
> git --git-dir subdir/.git commit -m topcommit &&
> test -r "${COMMIT_FILE}"
>
> But according to the git help, it should have specified a git-dir with --git-dir=value ie
> git --git-dir=subdir/.git add top
The test is OK. Long options that have a required argument can be
expressed as either:
--long-option=value
or
--long-option value
Long options with an optional argument must use the first form, as the
second one is ambiguous (is "value" the value, or the next option?).
Your option parser needs to follow these rules to be compatible with
git. Have you considered pulling the parse-options parser from git into
libgit2? It's one of the more modularized and lib-ified bits of code in
git already.
-Peff
next prev parent reply other threads:[~2011-05-30 15:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-30 14:58 Git global usage and tests Romain Geissler
2011-05-30 15:36 ` Jeff King [this message]
2011-05-30 16:10 ` Romain Geissler
2011-05-30 16:12 ` Jeff King
2011-05-31 5:12 ` Miles Bader
2011-05-31 9:05 ` Carlos Martín Nieto
2011-05-31 5:19 ` Junio C Hamano
2011-05-31 11:52 ` Ævar Arnfjörð Bjarmason
2011-05-31 15:04 ` 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=20110530153620.GA24431@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=romain.geissler@gmail.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).