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

Re: Tracking a repository for content instead of history

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 12, 2006, 22:25 UTC
Message-ID
<Pine.LNX.4.63.0612122316290.2807@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<fcaeb9bf0612121348q35549a4cof0adb85e0391b92c@mail.gmail.com>
Hi,
On Wed, 13 Dec 2006, Nguyen Thai Ngoc Duy wrote:
Show 9 quoted lines
> On 12/13/06, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> > Hm.. I'm no git:// expert. But is it possible doing as follow?
> > 1. git-archive <base>
> > 2. reconstruct commit, blobs and trees from the archive
> > 3. tell git server that you have one commit, you need another commit
> > (maybe heads only, i'm not sure here)
> > 4. get the pack from git server, create new commit and a diff
> 
> Ok. Stupid idea. The pack may base on objects that I don't have.

The only not-so-brilliant idea is to reconstruct the commit from the archive. This is not possible, as not only some author and committer metadata is not reconstructable, but worse: the parents' hash is not either. And since all these are hashed to get the commit hash, you lost.

However, it could work like this:
- reconstruct tree commit
- ask for a diff between a certain commit, with respect to your tree

It might even be easy to convince git-upload-pack to construct a thin pack containing deltas _only_ against objects which are reachable from your tree.

Note: this is feasible, but not necessarily sensible:
- it puts more strain on the server, which otherwise could probably reuse 
a lot of deltas, and
- it contradicts the idea of _distributed_ development (for example, you 
could not tell which HEAD commit is newer when you fetched from two 
repos).

Probably, you could add a third argument: merges are not necessarily _possible_ with that setup. Note that this argument applies to shallow clones, too!

Ciao, Dscho

Previous: Nguyen Thai Ngoc Duy
Message 10 of 10 in “Tracking a repository for content instead of history”
  1. Andy ParkinsDec 12, 2006
  2. Jakub NarebskiDec 12, 2006
  3. Andy ParkinsDec 12, 2006
  4. Johannes SchindelinDec 12, 2006
  5. Andy ParkinsDec 12, 2006
  6. Johannes SchindelinDec 12, 2006
  7. Johannes SchindelinDec 12, 2006
  8. Nguyen Thai Ngoc DuyDec 12, 2006
  9. Nguyen Thai Ngoc DuyDec 12, 2006
  10. Johannes SchindelinDec 12, 2006

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.