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, 16:02 UTC
Message-ID
<loom.20070603T175743-376@post.gmane.org>
In-Reply-To
<20070603144401.GA9518@moooo.ath.cx>
Matthias Lederhofer <matled <at> gmx.net> writes:
 
> This series introduces the GIT_WORK_TREE environment variable (and
> core.worktree config option) to specify the working tree that should
> be used with the repository (not for repositories found as .git
> directory).  This allows to separate the repository and working tree.
Hi,
a question regarding GIT_WORK_TREE and (possibly) a suggestion...
If I am not wrong, with this we detach the WT from the REPO by letting git know
our working tree if the working tree does not include a repo (.git) directory.
And this is done either:
- by setting the GIT_WORK_TREE environment variable whenever needed
- by passing the --work-tree parameter to git when needed
- by setting the core.worktree config option in the git repo, so that the
repository knows where its default work tree is...
Is this correct? or am I missing some other ways?
Would it make sense to make the _WT_ know where its repo is?

I.e. having something like a .git-repo file a the top dir of a WT, so that when git is invoked within the WT it can scan up the WT until it finds the .git-repo file and automatically decide that GIT_WORK_TREE is at the dir containing that .git-repo file and that GIT_DIR is at the file pointed by that .git-repo?

Thanks,
Sergio
Previous: Matthias LederhoferNext: Matthias Lederhofer
Message 19 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.