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

Re: [BUGREPORT] Why is git-push fetching content?

From
Tao Klerks <tao@klerks.biz>
Date
Jun 20, 2023, 11:26 UTC
Message-ID
<CAPMMpoiC8oca0AVNy1f+zy26L_b-ADyNopY4zO3r+v6v-KEH=A@mail.gmail.com>
In-Reply-To
<m0pma14sbx.fsf@epic96565.epic.com>
On Wed, Feb 22, 2023 at 4:45 PM Sean Allred <allred.sean@gmail.com> wrote:
Show 11 quoted lines
>
>
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> > It's hard to know for certain what's going on here, but it depends on
> > your history.  You did a partial clone with no trees, so you've likely
> > received a single commit object and no trees or blobs.
>
> Yup, this was the intention behind `--depth=1 --filter=tree:0`. The
> server doing this ref update needs to be faster than having the full
> history would allow.
>

FWIW, you're not alone - we do exactly the same thing, for the same reasons, and get the same outcome: We want to create a tag in a CI job, that particular CI job has no reason to check out the code, all we know is we want ref XXXXX to point to commit YYYYY.

The most logical way to achieve that seems to be to do a shallow partial no-checkout clone of commit YYYYY, and then push to remote ref XXXXX, but the push ends up doing extra seemingly-unnecessary jit-fetching work.

In our case it's still better than any alternative we've found, but wastes a few seconds that we'd love to see optimized away.

Previous: Sean AllredNext: Sean Allred
Message 4 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.