Re: [PATCH 06/10] Completely move out worktree setup from setup_git_directory_gently()
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Mar 11, 2008, 15:28 UTC
- Message-ID
- <fcaeb9bf0803110828u3087ccdeqead5f2c433e08597@mail.gmail.com>
- In-Reply-To
- <alpine.LSU.1.00.0803111429380.3873@racer.site>
On Tue, Mar 11, 2008 at 8:31 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 17 quoted lines
> Hi, > > > On Sun, 2 Mar 2008, Nguyễn Thái Ngọc Duy wrote: > > > This was impossible earlier because git_dir can be relative. Now that > > git_dir is absolute, I see no reason for worktree setup inside > > setup_git_directory_gently(). The semantic is now clearer: if you need > > worktree, call setup_work_tree yourself (well, I will clean up > > setup_git_directory() part later) > > As I said earlier, the work for getting the prefix as most likely be done > already in the search for .git/. I mean, it _is_ the common case to have > a working tree with a .git/ in it, and that's it. > > So I am quite certain that it is not worth the complicated and intrusive > patch to separate the logic.
It does for two purposes:
- Leave a chance for commands that does not care about worktree at all. Those commands won't have to care about prefix anymore. - Clean up the code. Now only setup_work_tree() does worktree setup things (like chdir())
> Particularly since working tree has a bad reputation already, as Junio > pointed out: whenever we touch it, we get burnt.
I'd rather get burnt now than later (which might be probably worse) :) In case we are to be burnt, we should not have it in 1.5.5 :D
> Ciao, > Dscho
-- Duy