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

Re: [PATCH] rm: do not set a variable twice without intermediate reading.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2013, 19:01 UTC
Message-ID
<7vzjtd6qya.fsf@alter.siamese.dyndns.org>
In-Reply-To
<51EECFBB.3050406@googlemail.com>
Stefan Beller <stefanbeller@googlemail.com> writes:
Show 13 quoted lines
> On 07/23/2013 08:32 PM, Junio C Hamano wrote:
>> Interesting. This is ancient and dates back to 7612a1ef (git-rm:
>> honor -n flag., 2006-06-08).
> Originally it comes from d9b814cc97 (by Linus), which introduced:
> +	seen = NULL;
> +	if (pathspec) {
> +		for (i = 0; pathspec[i] ; i++)
> +			/* nothing */;
> +		seen = xmalloc(i);
> +		memset(seen, 0, i);
> +	}
>
> Then in 7612a1efdb0c the second seen assignment was made unconditional.

That is why I blamed the bug to 7612a1ef. Before that, without pathspec, directory traversal function were told not to report which ones were seen and which ones were not by passing seen=NULL.

Previous: Stefan Beller
Message 4 of 4 in “rm: do not set a variable twice without intermediate reading.”
  1. rm: do not set a variable twice without intermediate reading.Stefan Beller, Jul 23, 2013
  2. Junio C HamanoJul 23, 2013
  3. Stefan BellerJul 23, 2013
  4. Junio C HamanoJul 23, 2013

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.