git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "GIT_INDEX_FILE" environment variable
@ 2005-04-21 18:09 Linus Torvalds
  2005-04-21 18:11 ` Davide Libenzi
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Linus Torvalds @ 2005-04-21 18:09 UTC (permalink / raw)
  To: Git Mailing List


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
good).

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?

		Linus

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-04-22 22:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-21 18:09 "GIT_INDEX_FILE" environment variable Linus Torvalds
2005-04-21 18:11 ` Davide Libenzi
2005-04-21 18:37 ` Linus Torvalds
2005-04-22  0:21 ` Junio C Hamano
2005-04-22  5:05   ` Linus Torvalds
2005-04-22  6:23     ` Junio C Hamano
2005-04-22 10:35       ` Petr Baudis
2005-04-22 19:24       ` Linus Torvalds
2005-04-22 20:20         ` Junio C Hamano
2005-04-22 22:14           ` Linus Torvalds
2005-04-22 22:31             ` Junio C Hamano
2005-04-22 22:33             ` Petr Baudis
2005-04-22 22:55               ` Linus Torvalds
2005-04-22  9:14     ` Zach Welch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).