Re: [PATCH] commit: write out cache-tree information
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2011, 18:13 UTC
- Message-ID
- <7vmxfrel63.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <9f5e031045b55c4738de8bc9aae290827e128cd3.1312302862.git.trast@student.ethz.ch>
<trast@student.ethz.ch> writes:
Show 6 quoted lines
> From: Thomas Rast <trast@student.ethz.ch> > > While write-tree has code to write out the cache-tree information > (since we have to compute it anyway if the cache is stale), commit > lost this capability when it became a builtin and moved away from > using write-tree.
Earlier the code read from the index, made sure that it is not unmerged by running cache_tere_update(), before running prepare-commit-msg hook. The hook used to see the index that was read in this codepath which is the same as what pre-commit left us.
Why run an extra I/O here? The index file could be quite large, and I do not want people to writing it out without good reason.
The tree object that is committed is taken from active_cache_tree->sha1 in cmd_commit() and not from the cache tree you are writing out to the index file.