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

Re: [long] worktree setup cases

From
EWEnrico Weigelt <weigelt@metux.de>
Date
Oct 21, 2010, 19:01 UTC
Message-ID
<20101021190146.GC28700@nibiru.local>
In-Reply-To
<7v8w1svate.fsf@alter.siamese.dyndns.org>
* Junio C Hamano <gitster@pobox.com> wrote:
> If you set GIT_DIR, we do no discovery, so git will work only from the
> root level of the working tree (or bare repository operation) if you do
> not tell us where the working tree is.

Well, we could look at config whether it's an non-bare repo and then lookup worktree via core.worktree (which would default to "../").

BTW: the whole discovery process IMHO should start w/ looking for 
the gitdir. Could be done this way:

a) explicitly given (via GIT_DIR or --git-dir), take this one. b) else: recursively scan for a valid .git dir from cwd upstairs to /

Once we've found gitdir, we can look for the worktree. Again:
a) explicitly given, then take it
b) bare repo: dont have any, bail out
c) non-bare repo: look up via core.worktree (w/ default to $GIT_DIR/../)
 
> Shouldn't all of these 16 be the same, if the repository is bare?  What is
> your definition of bareness?  core.bare?  In any case we should say "you
> are using a bare repository, there is no working tree" and cwd shouldn't
> change in these cases.  They are all bare and there is no working tree.

ACK. In a bare repo, the worktree lookup will fail per definition, so worktree operations can only run with having it explicitly given.

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Previous: Nguyen Thai Ngoc DuyNext: Junio C Hamano
Message 16 of 17 in “[long] worktree setup cases”
  1. Nguyen Thai Ngoc DuyOct 20, 2010
  2. Jonathan NiederOct 20, 2010
  3. Jonathan NiederOct 20, 2010
  4. Nguyen Thai Ngoc DuyOct 21, 2010
  5. Jonathan NiederOct 21, 2010
  6. Nguyen Thai Ngoc DuyOct 21, 2010
  7. Jonathan NiederOct 21, 2010
  8. Nguyen Thai Ngoc DuyOct 23, 2010
  9. Enrico WeigeltOct 21, 2010
  10. Nguyen Thai Ngoc DuyOct 22, 2010
  11. Enrico WeigeltOct 22, 2010
  12. .git file (Re: [long] worktree setup cases)Jonathan Nieder, Oct 22, 2010
  13. Nguyen Thai Ngoc DuyOct 22, 2010
  14. Junio C HamanoOct 20, 2010
  15. Nguyen Thai Ngoc DuyOct 21, 2010
  16. Enrico WeigeltOct 21, 2010
  17. Junio C HamanoOct 21, 2010

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.