Re: Subject: [PATCH] Push to create
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Mar 3, 2009, 21:08 UTC
- Message-ID
- <alpine.LNX.1.00.0903031558490.19665@iabervon.org>
- In-Reply-To
- <7vy6vnf3aw.fsf@gitster.siamese.dyndns.org>
On Mon, 2 Mar 2009, Junio C Hamano wrote:
Show 16 quoted lines
> Jeff King <peff@peff.net> writes: > > > If you are going to limit it in that way, wouldn't it be better to do it > > entirely client-side? As in, "git push --create remote" will literally > > do: > > > > ssh remote_host "mkdir -p remote_dir && cd remote_dir && git init --bare" > > > > ? Then you don't have to care about whether the remote side is recent > > enough to support this, and there are no potential security issues; git > > is merely saving you from typing the commands you could have done > > yourself. > > As with the previous "git init --remote" patch, my design constraints > includes keeping the door open for "git shell" users to optionally allow > this mode of operation.
One possibility would be to allow "git init" to create the directory (and its parents) if it is able. Then the command is "ssh remote_host GIT_DIR=remote_dir git init --bare". The "git shell" users can't use it, but only because "git shell" won't run "git init". But there's no reason it couldn't be configured (per-site or per-user) to allow it. Also, git-init could run the template's "pre-init" hook to do whatever it is that needs to be done for a new repository.
-Daniel *This .sig left intentionally blank*