threads / discuss / 52293

git clone git clone some://url

Subject: git clone git clone some://url

## tl;dr

8 messages between Nov 19, 2019 and Dec 5, 2019.

replies: 7people: 5as markdown or json

Christoph Berg· Nov 19, 2019, 14:15 UTC · lore

On some git hosting sites [*], if you copy the repository URL, you'll actually get "git clone some://url" in the cut buffer. When you then proceed to do "git clone <paste>" in the next terminal window, the command executed is actually this:

$ git clone git clone some://url fatal: Too many arguments.

As silly as the idea might sound, could the clone command possibly ignore these very specific extra arguments, and just proceed? This has happened countless times to me, and when I mentioned the idea on #debian-devel, there were others who had the same problem.

Thanks, Christoph

[*] hello sourceforge! example:
    https://sourceforge.net/p/wsjt/wsjtx/ci/master/tree/
Junio C Hamano· Nov 20, 2019, 03:50 UTC · re: Christoph Berg · lore

Re: git clone git clone some://url

Christoph Berg <myon@debian.org> writes:
Show 7 quoted lines
> On some git hosting sites [*], if you copy the repository URL, you'll
> actually get "git clone some://url" in the cut buffer. When you then
> proceed to do "git clone <paste>" in the next terminal window, the
> command executed is actually this:
>
> $ git clone git clone some://url
> fatal: Too many arguments.
Or
    $ git git clone some://usr
    $ git git git diff
;-)

I seriously doubt "git" should do anything funky when fed such command lines.

Christoph Berg· Nov 20, 2019, 06:41 UTC · re: Junio C Hamano · lore

Re: git clone git clone some://url

Re: Junio C Hamano 2019-11-20 <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>
Show 19 quoted lines
> Christoph Berg <myon@debian.org> writes:
> 
> > On some git hosting sites [*], if you copy the repository URL, you'll
> > actually get "git clone some://url" in the cut buffer. When you then
> > proceed to do "git clone <paste>" in the next terminal window, the
> > command executed is actually this:
> >
> > $ git clone git clone some://url
> > fatal: Too many arguments.
> 
> Or
> 
>     $ git git clone some://usr
>     $ git git git diff
> 
> ;-)
> 
> I seriously doubt "git" should do anything funky when fed such
> command lines.

"git git git" is obviously silly. The problem is really just about this single issue:

1. go to some website, copy the git url
2. type "git clone" in the terminal
3. paste the url, hit enter
4. be annoyed when you ended up with "git clone git clone url://"
Christoph
Danh Doan· Nov 21, 2019, 13:49 UTC · re: Christoph Berg · lore

Re: git clone git clone some://url

On 2019-11-20 07:41:58+0100, Christoph Berg <myon@debian.org> wrote:
Show 28 quoted lines
> Re: Junio C Hamano 2019-11-20 <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>
> > Christoph Berg <myon@debian.org> writes:
> > 
> > > On some git hosting sites [*], if you copy the repository URL, you'll
> > > actually get "git clone some://url" in the cut buffer. When you then
> > > proceed to do "git clone <paste>" in the next terminal window, the
> > > command executed is actually this:
> > >
> > > $ git clone git clone some://url
> > > fatal: Too many arguments.
> > 
> > Or
> > 
> >     $ git git clone some://usr
> >     $ git git git diff
> > 
> > ;-)
> > 
> > I seriously doubt "git" should do anything funky when fed such
> > command lines.
> 
> "git git git" is obviously silly. The problem is really just about
> this single issue:
> 
> 1. go to some website, copy the git url
> 2. type "git clone" in the terminal
> 3. paste the url, hit enter
> 4. be annoyed when you ended up with "git clone git clone url://"

Seriously, people should stop pasting random command from internet without reading.

Someone had written about paste-hijacking in the past.
c.f. https://news.ycombinator.com/item?id=10554679
-- 
Danh
Denton Liu· Nov 20, 2019, 18:07 UTC · re: Junio C Hamano · lore

Re: git clone git clone some://url

On Wed, Nov 20, 2019 at 12:50:24PM +0900, Junio C Hamano wrote:
Show 14 quoted lines
> Christoph Berg <myon@debian.org> writes:
> 
> > On some git hosting sites [*], if you copy the repository URL, you'll
> > actually get "git clone some://url" in the cut buffer. When you then
> > proceed to do "git clone <paste>" in the next terminal window, the
> > command executed is actually this:
> >
> > $ git clone git clone some://url
> > fatal: Too many arguments.
> 
> Or
> 
>     $ git git clone some://usr
>     $ git git git diff

That's why I have `git config alias.git !git` set. It's saved me seconds of my life from having to retype these lines. ;)

Unfortunately, I don't think we can take a similar approach for the `git clone git clone ...` case.

Show 5 quoted lines
> ;-)
> 
> I seriously doubt "git" should do anything funky when fed such
> command lines.
> 
Junio C Hamano· Nov 22, 2019, 05:44 UTC · re: Denton Liu · lore

Re: git clone git clone some://url

Denton Liu <liu.denton@gmail.com> writes:
Show 7 quoted lines
>> Or
>> 
>>     $ git git clone some://usr
>>     $ git git git diff
>
> That's why I have `git config alias.git !git` set. It's saved me seconds
> of my life from having to retype these lines. ;)
;-)

Yes, it was the above hack of yours I had in mind when I sent my reply.

Jonathan Nieder· Dec 4, 2019, 21:40 UTC · re: Christoph Berg · lore

Re: git clone git clone some://url

Hi,
Christoph Berg wrote:
Show 7 quoted lines
> On some git hosting sites [*], if you copy the repository URL, you'll
> actually get "git clone some://url" in the cut buffer. When you then
> proceed to do "git clone <paste>" in the next terminal window, the
> command executed is actually this:
>
> $ git clone git clone some://url
> fatal: Too many arguments.

I feel your pain. Is there an issue tracker post or support ticket open for some of these hosting sites to make it do the intuitive thing (just copy the URL) instead?

Thanks, Jonathan

> [*] hello sourceforge! example:
>     https://sourceforge.net/p/wsjt/wsjtx/ci/master/tree/
Christoph Berg· Dec 5, 2019, 12:35 UTC · re: Jonathan Nieder · lore

Re: git clone git clone some://url

Re: Jonathan Nieder 2019-12-04 <20191204214017.GA195537@google.com>
Show 6 quoted lines
> > $ git clone git clone some://url
> > fatal: Too many arguments.
> 
> I feel your pain.  Is there an issue tracker post or support ticket
> open for some of these hosting sites to make it do the intuitive thing
> (just copy the URL) instead?
I created one for sf.net now: https://sourceforge.net/p/forge/feature-requests/721/
Christoph

← back to recent threads