Re: Separating "add path to index" from "update content in index"
- From
Shawn Pearce <spearce@spearce.org>
- Date
- Dec 22, 2006, 05:21 UTC
- Message-ID
- <20061222052156.GA15548@spearce.org>
- In-Reply-To
- <7vfyb87bxg.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 5 quoted lines
> And it is not just limited to adding the contents of a path that > happened to be told git for the first time. Adding the contents > of a path that was known to git also happens only when it is in > a presentable good state. So running "git diff" and not seeing > what I added before is a GOOD THING.
Yes!
Sadly it has taken me 12 months of working with Git to get comfortable enough with that concept.
Actually it clicked once I realized that 'update-index' was actually creating the blobs in the ODB and not 'write-tree'. Prior to that "click" going off in my grey matter I always felt that Git screwed up when I did:
$ vi foo.c $ git update-index foo.c $ git diff # what the ? where are my changes?
I now make quite heavy use of the index even when hacking on code, and not just during merges. But I wasn't like that just 5 months ago...
-- Shawn.