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

Re: [PATCH] -C/--chdir command line option

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 20, 2008, 05:41 UTC
Message-ID
<7vhc774ydr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7vr66b50gy.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> The only excuse I remember seeing in the thread was that "make has '-C'
> option, so let's have it, because it is similar", which does not justfiy
> addition of that option to git at all to me.

Just after having said that "make has it, so let's have it ourselves, too" is a non-excuse to any feature bloat, one thing I could accept a patch to imitate what "make" does, especially if we are going to actually clean up the startup sequence like we have discussed sometime ago to fix breakage around --work-tree, is to have VAR=VAL (e.g. "make CFLAGS=-O2") on the command line. We could use that syntax to allow configuration variables to be overridden, like so:

	$ git core.whitespace=cr-at-eol log -p master..next

I wouldn't however suggest allowing the syntax to set environment variables, like:

	$ git GIT_AUTHOR_NAME="A U Thor" commit
as this is something your shell lets you do easily, i.e:
	$ GIT_AUTHOR_NAME="A U Thor" git commit

But overriding some configuration variables for a single command invocation is not something you can do without actually editing the configuration file for some variables, so the former would be justified.

Previous: Junio C HamanoNext: Alex Riesen
Message 7 of 10 in “-C/--chdir command line option”
  1. -C/--chdir command line optionMaciej Pasternacki, Oct 19, 2008
  2. Jeff KingOct 19, 2008
  3. Maciej PasternackiOct 19, 2008
  4. Jeff KingOct 19, 2008
  5. Maciej PasternackiOct 19, 2008
  6. Junio C HamanoOct 20, 2008
  7. Junio C HamanoOct 20, 2008
  8. Alex RiesenOct 20, 2008
  9. Michael J GruberOct 20, 2008
  10. Nguyen Thai Ngoc DuyOct 20, 2008

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.