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

Re: [PATCH] Support for configurable git command aliases (v2)

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 4, 2006, 23:31 UTC
Message-ID
<Pine.LNX.4.64.0606041621010.5498@g5.osdl.org>
In-Reply-To
<20060604212050.GV10488@pasky.or.cz>
On Sun, 4 Jun 2006, Petr Baudis wrote:
> 
> And I forgot to mention that it also adds the interactivity test
> requested by Janek - aliases are now interpreted only when stdout is a
> tty.
I don't think that's a good test.
The fact is, I do
	git diff | less -S

all the time, and if I start doing aliases, I'd expect them to work the same regardless of whether I piped the output to "less" or not.

Also, a lot of scripts have stdout going to the regular stdout, so I don't think it's even a sufficient test for scripting anyway.

So I would suggest some other way to suppress aliases if we need it, not based on "isatty()" and frields.

But I suspect that the easiest solution is to just disallow aliases of real built-ins. I realize it could be cool, but the fact is, it's also extremely confusing if "git diff" does something else than what it's supposed to do, and it _will_ break scripts.

The alternatives is to
 - not do aliases for the "git-xyzzy" format
 - and add a special environment flag ("GIT_NO_ALIASES") to allow scripts 
   to easily disable aliases (and add a "export GIT_NO_ALIASES" line to 
   the git-sh-setup.sh script)
Hmm?
		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 12 in “Support for configurable git command aliases (v2)”
  1. Support for configurable git command aliases (v2)Petr Baudis, Jun 4, 2006
  2. Petr BaudisJun 4, 2006
  3. Martin MaresJun 4, 2006
  4. Petr BaudisJun 4, 2006
  5. Junio C HamanoJun 4, 2006
  6. Linus TorvaldsJun 4, 2006
  7. "git --less cmd" to page anywhereJunio C Hamano, Jun 6, 2006
  8. Linus TorvaldsJun 7, 2006
  9. Petr BaudisJun 7, 2006
  10. Linus TorvaldsJun 7, 2006
  11. Martin LanghoffJun 7, 2006
  12. Linus TorvaldsJun 7, 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.