partial clone filter tree:0 appears to be a terrible choice for the zephyr repository

Hi,

As a long time git user, I was recently very confused when I attempted to (for example)

git log zephyr/tests/kernel/common/src/atomic.c

or

gitk zephyr/tests/kernel/common/src/atomic.c

and found my machine crawling along at close to 0 kilometers per hour (I usually say miles per hour--same idea).

Some initial googling gave me the WRONG answer--suggesting I was witnessing a Windows issue--so I switched to Linux and found the same problem.

More googling and testing revealed that this was an issue with the use of tree:0 partial clone filtering. You can see that in zephyr/.git/config that has the statement

partialclonefilter = tree:0

I believe that one can also get good results by using the blob filtering

git clone --filter=blob:none ...

Please show me how you or I can fix this in the scripts or when using VS Code. I know that zephyr is not the immediate code of my project, but I do find this limitation a ridiculous annoyance. Thanks.

Burt Silverman

Parents
  • Oh, man... this appears to be a special feature limited to creating the SDK using VS Code.  Is it related to

    let a=["update"];return n&&(Ho(await eTe().catch(()=>"0.0.0"),"2.27.0")>=0&&a.push("-o=--filter=tree:0"),a.push("--narrow")),new Promise((o,u)=>{let l=this.spawn(this.topdir,a),p="",f=h=>{p+=`${h}`

    in ~/.vscode/extensions/nordic-semiconductor.nrf-connect-2023.11.301-linux-x64/dist/extension.js? Granted, I cannot read javascript/typescript.

    Burt

  • Hi,

    Does this mean you found the answer, or is something still unclear?

    Regards,
    Terje

  • Thanks, Terje. I would like a bit more information: I would like to know why this>> "git clone --filter=blob:none" cannot be used rather than the tree:0 filtering. And I would like to know why toolchain manager installs an SDK one way (without filtered clone) and VS Code takes a different approach. I am guessing that none of this is documented. Anyway, I always feel better if I know the reasoning behind an approach that is not obvious. Thanks.

    Burt

  • Hi Burt

    Sorry for the slow response on this one. Terje is currently out in holiday and will get back to you first week of January. 

    Best regards
    Torbjørn

  • Hi,

    The reasoning is simply that the main use case is to install an SDK at some location, with no intentions to update it in-place, and preferably with as good as possible installation speed. For that scenario tree:0 is the best option, as blob:none would fetch unnecessary data.

    If however, as in your case, you perform git operations requiring more than one given commit, then blob:none (or even no filtering at all) may be better options. Nothing is likely to break by using blob:none, but download times and local space usage would increase.

    Regards,
    Terje

  • Thanks, Terje. I appreciate the extra knowledge: I didn't realize that blob:none is larger/slower than tree:0. Sorry my initial reaction was so negative but it was confusing when just by coincidence I decided to "git log" under zephyr and I must have thought I had a corrupted git repository. I will close the ticket now.

Reply Children
No Data
Related