Re: Some advanced index playing
- From
Alan Chandler <alan@chandlerfamily.org.uk>
- Date
- Dec 3, 2006, 20:11 UTC
- Message-ID
- <200612032011.25922.alan@chandlerfamily.org.uk>
- In-Reply-To
- <Pine.LNX.4.64.0612031008360.3476@woody.osdl.org>
On Sunday 03 December 2006 18:24, Linus Torvalds wrote:
Show 17 quoted lines
> On Sun, 3 Dec 2006, Alan Chandler wrote: > > With all the discussion about the index file in the last few days I would > > have thought that this issue would have come up. But I don't think it > > has. > > > > I have been editing a set of files to make a commit, and after editing > > each one had done a git update-index. > > > > At this point I am just about to commit when I realise that one of the > > files has changes in it that really ought to be a separate commit. > > > > So effectively, I want to do one of three things > > > > a) git-commit <that-file> > > > > Except I can't because there is a safety valve that prevents this and > > there is no force option.
...
> > git ls-tree HEAD -- that-file | git update-index --index-info > git commit that-file
I don't quite understand this - maybe it should be
git ls-tree HEAD -- that-file | git update-index --index-info git commit git commit -a
either I want to ONLY commit that file at the working tree state (and index before these commands), or I want to commit ALL except this file (so I can later come and commit just that file)
so having reset the index to the state of HEAD for "that-file" then the commit should make a commit with all the other changes in the index (but NOT that-file) and then the git commit -a picks up "that-file"
-- Alan Chandler