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

[BUGREPORT] Why is git-push fetching content?

From
Sean Allred <allred.sean@gmail.com>
Date
Feb 21, 2023, 22:01 UTC
Message-ID
<m0ttze4qzl.fsf@epic96565.epic.com>
What did you do before the bug happened? (Steps to reproduce your issue)
    # in a new directory,
    cd $(mktemp -d)
    # initialize a new repository
    git init
    # fetch a single commit from a remote
    git fetch --filter=tree:0 --depth=1 $REMOTE $COMMIT_OID
    # create a ref on that remote
    git push --no-verify $REMOTE $COMMIT_OID:$REFNAME
What did you expect to happen? (Expected behavior)
    I expected this process to complete very, very quickly. We believe
    the version where it had been doing so was ~2.37.
What happened instead? (Actual behavior)
    The fetch completes nearly instantly as expected. We receive ~200B
    from the remote for the commit object itself. What's truly bizarre
    is what happens during the push. It starts receiving objects from
    the remote! By the end of this process, the local repository is a
    whopping ~700MB -- though interestingly only about a tenth of the
    full repository size.
    This result in particular is strange in context. I would expect to
    either see 'almost all' the repository content, 'about half' (we
    have two trunks and fetching a single commit would at most fetch one
    of them), or 'virtual none at all'. There isn't a straightforward
    explanation for why 'one tenth' would make sense.
What's different between what you expected and what actually happened?
    Why should git-push ever be fetching objects? This doesn't map well
    to my mental model of the relationship between push/fetch.
    I would expect the local repository to stay in that 'git init'+200B
    range.
Anything else you want to add:

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

    I've truncated the system information normally included by
    git-bugreport as I am sending this email from a different machine.
    Versions of Git that can reproduce:
      - 2.39.2.windows.1     (Windows 10)
        git version:
        git version 2.39.2.windows.1
        cpu: x86_64
        built from commit: a82fa99b36ddfd643e61ed45e52abe314687df67
        sizeof-long: 4
        sizeof-size_t: 8
        shell-path: /bin/sh
        feature: fsmonitor--daemon
        uname: Windows 10.0 19044
        compiler info: gnuc: 12.2
        libc info: no libc information available
        $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
      - 2.31.1               (AIX UNIX 7.2)
        git version:
        git version 2.31.1
        cpu: 00F905E64C00
        no commit associated with this build
        sizeof-long: 8
        sizeof-size_t: 8
        shell-path: /opt/freeware/bin/bash
        uname: AIX 2 7 00FBC37A4C00
        compiler info: gnuc: 8.3
        libc info: no libc information available
        $SHELL (typically, interactive shell): /usr/bin/ksh

-- Sean Allred

Next: brian m. carlson
Message 1 of 7 in “[BUGREPORT] Why is git-push fetching content?”
  1. Sean AllredFeb 21, 2023
  2. brian m. carlsonFeb 21, 2023
  3. Sean AllredFeb 22, 2023
  4. Tao KlerksJun 20, 2023
  5. Sean AllredJul 8, 2023
  6. Sean AllredJul 8, 2023
  7. Sean AllredFeb 22, 2023

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.