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

Re: [PATCH] Extend runtime prefix computation

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 18, 2016, 07:20 UTC
Message-ID
<alpine.DEB.2.20.1604180918500.2967@virtualbox>
In-Reply-To
<xmqqfuumddqm.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Fri, 15 Apr 2016, Junio C Hamano wrote:
Show 12 quoted lines
> Michael Weiser <michael.weiser@gmx.de> writes:
> 
> > Make git fully relocatable at runtime extending the runtime prefix
> > calculation. Handle absolute and relative paths in argv0. Handle no path
> > at all in argv0 in a system-specific manner.  Replace assertions with
> > initialised variables and checks that lead to fallback to the static
> > prefix.
> 
> That's a dense description of "what" without saying much about
> "why".  Hint: start by describing what case(s) the current code
> fails to find the correct runtime prefix.  That would give readers a
> better understanding of what problem you are trying to solve.

I have to admit that I am really, *really* skeptical. To me, it looks like this patch opens the door very wide to unintended consequences.

Show 7 quoted lines
> >  #ifdef RUNTIME_PREFIX
> > -	assert(argv0_path);
> > -	assert(is_absolute_path(argv0_path));
> 
> Aren't these protecting against future and careless change that
> forgets to call extract-argv0-path or make that function return
> something that is not an absolute path?

This (first) assert() indeed saved me a couple of times from hunting for bugs in the wrong place. Let's keep it.

Ciao, Dscho

Previous: Junio C HamanoNext: Michael Weiser
Message 3 of 4 in “Extend runtime prefix computation”
  1. Extend runtime prefix computationMichael Weiser, Apr 15, 2016
  2. Junio C HamanoApr 15, 2016
  3. Johannes SchindelinApr 18, 2016
  4. Michael WeiserApr 20, 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.