threads / discuss / 47042

Why does fetch-pack not works over http?

Subject: Why does fetch-pack not works over http?

## tl;dr

3 messages between Oct 27, 2017 and Oct 30, 2017.

replies: 2people: 2as markdown or json

Alvaro del Castillo· Oct 27, 2017, 10:42 UTC · lore
Dear all,

We're wondering why "fetch-pack" (when is running from the command line) doesn't handle "https://" protocol. It only works with "git://".

For instance, this doesn't work:

$ git fetch-pack https://github.com/git/git refs/heads/master fatal: I don't handle protocol 'https'

while this does:
$ git fetch-pack git://github.com/git/git refs/heads/master

The funny thing is that under the hood, "fetch" calls "fetch-pack" using "https" procotol. Example of a trace below:

12:03:07.512558 git.c:344               trace: built-in: git 'fetch- pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' 'https://githu b.com/git/git/'

Cheers
-- 
Alvaro del Castillo San Félix
acs@bitergia.com - Chief Technical Officer (CTO)
http://www.bitergia.com
"Software metrics for your peace of mind"
Andreas Schwab· Oct 27, 2017, 12:33 UTC · re: Alvaro del Castillo · lore

Re: Why does fetch-pack not works over http?

On Okt 27 2017, Alvaro del Castillo <acs@bitergia.com> wrote:
Show 18 quoted lines
> We're wondering why "fetch-pack" (when is running from the command
> line) doesn't handle "https://" protocol. It only works with "git://".
>
> For instance, this doesn't work:
>
> $ git fetch-pack https://github.com/git/git refs/heads/master
> fatal: I don't handle protocol 'https'
>
> while this does:
>
> $ git fetch-pack git://github.com/git/git refs/heads/master
>
> The funny thing is that under the hood, "fetch" calls "fetch-pack"
> using "https" procotol. Example of a trace below:
>
> 12:03:07.512558 git.c:344               trace: built-in: git 'fetch-
> pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' 'https://githu
> b.com/git/git/'

With --stateless-rpc, fetch-pack doesn't do the connect itself, but expects the caller having set up a pipe to it. The URL is then actually ignored.

Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Alvaro del Castillo· Oct 30, 2017, 16:58 UTC · re: Andreas Schwab · lore

Re: Why does fetch-pack not works over http?

Hi Andreas,
El vie, 27-10-2017 a las 14:33 +0200, Andreas Schwab escribió:
Show 28 quoted lines
> On Okt 27 2017, Alvaro del Castillo <acs@bitergia.com> wrote:
> 
> > 
> > We're wondering why "fetch-pack" (when is running from the command
> > line) doesn't handle "https://" protocol. It only works with
> > "git://".
> > 
> > For instance, this doesn't work:
> > 
> > $ git fetch-pack https://github.com/git/git refs/heads/master
> > fatal: I don't handle protocol 'https'
> > 
> > while this does:
> > 
> > $ git fetch-pack git://github.com/git/git refs/heads/master
> > 
> > The funny thing is that under the hood, "fetch" calls "fetch-pack"
> > using "https" procotol. Example of a trace below:
> > 
> > 12:03:07.512558 git.c:344               trace: built-in: git
> > 'fetch-
> > pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' 'https://g
> > ithu
> > b.com/git/git/'
> With --stateless-rpc, fetch-pack doesn't do the connect itself, but
> expects the caller having set up a pipe to it.  The URL is then
> actually
> ignored.

Ok, I have understood that reading the git code but, is it possible to create this pipe using command line? Or is that something designed to be used inside the git execution?

Thanks!
> 
> Andreas.
> 
-- 
Alvaro del Castillo San Félix
acs@bitergia.com - Chief Technical Officer (CTO)
http://www.bitergia.com
"Software metrics for your peace of mind"

← back to recent threads