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

Re: keeping remote repo checked out?

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Nov 29, 2005, 02:35 UTC
Message-ID
<Pine.LNX.4.64.0511282027360.25300@iabervon.org>
In-Reply-To
<Pine.LNX.4.64.0511281637480.3177@g5.osdl.org>
On Mon, 28 Nov 2005, Linus Torvalds wrote:
Show 15 quoted lines
> On Mon, 28 Nov 2005, Daniel Barkalow wrote:
> > 
> > We really ought to keep track of what the current checked out tree is, 
> > independant of the head that it's supposed to match. Then it would be safe 
> > to push to a head that's checked out (it wouldn't update it, but the 
> > system would understand what's going on).
> 
> Well, that's what branches are all about. 
> 
> You really have two choices:
>  - do it all yourself
>  - use git branches
> 
> but if you use a special git branch for the checked-out state, then you 
> have to realize that nobody can push directly to it.

The idea is to have something which is private, to match the working tree, which is obviously private (because it doesn't even exist from the point of view of the database). Of course, you don't want most of the branch mechanism, with HEAD pointing to a file, because when you commit, you want to update something else, and when you check out, you want to check out something else. You want to use a normal git branch, but still have git keep track of what it thinks should be in your working tree, regardless of what the branch you're on does, so that checkout doesn't get confused if somebody's pushed to the branch you're on.

Then, if someone pushes to a branch that's checked out, git doesn't lose track of what it put in the working tree, so it can handle the "git checkout" that you do afterwards to update the working tree. Making everything work okay if multiple "git checkout"s happen at the same time is future work, and will definitely involve locking.

	-Daniel
*This .sig left intentionally blank*
Previous: Linus TorvaldsNext: Linus Torvalds
Message 10 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.