git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* checkout-cache -f: a better way?
@ 2005-05-20 21:05 Jeff Garzik
  2005-05-20 22:38 ` Junio C Hamano
  2005-05-20 23:33 ` Linus Torvalds
  0 siblings, 2 replies; 11+ messages in thread
From: Jeff Garzik @ 2005-05-20 21:05 UTC (permalink / raw)
  To: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]


Being a weirdo, I don't use cogito for kernel development, just git 
itself.  I store branches in .git/refs/heads/ per the defacto standard, 
and use the attached script to switch the working directory from one 
branch to another.

Problem is, 'git-checkout-cache -q -f -a' really pounds the disk, and 
takes quite a while.

Is there any way to avoid -f, while ensuring that the working directory 
truly represents the new branch?

BitKeeper has a secret checkout arg '-S', which will leave files 
untouched if the mtime/size information is unchanged.

	Jeff




[-- Attachment #2: git-switch-tree --]
[-- Type: text/plain, Size: 381 bytes --]

#!/bin/sh

if [ "x$1" != "x" ]
then
	if [ "$1" == "master" ]
	then
		( cd .git && rm -f HEAD && ln -s refs/heads/master HEAD )
	else
		if [ ! -f .git/refs/heads/$1 ]
		then
			echo Branch $1 not found.
			exit 1
		fi

		( cd .git && rm -f HEAD && ln -s refs/heads/$1 HEAD )
	fi
fi

git-read-tree $(cat .git/HEAD) && \
	git-checkout-cache -q -f -a && \
	git-update-cache --refresh


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

end of thread, other threads:[~2005-05-21  1:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-20 21:05 checkout-cache -f: a better way? Jeff Garzik
2005-05-20 22:38 ` Junio C Hamano
2005-05-20 23:33   ` Jeff Garzik
2005-05-20 23:39     ` Junio C Hamano
2005-05-20 23:58       ` Jeff Garzik
2005-05-21  1:44         ` Linus Torvalds
2005-05-21  1:45           ` Jeff Garzik
2005-05-20 23:33 ` Linus Torvalds
2005-05-20 23:51   ` Linus Torvalds
2005-05-20 23:55     ` Jeff Garzik
2005-05-20 23:59     ` Junio C Hamano

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