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

Storing commits in trees

From
Joachim Breitner <mail@joachim-breitner.de>
Date
Apr 15, 2010, 20:32 UTC
Message-ID
<1271363532.18164.47.camel@localhost>
[Please CC me on reply, as I’m not subscribed. Thanks!]
Hi,

for a variation of the workflow implemented by git-dpm[1], a tool to manage the development of Debian packages in git, I wanted to refer to a specific commit P from a regular commit D on my master branch, without P being a parent of D, as I don’t want it to show up in the history.

I found out that I can store commit objects in a tree object, using git $ git update-index --add --cacheinfo 160000 0ac1855f1681c05d195f219c3003a05dc8d3ac20 stored-commits/some-commit and refer to it via HEAD:stored-commits/some-commit. I was happy, until I noticed that git prune will happily delete the stored commit as soon as it is not referred somewhere else, and git push/pull won’t transfer the stored commit along the tree it is contained in.

I then found out that storing commit objects in the tree is implemented for git-submodules, where you in fact do not want to store the commit in the main repo.

Now I’m wondering if it would be feasible to offer this feature: A proper “commit” object within a tree that is walked by fsck_walk_tree and the other tree walkers?

Or is there yet another way of telling git that commit D “depends on” commit P?

Thanks, Joachim

[1] http://git-dpm.alioth.debian.org/
-- 
Joachim "nomeata" Breitner
  mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata@debian.org
Next: Peter Collingbourne
Message 1 of 2 in “Storing commits in trees”
  1. Joachim BreitnerApr 15, 2010
  2. Peter CollingbourneApr 18, 2010

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.