From: Yann Dirson <ydirson@altern.org>
To: git@vger.kernel.org
Subject: [PATCH] Improve documentation for git-sh-setup.
Date: Fri, 22 Feb 2008 00:01:28 +0100 [thread overview]
Message-ID: <20080221230101.27644.49229.stgit@gandelf.nowhere.earth> (raw)
Signed-off-by: Yann Dirson <ydirson@altern.org>
Cc: Pierre Habouzit <madcoder@debian.org>
---
Documentation/git-sh-setup.txt | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt
index 16b8b75..75e6846 100644
--- a/Documentation/git-sh-setup.txt
+++ b/Documentation/git-sh-setup.txt
@@ -19,12 +19,25 @@ Porcelain-ish scripts and/or are writing new ones.
The `git-sh-setup` scriptlet is designed to be sourced (using
`.`) by other shell scripts to set up some variables pointing at
the normal git directories and a few helper shell functions.
+It also provides help messages, and some amount of command-line
+parsing.
-Before sourcing it, your script should set up a few variables;
-`USAGE` (and `LONG_USAGE`, if any) is used to define message
-given by `usage()` shell function. `SUBDIRECTORY_OK` can be set
-if the script can run from a subdirectory of the working tree
-(some commands do not).
+Before sourcing it, your script should set up a few variables.
+
+`OPTIONS_SPEC` allows to declare the options so that the command-line
+can be pre-processed, and the usage message autogenerated. It must
+follow the rules which apply to arguments to `git rev-parse
+--parseopt`. If you need `git-rev-parse --parseopt` to keep the `--`
+the user may have passed to your command, you should also set
+`OPTIONS_KEEPDASHDASH` to a non empty value.
+
+If the constraints imposed by the use of `git rev-parse` do not fit
+for a particular tool, `USAGE` (and `LONG_USAGE`, if any) can be used
+to define message given by `usage()` shell function; no command-line
+pre-processing occurs, the script has entire control over it.
+
+`SUBDIRECTORY_OK` can be set if the script can run from a subdirectory
+of the working tree (some commands do not).
The scriptlet sets `GIT_DIR` and `GIT_OBJECT_DIRECTORY` shell
variables, but does *not* export them to the environment.
next reply other threads:[~2008-02-21 23:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 23:01 Yann Dirson [this message]
2008-02-22 9:35 ` [PATCH] Improve documentation for git-sh-setup Pierre Habouzit
2008-02-22 17:17 ` Junio C Hamano
2008-02-22 18:19 ` Pierre Habouzit
2008-02-23 14:09 ` [PATCH] parse-opt: bring PARSE_OPT_HIDDEN to git-rev-parse --parseopt Pierre Habouzit
2008-02-24 8:42 ` Junio C Hamano
2008-02-24 8:49 ` Pierre Habouzit
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=20080221230101.27644.49229.stgit@gandelf.nowhere.earth \
--to=ydirson@altern.org \
--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).