Thread (13 messages) flat view 13 messages, 4 authors, 2016-08-11

Re: Bootstrapping into git, commit gripes at me

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:02


On Tue, 12 Jul 2005, Petr Baudis wrote:
Could we please have the branch name written to .git/head-name in case
we switch the branch?
I wouldn't mind per se, but on the other hand I really _hate_ having 
"parallel" information that can get out of sync. If you have two places 
holding the same information, they had better match. And this is something 
that sounds like it could very easily start to not match, and then we're 
screwed.

So I'd _much_ rather see instead:

 - .git/head-name is a cogito-specific thing that is only active while 
   cogito is _seeking_. So then "cg-unseek" ends up being pretty much 
   equivalent to

	[ -e .git/head-name ] || die "You weren't seeking"
	git checkout $(cat .git/head-name)
	rm .git/head-name

   This way "head-name" is really never even supposed to be "in sync" with 
   .git/HEAD, and there are no synchronization issues. 

 - in order for a "git checkout" to not get confused and possibly throwing 
   a cogito temporary head away (and so that git-fsck-cache is happy 
   during a seek), would it be possible to make "seek" use a real 
   temporary branch instead? Ie, "cg-seek" would be something like

	[ -e .git/head-name ] && die "You are already seeking"
	readlink .git/HEAD > .git/head-name
	echo $seekpoint > .git/refs/heads/cg-seek-point
	git checkout -f cg-seek-point

   or similar?

Then "cg-seek" and "cg-unseek" would continue to work, but the core git 
layer would never be confused because they're really using normal 
branches?

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help