git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Re: keeping remote repo checked out?

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 29, 2005, 04:34 UTC
Message-ID
<Pine.LNX.4.64.0511282029290.3177@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0511282208050.25300@iabervon.org>
On Mon, 28 Nov 2005, Daniel Barkalow wrote:
> 
> I was planning to keep it in .git (instead of .git/refs/...), because it's 
> information about the working tree, not properly part of the repository. 
> It's like MERGE_HEAD in being about what the user is in the middle of.
That's fine.
However, your patch isn't.

Your patch just creates this eternal confusion of "why is HEAD different from CHECKED_OUT".

It's really easy to do what you want to do _without_ any tool changes:
	git-rev-parse HEAD > .git/CHECKED_OUT
	rm .git/HEAD
	ln -s refs/heads/../../CHECKED_OUT .git/HEAD
and you're done. No tool changes necessary.

Now "HEAD" always points to the checked-out thing, but a "git clone" won't ever actually clone your CHECKED_OUT branch.

		Linus
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 13 of 25 in “keeping remote repo checked out?”
  1. James CloosNov 28, 2005
  2. Junio C HamanoNov 28, 2005
  3. Petr BaudisNov 28, 2005
  4. Junio C HamanoNov 28, 2005
  5. Petr BaudisNov 28, 2005
  6. Junio C HamanoNov 28, 2005
  7. Linus TorvaldsNov 28, 2005
  8. Daniel BarkalowNov 29, 2005
  9. Linus TorvaldsNov 29, 2005
  10. Daniel BarkalowNov 29, 2005
  11. Linus TorvaldsNov 29, 2005
  12. Re: keeping remote repo checked out?Daniel Barkalow, Nov 29, 2005
  13. Linus TorvaldsNov 29, 2005
  14. Daniel BarkalowNov 29, 2005
  15. Junio C HamanoNov 29, 2005
  16. Daniel BarkalowNov 29, 2005
  17. Junio C HamanoNov 29, 2005
  18. Matthias UrlichsNov 29, 2005
  19. Junio C HamanoNov 29, 2005
  20. Daniel BarkalowNov 29, 2005
  21. Junio C HamanoNov 29, 2005
  22. Daniel BarkalowNov 29, 2005
  23. Matthias UrlichsNov 29, 2005
  24. James CloosDec 1, 2005
  25. Junio C HamanoDec 1, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.