Re: seperate commits for objects already updated in index?
- From
Andreas Ericsson <ae@op5.se>
- Date
- Mar 15, 2006, 19:43 UTC
- Message-ID
- <44186E50.6090400@op5.se>
- In-Reply-To
- <7vlkvbik8f.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 21 quoted lines
> Andreas Ericsson <ae@op5.se> writes: > > >>Can't this be done by updating .git/index first and then use the >>temporary index to commit? Then .git/index would match the current >>tree and everybody would be happy with very little tweaking. Doing the >>temporary index commit first could cause data-loss as described above >>if the updating of .git/index somehow fails and the user is unaware of >>it (or what to do to fix it). > > > You have to think about how to rewind it when the user decides > later not to commit by for example giving an empty commit > message or killing the editor. The order of things need to be > to populate the index to be committed so that we can give > preview in the commit log template upon 'commit -v', spawn the > editor and get the final version of log, and then make a > commit. So it may or may not be doable -- I haven't thought > about it through, and currently have not much incentive nor > inclination to think about it myself right now. >
cp .git/index .git/pre-commit-index
and roll it back if the user aborts. Should work, but like you I don't need that functionality, so...
-- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231