This checkin goes along with the previous one, and makes it easier to use 
all the normal git operations on temporary index files:

  Add support for a "GIT_INDEX_FILE" environment variable.
  We use that to specify alternative index files, which can be useful
  if you want to (for example) generate a temporary index file to do
  some specific operation that you don't want to mess with your main
  one with.
  It defaults to the regular ".git/index" if it hasn't been specified.

and it's particularly useful for doing things like "read a tree into a 
temporary index file, and write the result out". For example, say that you 
wanted to know what the Makefile looked like in a particular release, 
you could do

    GIT_INDEX_FILE=.tmp-index read-tree $release
    GIT_INDEX_FILE=.tmp-index checkout-cache --prefix=old- Makefile
    rm .tmp-index

and you're done. Your old Makefile version is now in "old-Makefile" (and
this is also where it's nice that checkout-cache refuses to overwrite
existing files by default: if you forgot or messed up the prefix, it's all

You can also use it to test merges without screwing up your old index file 
in case something goes wrong.

Did I already happen to mention that I think that the git model is the
best model ever, and that I'm just not an incredibly good-looking hunk and
becomingly modest, I'm smart too?

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to