From: Matthias Lederhofer <matled@gmx.net>
To: git@vger.kernel.org
Subject: Re: [PATCH/RFC] introduce GIT_WORK_TREE environment variable
Date: Thu, 29 Mar 2007 10:22:03 +0200 [thread overview]
Message-ID: <20070329082202.GA4974@moooo.ath.cx> (raw)
In-Reply-To: <20070328141505.GA16600@moooo.ath.cx>
Matthias Lederhofer <matled@gmx.net> wrote:
> + git_config(git_setup_config);
When $GIT_DIR was not set and the repository is found as a .git
directory $GIT_DIR will be the full path to the .git directory when
calling git_config(). git_config() calls git_path() which calls
get_git_dir() which calls getenv("GIT_DIR").
I'm not sure this is defined behaviour at all:
char *foo = getenv("FOO");
unsetenv("FOO");
Does foo still point to the old content of the FOO environment
variable? If it does get_git_dir() will always return the full path
to the repository directory.
I can think of two ways to solve this (in case this is a problem):
1. Add a function to environment.c which will cause setup_git_env to
be called again (either directly or by setting all the pointers to
NULL again).
2. Use git_config_from_file() instead of git_config(). This will
probably duplicate code from git_config().
next prev parent reply other threads:[~2007-03-29 8:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 14:15 [PATCH/RFC] introduce GIT_WORK_TREE environment variable Matthias Lederhofer
2007-03-28 15:45 ` Johannes Sixt
2007-03-29 8:22 ` Matthias Lederhofer [this message]
2007-04-04 14:08 ` Matthias Lederhofer
2007-04-04 16:59 ` Dana How
2007-04-04 18:45 ` Junio C Hamano
2007-04-04 21:04 ` Matthias Lederhofer
2007-04-04 20:09 ` [PATCH] export setup_git_env() Matthias Lederhofer
2007-04-04 20:13 ` [PATCH(amend)] introduce GIT_WORK_TREE environment variable Matthias Lederhofer
2007-04-04 22:34 ` Junio C Hamano
2007-04-06 13:21 ` Matthias Lederhofer
2007-04-11 1:29 ` Junio C Hamano
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=20070329082202.GA4974@moooo.ath.cx \
--to=matled@gmx.net \
--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).