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

Re: [PATCH] Allow an alias to start with "-p"

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 25, 2006, 06:18 UTC
Message-ID
<Pine.LNX.4.63.0607250813450.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<20060725050312.GA5618@coredump.intra.peff.net>
Hi,
On Tue, 25 Jul 2006, Jeff King wrote:
Show 10 quoted lines
> On Mon, Jul 24, 2006 at 02:10:45PM +0200, Johannes Schindelin wrote:
> 
> > @@ -264,6 +289,7 @@ int main(int argc, const char **argv, ch
> >  	if (!strncmp(cmd, "git-", 4)) {
> >  		cmd += 4;
> >  		argv[0] = cmd;
> > +		handle_alias(&argc, &argv);
> >  		handle_internal_command(argc, argv, envp);
> >  		die("cannot handle %s internally", cmd);
> >  	}

My fault. This was a left-over from my original alias patch. (I did a merge, and just used "git-diff next" instead of "git-diff --merge next". <Clickety-click/> Nope, that would not have worked either.

> Patch is below (wow, that +++ is kind of ugly!).
Same here.
Show 7 quoted lines
> git: choose internal commands over aliases for git-*
> 
> This is especially important because some commands (like init-db) don't
> require a working GIT_DIR, and alias expansion tries to look at it. It
> also matches the behavior of "git cmd".
> 
> Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Show 9 quoted lines
> @@ -289,8 +289,8 @@ int main(int argc, const char **argv, ch
>  	if (!strncmp(cmd, "git-", 4)) {
>  		cmd += 4;
>  		argv[0] = cmd;
> -		handle_alias(&argc, &argv);
>  		handle_internal_command(argc, argv, envp);
> +		handle_alias(&argc, &argv);
>  		die("cannot handle %s internally", cmd);
>  	}

Alternatively, you can just delete it. IIRC we decided that aliases with "git-" commands do not make sense.

Ciao, Dscho

Previous: Jeff KingNext: Junio C Hamano
Message 7 of 8 in “Allow an alias to start with "-p"”
  1. Allow an alias to start with "-p"Johannes Schindelin, Jul 18, 2006
  2. Junio C HamanoJul 24, 2006
  3. Allow an alias to start with "-p"Johannes Schindelin, Jul 24, 2006
  4. Junio C HamanoJul 25, 2006
  5. Johannes SchindelinJul 25, 2006
  6. Jeff KingJul 25, 2006
  7. Johannes SchindelinJul 25, 2006
  8. Junio C HamanoJul 25, 2006

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.