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

Git commit causes data download in partial clone

From
Ccharmocc <charmocc@proton.me>
Date
Feb 17, 2024, 20:38 UTC
Message-ID
<OK9E_kNDYqB1tDn6YJhtTgkdDDrcr2LhZEGRdmqismu6KyTki-M22CpCAxXHZCn45SZICjnPNYxvw02BnWeJic3mx47-zeI0HDhzdgoJpG0=@proton.me>
Hi everyone,

I was recently exploring git partial clone feature because I wanted to contribute to repository which has a lot of binary files. My intent was to only add new files without modifying any existing ones and to download as few data as possible in the process. Here are the steps I followed:

$ git clone --no-checkout --filter=blob:none https://github.com/libretro-thumbnails/Nintendo_-_Nintendo_Entertainment_System.git nes $ cd nes $ echo foo > bar $ git add bar $ git commit bar # causes git fetch behind the scene and download of a lot of objects!

Now for reasons I don't understand the last command cause download of a lot of objects from remote (blobs) which is what I was trying to avoid. By enabling tracing options I can see that it runs fetch operation in the background:

git -c fetch.negotiationAlgorithm=noop fetch origin --no-tags --no-write-fetch-head --recurse-submodules=no --filter=blob:none --stdin

Unfortunately trace doesn't show what refspec is being used for the fetch operation. The regular "git fetch" doesn't cause any additional object downloads.

Is there something I'm doing wrong here or maybe what I'm trying to achieve (contribute to repository without downloading all of its files) is simply not possible?

git version 2.34.1 (Ubuntu 22.04)

Thanks for your time charmocc

Next: Jeff King
Message 1 of 3 in “Git commit causes data download in partial clone”
  1. charmoccFeb 17, 2024
  2. Jeff KingFeb 20, 2024
  3. charmoccFeb 22, 2024

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.