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

Re: [PATCH] Add missing inside_work_tree setting in setup_git_directory_gently

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 3, 2007, 11:38 UTC
Message-ID
<Pine.LNX.4.64.0711031138150.4362@racer.site>
In-Reply-To
<20071103100323.GA25305@laptop>
Hi,
On Sat, 3 Nov 2007, Nguyễn Thái Ngọc Duy wrote:
Show 20 quoted lines
> Without this, work_tree handling code in setup_git_directory
> will be activated. If you stay in root work tree (no prefix),
> it does not harm. It does if you work from a subdirectory though.
> 
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  Turns out my patch on NEED_WORK_TREE is fixing a wrong place.
> 
>  setup.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/setup.c b/setup.c
> index 145eca5..6f8f769 100644
> --- a/setup.c
> +++ b/setup.c
> @@ -240,6 +240,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
>  			if (chdir(work_tree_env) < 0)
>  				die ("Could not chdir to %s", work_tree_env);
>  			strcat(buffer, "/");
> +			inside_work_tree = 1;

I really have to wonder why this is needed, as it should be deduced (correctly!) when you ask is_inside_work_tree().

Ciao, Dscho

Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 2 of 11 in “Add missing inside_work_tree setting in setup_git_directory_gently”
  1. Add missing inside_work_tree setting in setup_git_directory_gentlyNguyễn Thái Ngọc Duy, Nov 3, 2007
  2. Johannes SchindelinNov 3, 2007
  3. Add missing inside_work_tree setting in setup_git_directory_gentlyNguyễn Thái Ngọc Duy, Nov 3, 2007
  4. Johannes SchindelinNov 3, 2007
  5. Junio C HamanoNov 4, 2007
  6. Nguyen Thai Ngoc DuyNov 4, 2007
  7. Junio C HamanoNov 7, 2007
  8. Johannes SchindelinNov 7, 2007
  9. Johannes SchindelinNov 9, 2007
  10. builtin-blame: set up the work_tree before the first file accessJohannes Schindelin, Nov 9, 2007
  11. Johannes SchindelinNov 3, 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.