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

Re: infinite loop in git-send-email with alias files

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Jul 23, 2009, 12:30 UTC
Message-ID
<4A6857FF.5070401@viscovery.net>
In-Reply-To
<20090723110928.GC4247@coredump.intra.peff.net>
Jeff King schrieb:
Show 8 quoted lines
> +my %EXPANDED_ALIASES;
> +sub expand_one_alias {
> +	my $alias = shift;
> +	if ($EXPANDED_ALIASES{$alias}) {
> +		die "fatal: alias '$alias' expands to itself\n";
> +	}
> +	local $EXPANDED_ALIASES{$alias} = 1;
> +	return $aliases{$alias} ? expand_aliases(@{$aliases{$alias}}) : $alias;

What does 'local' make local here? Only the assignment of the slot $EXPANDED_ALIASES{$alias}? Or the whole %EXPANDED_ALIASES? If the latter, does this copy the existing %EXPANDED_ALIASES before the assignment is made; otherwise, how can this work if only ever a single slot of %EXPANDED_ALIASES is filled in?

(Disclaimer: I'm not a perl expert, obviously, and I didn't test your patch.)
-- Hannes
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “infinite loop in git-send-email with alias files”
  1. Mike FrysingerJul 17, 2009
  2. Jeff KingJul 23, 2009
  3. Johannes SixtJul 23, 2009
  4. Jeff KingJul 23, 2009

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.