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

Re: 'setup_work_tree()' considered harmful

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 17, 2008, 11:01 UTC
Message-ID
<alpine.DEB.1.00.0806171142290.6439@racer>
In-Reply-To
<alpine.LFD.1.10.0806161723081.2949@woody.linux-foundation.org>
Hi,
On Mon, 16 Jun 2008, Linus Torvalds wrote:
> [ Dscho cc'd because I think he is the primary culprits for this thing, I 
>   think. Commit e90fdc39b6903502192b2dd11e5503cea721a1ad in particular, 
>   methinks. ]

Yes, I am not happy with work-tree. In fact, I grew to positively hate it. IMHO it was not well designed when it entered Git, and unfortunately my endeavors to clean it up were not very successful, either.

Show 11 quoted lines
> [...]
>
> In particular, doing a "git add ." will use absolute pathnames for all 
> git files, while a "git diff" will not. And this is quite noticeable - 
> the absolute pathnames are not just longer, they have more path 
> components in them. Making them a lot slower to look up and use.
> 
> [...]
> 
> In general, I think we've gone in the wrong direction with a lot of the 
> "make_absolute_path" stuff. See above. 5% performance loss is not good.

Yes, that is true. However, I think we need it for the case where work_tree is set (technically, we could try to be clever when work_tree is set in such a manner that we can operate with relative paths, but I think that is just not worth it).

So I am thinking about reverting to the old behavior, but _just_ for the common case that no work tree was set.

This might be more tricky than it used to be, because of the many special cases work trees require.

I briefly considered working on this now, but I simply do not have the time, and I seem to be unconcentrated these days. Probably the best thing would be to scrap the whole work-tree thing and throw it out, admitting that it was a mistake to begin with.

Ciao, Dscho

Previous: Linus TorvaldsNext: Mike Hommey
Message 3 of 5 in “'setup_work_tree()' considered harmful”
  1. Linus TorvaldsJun 17, 2008
  2. Linus TorvaldsJun 17, 2008
  3. Johannes SchindelinJun 17, 2008
  4. Mike HommeyJun 18, 2008
  5. Linus TorvaldsJun 18, 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.