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

Re: Multiple working trees with GIT ?

From
Willy Tarreau <w@1wt.eu>
Date
Jan 24, 2008, 14:10 UTC
Message-ID
<20080124141041.GF13247@1wt.eu>
In-Reply-To
<alpine.LSU.1.00.0801241336510.5731@racer.site>
On Thu, Jan 24, 2008 at 01:38:45PM +0000, Johannes Schindelin wrote:
Show 33 quoted lines
> Hi,
> 
> On Thu, 24 Jan 2008, Willy Tarreau wrote:
> 
> > On Thu, Jan 24, 2008 at 11:04:42AM +0000, Johannes Schindelin wrote:
> > 
> > > On Thu, 24 Jan 2008, Julian Phillips wrote:
> > > 
> > > > You might want to have a look at the git-new-workdir script in 
> > > > contrib, it does basically the same thing.  It's been there for 
> > > > about 10 months now. It was based on an email from Junio:
> > > > 
> > > > http://article.gmane.org/gmane.comp.version-control.git/41513/
> > > 
> > > FWIW I have a patch to do something like that in "git branch" itself.
> > >
> > > > However, there are some caveats about using this approach, basically 
> > > > about the fact that there is nothing stopping you from updating refs 
> > > > that are currently checked out in another directory and causing 
> > > > yourself all sorts of pain ... the topic has cropped up a couple of 
> > > > times on the list since the script was added.
> > > 
> > > I agree; maybe we should have a telltale file 
> > > "refs/heads/<bla>.checkedout" which is heeded by "git checkout" and 
> > > "git branch -d/-D", as well as update_ref() (should only update that 
> > > ref when it HEAD points to it)?
> > 
> > Why not generalize this into HEAD.$branch (thus limiting to one checkout 
> > per branch) or HEAD.$checkoutdir ?
> 
> Because multiple working trees for the same repository will always be a 
> second-class citizen.  And I would rather not affect the common case too 
> much.
OK.
> Having a "lock" file which is heeded by just a few places which are 
> supposed to update refs (thinking about it, just update_ref() should be 
> enough), is at least a well-contained change.
indeed, with the appropriate warnings/error messages, that makes a lot of sense.

Cheers, Willy

Previous: Johannes SchindelinNext: Willy Tarreau
Message 6 of 8 in “Multiple working trees with GIT ?”
  1. Willy TarreauJan 24, 2008
  2. Julian PhillipsJan 24, 2008
  3. Johannes SchindelinJan 24, 2008
  4. Willy TarreauJan 24, 2008
  5. Johannes SchindelinJan 24, 2008
  6. Willy TarreauJan 24, 2008
  7. Willy TarreauJan 24, 2008
  8. J. Bruce FieldsJan 24, 2008

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.