From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] git-help: add "help.format" config variable.
Date: Fri, 14 Dec 2007 21:20:29 -0800 [thread overview]
Message-ID: <7vir30o7oi.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20071215055728.857b1924.chriscool@tuxfamily.org> (Christian Couder's message of "Sat, 15 Dec 2007 05:57:28 +0100")
Christian Couder <chriscool@tuxfamily.org> writes:
> Note that this patch also revert some recent changes in
> "git-browse-help" because they prevented to look for config
> variables in the global configuration file.
You are right, but I think git-sh-setup can further be simplified, as
NONGIT_OK users would just rely on the default behaviour of underlying
plumbing (most notably "git config").
I do not think your change to help.c is sufficient to work inside a
subdirectory. Here is an attempt to fix it on top of yours.
---
git-sh-setup.sh | 7 +------
help.c | 3 +++
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index b366761..270d559 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -124,13 +124,8 @@ get_author_ident_from_commit () {
# Make sure we are in a valid repository of a vintage we understand,
# if we require to be in a git repository.
-if test -n "$NONGIT_OK"
+if test -z "$NONGIT_OK"
then
- if git rev-parse --git-dir >/dev/null 2>&1
- then
- : ${GIT_DIR=.git}
- fi
-else
if [ -z "$SUBDIRECTORY_OK" ]
then
: ${GIT_DIR=.git}
diff --git a/help.c b/help.c
index af0a433..551b5b9 100644
--- a/help.c
+++ b/help.c
@@ -374,6 +374,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
}
else {
+ int nongit;
+
+ setup_git_directory_gently(&nongit);
git_config(git_help_config);
if (help_default_format)
parse_help_format(help_default_format);
prev parent reply other threads:[~2007-12-15 5:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-15 4:57 [PATCH v2] git-help: add "help.format" config variable Christian Couder
2007-12-15 5:20 ` Junio C Hamano [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=7vir30o7oi.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=chriscool@tuxfamily.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).