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

Re: index-pack outside of repository?

From
Jeff King <peff@peff.net>
Date
Dec 16, 2016, 21:44 UTC
Message-ID
<20161216214424.o3x4xqttrao3i73v@sigill.intra.peff.net>
In-Reply-To
<xmqqlgvfso16.fsf@gitster.mtv.corp.google.com>
On Fri, Dec 16, 2016 at 10:54:13AM -0800, Junio C Hamano wrote:
Show 26 quoted lines
> I am tempted to suggest an intermediate step that comes before
> b1ef400eec ("setup_git_env: avoid blind fall-back to ".git"",
> 2016-10-20), which is the attached, and publish that as part of an
> official release.  That way, we'll see what is broken without
> hurting people too much (unless they or their scripts care about
> extra message given to the standard error stream).  I suspect that
> released Git has a slightly larger user base than what is cooked on
> 'next'.
> 
>  environment.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/environment.c b/environment.c
> index 0935ec696e..88f857331e 100644
> --- a/environment.c
> +++ b/environment.c
> @@ -167,8 +167,11 @@ static void setup_git_env(void)
>  	const char *replace_ref_base;
>  
>  	git_dir = getenv(GIT_DIR_ENVIRONMENT);
> -	if (!git_dir)
> +	if (!git_dir) {
> +		if (!startup_info->have_repository)
> +			warning("BUG: please report this at git@vger.kernel.org");
>  		git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
> +	}

Yes, I think this is a nice way to ease into the change. I wish I had thought of it when doing the original series, and we could have shipped it in v2.11. :)

-Peff
Previous: Junio C Hamano
Message 14 of 14 in “index-pack outside of repository?”
  1. Jeff KingDec 15, 2016
  2. Junio C HamanoDec 16, 2016
  3. Jeff KingDec 16, 2016
  4. Jeff KingDec 16, 2016
  5. 1/3 t5000: extract nongit function to test-lib-functions.shJeff King, Dec 16, 2016
  6. 2/3 index-pack: complain when --stdin is used outside of a repoJeff King, Dec 16, 2016
  7. 3/3 t: use nongit() function where applicableJeff King, Dec 16, 2016
  8. Junio C HamanoDec 16, 2016
  9. Junio C HamanoDec 16, 2016
  10. Junio C HamanoDec 16, 2016
  11. Jeff KingDec 16, 2016
  12. Junio C HamanoDec 16, 2016
  13. Junio C HamanoDec 16, 2016
  14. Jeff KingDec 16, 2016

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.