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

Re: [PATCH] added -C option to chdir() into another directory first

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2009, 21:50 UTC
Message-ID
<7viqmwrhoy.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090226204423.GA34377@rufus.net>
kevin brintnall <kbrint@rufus.net> writes:
Show 18 quoted lines
> On Thu, Feb 26, 2009 at 12:35:57PM -0800, Junio C Hamano wrote:
>> kevin brintnall <kbrint@rufus.net> writes:
>> 
>> > This allows things like 'git -C /somewhere pull' without specifying both
>> > --work-tree and --git-dir.
>> 
>> Where should "git -C sub/dir apply this.patch" find the file "this.patch"?
>
> Good question..  It should probably come from the original $PWD.  Maybe we
> should have "-C $DIR" simulate "--work-tree=$DIR --git=dir=$DIR/.git" ?
>
>> More generally, when "git -C there cmd arg1 arg2 arg3..." is run, how
>> should the implementation of cmd learn what to prefix arg$N with?
>
> I envisioned these two as equivalent:
>
> 	git -C $DIR something
> 	cd $DIR ; git something

If that is the case then I really do not see the point, other than "there are _some_ tools like 'tar' that do it".

Sure, there are some tools that do many other things.  So what?
Previous: kevin brintnallNext: Michael J Gruber
Message 4 of 5 in “added -C option to chdir() into another directory first”
  1. added -C option to chdir() into another directory firstkevin brintnall, Feb 26, 2009
  2. Junio C HamanoFeb 26, 2009
  3. kevin brintnallFeb 26, 2009
  4. Junio C HamanoFeb 26, 2009
  5. Michael J GruberFeb 27, 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.