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

Re: [PATCH 2/2] Add support for GIT_ONE_FILESYSTEM

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 17, 2010, 07:09 UTC
Message-ID
<4BA0802C.3020603@viscovery.net>
In-Reply-To
<1268777101-22122-3-git-send-email-lars@pixar.com>
Lars R. Damerow schrieb:
Show 7 quoted lines
> @@ -422,6 +429,14 @@ const char *setup_git_directory_gently(int *nongit_ok)
>  			}
>  			die("Not a git repository (or any of the parent directories): %s", DEFAULT_GIT_DIR_ENVIRONMENT);
>  		}
> +		if (one_filesystem) {
> +			if (stat("..", &buf))
> +				die_errno("failed to stat '%s/..'", getcwd(err_cwd, sizeof(err_cwd)-1));

When stat of .. fails, then it is not unlikely that getcwd fails, too. Then you would report the errno produced by getcwd.

But can't you avoid this getcwd()? The die() call in the context below uses cwd.

Show 8 quoted lines
> +			if (buf.st_dev != current_device)
> +				die("Not a git repository (or any parent up to %s/..)\n"
> +					"Stopping at filesystem boundary since GIT_ONE_FILESYSTEM is set.",
> +					getcwd(err_cwd, sizeof(err_cwd)-1));
> +		}
>  		if (chdir(".."))
>  			die_errno("Cannot change to '%s/..'", cwd);
>  	}
-- Hannes
Previous: Nguyen Thai Ngoc Duy
Message 5 of 5 in “Add support for GIT_ONE_FILESYSTEM (resubmission)”
  1. 0/2 Add support for GIT_ONE_FILESYSTEM (resubmission)Lars R. Damerow, Mar 16, 2010
  2. 1/2 config.c: remove static keyword from git_env_bool()Lars R. Damerow, Mar 16, 2010
  3. 2/2 Add support for GIT_ONE_FILESYSTEMLars R. Damerow, Mar 16, 2010
  4. Nguyen Thai Ngoc DuyMar 17, 2010
  5. Johannes SixtMar 17, 2010

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.