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

Re: Possible to unshallow or deepen based on local objects?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2019, 22:33 UTC
Message-ID
<xmqqftmbe17t.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CALxJwdM0ifKoQDMXJuuWyeXdR9-oxVpOyODBO0TXcz=d+0vq2Q@mail.gmail.com>
Mark Rushakoff <mark@influxdata.com> writes:
Show 13 quoted lines
> I have a shallow clone of a repository. Then sometime later, I obtain a bundle
> containing full history.
>
> I thought I could use git fetch --unshallow /path/to/repo.bundle
> mybranch:mybranch, but I've found that git does not support shallow fetches
> from a bundle and that unshallow is actually an alias for --depth=2147483647 in
> 4dcb167fc3 (fetch: add --unshallow for turning shallow repo into complete one,
> 2013-01-11).
>
> If I do a plain fetch from the bundle, I can manually modify .git/shallow to
> "unshallow" my repository like the previous email in this thread. But what I
> think I still want here is a way to tell git "here are all the objects I have;
> update the shallow boundaries accordingly."
It sounds like a quite sensible request to me.  

Offhand, I do not think of anything that would make it fundamentally impossible to allow us to first add objects to the .git/objects directory by whatever means available to you (including, but not limited to, exploding the object data from a full bundle) and then to tell Git to see if there (still) are missing commits and objects that ought to exist but don't that necessitates the repository to be marked "shallow", and adjust the boundary.

I however do not think there is such a code already written X-<.
Previous: Mark Rushakoff
Message 3 of 3 in “Possible to unshallow or deepen based on local objects?”
  1. Mark RushakoffJul 26, 2019
  2. Mark RushakoffAug 8, 2019
  3. Junio C HamanoAug 8, 2019

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.