Christian Couder [off-list ref] 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);