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

Re: [RFC] GIT_WORK_TREE

From
Sergio <sergio.callegari@gmail.com>
Date
Jun 3, 2007, 21:34 UTC
Message-ID
<loom.20070603T232437-414@post.gmane.org>
In-Reply-To
<20070603193203.GA24781@moooo.ath.cx>
Matthias Lederhofer <matled <at> gmx.net> writes:
> What I haven't thought through is if it could make sense to honor the
> GIT_WORK_TREE/core.worktree setting when such a .git-repo file is used
> or just use the directory containing the file as work tree.
I would do the first... for the following reason...

Suppose that by accident you move the working tree and you cd to some point in the moved WT... You issue a git command... By climbing up the directory hierarchy, git gets to the .git-repo file so now it knows where the repo is... But running a command and following the core.worktree config it might put output in the wrong output dir...

But actually I also see problems the other way round...

Suppose you have project A containing a dir B that is under its own git tracking... Also suppose that both A and B have repos separated from WT. If for some reason WT of B misses its .git-repo, then there is trouble on the way: when issuing a command in B, by climbing up git would find the .git-repo of A, thinking that it is the git-repo of B... A weird case, though.

Sergio
Previous: Matthias LederhoferNext: Matthias Lederhofer
Message 21 of 22 in “[RFC] GIT_WORK_TREE”
  1. Matthias LederhoferJun 3, 2007
  2. 1/7 rev-parse: document --is-inside-git-dirMatthias Lederhofer, Jun 3, 2007
  3. 2/7 rev-parse: introduce --is-bare-repositoryMatthias Lederhofer, Jun 3, 2007
  4. 3/7 test git rev-parseMatthias Lederhofer, Jun 3, 2007
  5. 3/7 test git rev-parseMatthias Lederhofer, Jun 6, 2007
  6. 4/7 introduce GIT_WORK_TREE to specify the work treeMatthias Lederhofer, Jun 3, 2007
  7. Junio C HamanoJun 5, 2007
  8. filter-branch: always export GIT_DIR if it is setMatthias Lederhofer, Jun 5, 2007
  9. Johannes SchindelinJun 5, 2007
  10. Junio C HamanoJun 5, 2007
  11. filter-branch: always export GIT_DIR if it is setMatthias Lederhofer, Jun 6, 2007
  12. 4/7 introduce GIT_WORK_TREE to specify the work treeMatthias Lederhofer, Jun 6, 2007
  13. Matthias LederhoferJun 3, 2007
  14. Matthias LederhoferJun 3, 2007
  15. 6/7 extend rev-parse test for --is-inside-work-treeMatthias Lederhofer, Jun 3, 2007
  16. 6/7 extend rev-parse test for --is-inside-work-treeMatthias Lederhofer, Jun 6, 2007
  17. 7/7 test GIT_WORK_TREEMatthias Lederhofer, Jun 3, 2007
  18. 7/7 test GIT_WORK_TREEMatthias Lederhofer, Jun 6, 2007
  19. SergioJun 3, 2007
  20. Matthias LederhoferJun 3, 2007
  21. SergioJun 3, 2007
  22. setup_git_directory: fix segfault if repository is found in cwdMatthias Lederhofer, Jun 6, 2007

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.