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

Re: [PATCH] git init: optionally allow a directory argument

From
Daniel Pittman <daniel@rimspace.net>
Date
Jul 25, 2009, 03:13 UTC
Message-ID
<87r5w5h2uy.fsf@rimspace.net>
In-Reply-To
<7vab2t64cg.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> Nanako Shiraishi <nanako3@lavabit.com> writes:
>
>> When starting a new repository, I see my students often say
>>     % git init newrepo
>> and curse git.  They could say
>>     % mkdir newrepo; cd newrepo; git init
>> but allowing it as an obvious short-cut may be nicer.
>>
>> Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
>
> Hmm, I didn't realize this is so common a wish among new people.  The patch
> seems clean.  Anybody has comments, both on code and the use case?

It still surprises me that git doesn't do this, since it is at odds with almost every other version control system I have on hand or experience with, other than CVS; Subversion, svk, Bazaar and Mercurial all take a trailing target argument.

CVS and monotone take an option to specify where; only darcs is like git and uses the current directory as the target.

So, from where I sit it makes sense to have 'git init foo' create a 'foo' directory and repository below the current location.

Regards,
        Daniel

...and, yeah, I still get caught every now and then when I create a new repository by hand.

-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons
Previous: Junio C HamanoNext: Alex Scarborough
Message 3 of 7 in “git init: optionally allow a directory argument”
  1. git init: optionally allow a directory argumentNanako Shiraishi, Jul 24, 2009
  2. Junio C HamanoJul 24, 2009
  3. Daniel PittmanJul 25, 2009
  4. Alex ScarboroughJul 25, 2009
  5. Junio C HamanoJul 25, 2009
  6. Johannes SixtJul 25, 2009
  7. Junio C HamanoJul 25, 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.