git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Partial clone fails with file:/// URI

From
Nipunn Koorapati <nipunn1313@gmail.com>
Date
Oct 14, 2020, 17:04 UTC
Message-ID
<CAN8Z4-XGbb_z3vmJYATONmBkxBcfxwyC-_4XEOkP0sxsdT9wxw@mail.gmail.com>
In-Reply-To
<20201014165607.GA2044338@nand.local>
Hi,

I've been building git from source and directly using the executable. Roughly ``` cd git make cd .. git/git clone --filter=blob:none file://$(pwd)/git a_clone_of_git ```

This is what I was missing: git config uploadpack.allowanysha1inwant true

If this is not set, then the checkout fails w/ a
fatal: protocol error: bad pack header

Perhaps the error message and/or docs could be improved here to something with more detail than "bad pack header"? Not seeing anything to suggest this in the docs https://git-scm.com/docs/partial-clone

Thanks for the prompt response. Appreciated! --Nipunn

On Wed, Oct 14, 2020 at 5:56 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 40 quoted lines
>
> Hi Nipunn,
>
> On Wed, Oct 14, 2020 at 05:38:15PM +0100, Nipunn Koorapati wrote:
> > Hi friends,
> >
> > When I run a git clone with --filter and a file:/// URI - it fails.
> >
> > Repro steps:
> >
> > I have the `git` repo cloned and built into the CWD at v2.28.0
> > git/git clone --filter=blob:none file:///home/nipunn/src/git git2
>
> I couldn't quite reproduce this. Here's my reproduction:
>
>   #!/bin/sh
>
>   rm -fr repo clone
>   git init repo
>
>   (
>     cd repo
>
>     git config uploadpack.allowfilter true
>     git config uploadpack.allowanysha1inwant true
>
>     for f in a b; do
>       echo $f > $f
>       git add $f
>       git commit -m "$f: initial commit"
>     done
>   )
>
>   git clone --filter=blob:none file://$(pwd)/repo clone
>
> That works on v2.28.0, and v2.29.0 for me. Is git installed properly on
> your system?
>
> Thanks,
> Taylor
Previous: Taylor BlauNext: Taylor Blau
Message 3 of 6 in “Partial clone fails with file:/// URI”
  1. Nipunn KoorapatiOct 14, 2020
  2. Taylor BlauOct 14, 2020
  3. Nipunn KoorapatiOct 14, 2020
  4. Taylor BlauOct 14, 2020
  5. Nipunn KoorapatiOct 14, 2020
  6. Jeff KingOct 15, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.