git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] Replace setenv(GIT_DIR_ENVIRONMENT, ...) with set_git_dir()

From
Steffen Prohaska <prohaska@zib.de>
Date
Nov 22, 2007, 06:13 UTC
Message-ID
<C50619A0-4A67-4968-8431-D7A685F723B7@zib.de>
In-Reply-To
<7v63zv9fel.fsf@gitster.siamese.dyndns.org>
On Nov 22, 2007, at 3:34 AM, Junio C Hamano wrote:
Show 16 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> Hi,
>>
>> On Wed, 21 Nov 2007, Steffen Prohaska wrote:
>>
>>> We have a function set_git_dir().  So let's use it, instead of  
>>> setting
>>> the evironment directly.
>>
>> Does this not have a fundamental issue?  When you call other git  
>> programs
>> with run_command(), you _need_ GIT_DIR to be set, no?
>
> It is much worse.  set_git_dir() does not just setenv() but does
> setup_git_env() as well.
What do your comments mean?

My understanding is that set_git_dir() sets the environment and then calls setup_git_env() to cache all pointers. This call updates dangling pointer if they have been cached earlier.

But maybe there is a hidden secret that I don't see.
	Steffen
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 18 in “msysgit fallout”
  1. 0/3 msysgit falloutSteffen Prohaska, Nov 21, 2007
  2. 1/3 sha1_file.c: Fix size_t related printf format warningsSteffen Prohaska, Nov 21, 2007
  3. 2/3 builtin-init-db: use get_git_dir() instead of getenv()Steffen Prohaska, Nov 21, 2007
  4. 3/3 Replace setenv(GIT_DIR_ENVIRONMENT, ...) with set_git_dir()Steffen Prohaska, Nov 21, 2007
  5. Johannes SchindelinNov 22, 2007
  6. Junio C HamanoNov 22, 2007
  7. Steffen ProhaskaNov 22, 2007
  8. Junio C HamanoNov 22, 2007
  9. Steffen ProhaskaNov 22, 2007
  10. Johannes SixtNov 22, 2007
  11. Steffen ProhaskaNov 22, 2007
  12. Johannes SchindelinNov 22, 2007
  13. Steffen ProhaskaJan 1, 2008
  14. Dmitry KakurinJan 3, 2008
  15. Steffen ProhaskaJan 3, 2008
  16. Dmitry KakurinJan 3, 2008
  17. Steffen ProhaskaJan 3, 2008
  18. Johannes SixtNov 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.