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

Re: Init on push

From
FGFrancis Galiegue <fg@one2team.com>
Date
Nov 8, 2008, 20:44 UTC
Message-ID
<200811082144.25261.fg@one2team.com>
In-Reply-To
<7v3ai2c5sd.fsf@gitster.siamese.dyndns.org>
Le Saturday 08 November 2008 21:38:10 Junio C Hamano, vous avez écrit :
Show 19 quoted lines
> Francis Galiegue <fg@one2team.com> writes:
> > Le Saturday 08 November 2008 21:06:01 Jakub Narebski, vous avez écrit :
> >> Junio C Hamano wrote:
> >> >  - Teach "-D $there" option to "git init", which does an "mkdir -p $it
> >> > && chdird $it" before it does its work.
> >>
> >> Shouldn't it be "-C $there" (like make and tar)?
> >
> > I agree with that. It's pretty much a standard for quite a few "command
> > line people", insofar as I always look for such an option in case I want
> > to know whether a command has the ability to chdir() to a different
> > directory than the current one :p
>
> In this particular case, it is not "chdir() before starting" but "mkdir
> and then chdir() into it".  Using -C would be counterproductive.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
I have missed the mkdir part, but then here this is mkdir _-p_...

I mean, what is the cost of mkdir -p the/dir and then git init -C the/dir? I don't think it's that good an idea to have git create the directory in this case...

Think of what would happen if you git -D a/b, and a is a symlink to, where, somewhere (doesn't exist, exists but if you touch it you're {in trouble,good for jail time, whatever}).

I personnaly think that the directory creation SHOULD be created to the commands that are meant for it, just as git handles dir creation in its own space (a git repository).

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 6 83 87 78 75
Tel : +33 (0) 1 78 94 55 52
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris
Previous: Junio C HamanoNext: Francis Galiegue
Message 8 of 11 in “Init on push”
  1. Robin RosenbergNov 8, 2008
  2. Junio C HamanoNov 8, 2008
  3. Alexander GavrilovNov 8, 2008
  4. Junio C HamanoNov 8, 2008
  5. Jakub NarebskiNov 8, 2008
  6. Francis GaliegueNov 8, 2008
  7. Junio C HamanoNov 8, 2008
  8. Francis GaliegueNov 8, 2008
  9. Francis GaliegueNov 8, 2008
  10. Junio C HamanoNov 9, 2008
  11. Francis GaliegueNov 9, 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.