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

Re: Determining whether you have a commit locally, in a partial clone?

From
Tao Klerks <tao@klerks.biz>
Date
Jun 20, 2023, 19:12 UTC
Message-ID
<CAPMMpojUpJD21x2i_hshTB96TBFVd-_WRV54KHT2-4R8DUh8=Q@mail.gmail.com>
In-Reply-To
<CAPMMpog8Hv_KcjNxbh_wzjwrFYt7TuTvrVy1XEtJMm6RWSKzRg@mail.gmail.com>
On Tue, Jun 20, 2023 at 2:04 PM Tao Klerks <tao@klerks.biz> wrote:
Show 10 quoted lines
>
> On Tue, Jun 20, 2023 at 1:26 PM Tao Klerks <tao@klerks.biz> wrote:
> >
> > * Is there any way to run a single git command in a "don't use
> > promisors" context?
>
> My apologies for the self-reply, I did find a workaround here:
>
> git -c remote.origin.url log SOME_HASH_NOT_IN_REFSPEC
>
Another self-reply unfortunately: This workaround stops working in git 2.39 :(

I haven't understood exactly what's going on, but I guess the fetch failure was explicitly curtailing *something* extremely expensive that gets to go forward anyway as of 2.39.

I imagine it's related to the changelog entry "Remove error detection from a function that fetches from promisor remotes": https://github.com/gitgitgadget/git/blob/79bdd48716a4c455bdc8ffd91d57a18d5cd55baa/Documentation/RelNotes/2.39.0.txt

I'm back to begging for any hints here: Any idea how I can determine whether a given commit object exists locally, *without causing it to be fetched by the act of checking for it?*

Thanks, Tao

Previous: Jeff KingNext: Jeff King
Message 6 of 9 in “Determining whether you have a commit locally, in a partial clone?”
  1. Tao KlerksJun 20, 2023
  2. Tao KlerksJun 20, 2023
  3. Junio C HamanoJun 20, 2023
  4. Tao KlerksJun 20, 2023
  5. Jeff KingJun 21, 2023
  6. Tao KlerksJun 20, 2023
  7. Jeff KingJun 21, 2023
  8. Tao KlerksJun 21, 2023
  9. Jeff KingJun 27, 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.