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

Re: Problem creating commits/trees with commit-tree/mktree

From
GBGavin Beatty <gavinbeatty@gmail.com>
Date
Jan 14, 2010, 23:18 UTC
Message-ID
<f6d77fed1001141518l22987752x5a1c1e84cb68b677@mail.gmail.com>
In-Reply-To
<32541b131001111038m3dacaf72sc12f24aba8c60e@mail.gmail.com>
On Mon, Jan 11, 2010 at 19:38, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 6 quoted lines
> When I'm doing similar things, I often prefer just using a temporary
> git index file to keep track of my intermediate trees.  Just set
> GIT_INDEX_FILE to point at a temporary file; then you can use
> git-read-tree to read in an old tree, and git-update-index
> (particularly with the --stdin flag) to update it.  Then you can use
> git-write-tree to convert the temporary index into a real tree object.

Your suggestion works well. git update-index --info-only -z --index-info takes ls-tree -r -z style format and pre-existing objects: just as I wanted.

Thanks, git-fast-import was too much for the quite simple git-related code I need.

-- 
Gavin Beatty

SEMPER UBI SUB UBI
Previous: Avery Pennarun
Message 4 of 4 in “Problem creating commits/trees with commit-tree/mktree”
  1. Gavin BeattyJan 11, 2010
  2. Shawn O. PearceJan 11, 2010
  3. Avery PennarunJan 11, 2010
  4. Gavin BeattyJan 14, 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.