Re: Subject: [PATCH] Push to create
- From
Jeff King <peff@peff.net>
- Date
- Mar 3, 2009, 07:09 UTC
- Message-ID
- <20090303070937.GB30609@coredump.intra.peff.net>
- In-Reply-To
- <7vwsb7gkvt.fsf_-_@gitster.siamese.dyndns.org>
On Mon, Mar 02, 2009 at 10:50:46PM -0800, Junio C Hamano wrote:
> I am not at all convinced that the use case people would for whatever > reason do not want to "ssh-in, create and then push from here" is limited > to "your own playpen in your $HOME", but it certainly limits the > complexity and the scope of the damage.
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.
Show 6 quoted lines
> +test_expect_success 'push into nonexisting repository' ' > + this=$(git rev-parse B) && > + git push "file://$(pwd)/not-here.git" B:refs/heads/master && > + that=$(GIT_DIR=not-here.git git rev-parse HEAD) && > + test "$this" = "$that" > +'
I think a feature like this needs to be triggered manually via "--create" or similar. Otherwise a typo on a regular push will be very confusing as your pushes appear to go nowhere. Though I suppose most regular pushes happen using a configured remote, in which case it is not as much of an issue.
-Peff