Re: Subject: [PATCH] Push to create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

> +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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux