All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Cc: Dmitry Potapov <dpotapov@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Luciano Rocha <luciano@eurotux.com>,
	Pieter de Bie <pdebie@ai.rug.nl>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 01/02/RFC] implement a stat cache
Date: Mon, 21 Apr 2008 10:41:41 +0200	[thread overview]
Message-ID: <200804211041.41760.johan@herland.net> (raw)
In-Reply-To: <20080421005340.GA2631@dpotapov.dyndns.org>

On Monday 21 April 2008, Dmitry Potapov wrote:
> On Sun, Apr 20, 2008 at 04:07:35PM -0700, Linus Torvalds wrote:
> > Junio, what was the logic for that whole "has_symlink_leading_path()"
> > thing? I forget. Whatever, it's broken.
> 
> ===
> commit f859c846e90b385c7ef873df22403529208ade50
> Author: Junio C Hamano <junkio@cox.net>
> Date:   Fri May 11 22:11:07 2007 -0700
> 
[snip snip]
> ===
> 
> And there are some cases where stat() on path is desirable:
> http://www.spinics.net/lists/git/msg63988.html
> 
> So while stat information for regular files is cached in the index,
> stat information for directories is not cached, and that appears to
> be wrong. Maybe, Lucano's cache makes sense if it stores only stat
> information for directories.
> 
> IIRC, some time ago, an otherwise reasonable patch for .gitignore was
> rejected just because it would drive the number calls to lstat() up as
> these calls on directories are not cached in the index.

Pardon me for butting in (and I'm honestly NOT trying to start a flamewar),
but I'm wondering if this could be solved by tracking directories in the
index. AFAICS it would:

- Help bring the number of lstat() calls down (since we can cache the
  lstat() results for directories like we currently do for regular files)

- More easily detect complicated cases like "add across symlinks" (see
  Junio's email at the spinics.net link above)

- (less important) When discussing empty directory support several months
  ago, ISTR one of the biggest hurdles being that directories were not
  tracked in the index


I don't know much about how the index is implemented (few do, I think), so
if there is a glaringly obvious reason why tracking directories in the
index is a bad idea, please enlighten me.


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

  reply	other threads:[~2008-04-21  8:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-19 19:28 Git performance on OS X Pieter de Bie
2008-04-19 21:22 ` Linus Torvalds
2008-04-19 21:29   ` Linus Torvalds
2008-04-19 22:08     ` Pieter de Bie
2008-04-20 16:17     ` David Kastrup
2008-04-19 21:54 ` Linus Torvalds
2008-04-19 22:00   ` Pieter de Bie
2008-04-19 22:39     ` Linus Torvalds
2008-04-20  4:14       ` Junio C Hamano
2008-04-20 11:13       ` [PATCH 01/02/RFC] implement a stat cache Luciano Rocha
2008-04-20 11:15         ` [PATCH 02/02/RFC] make use of the " Luciano Rocha
2008-04-20 11:18         ` [PATCH 01/02/RFC] implement a " Luciano Rocha
2008-04-20 16:03         ` Linus Torvalds
2008-04-20 22:04           ` Luciano Rocha
2008-04-20 22:29             ` Linus Torvalds
2008-04-20 23:07               ` Linus Torvalds
2008-04-21  0:53                 ` Dmitry Potapov
2008-04-21  8:41                   ` Johan Herland [this message]
2008-04-21  1:21                 ` Junio C Hamano
2008-04-21  3:15                   ` Linus Torvalds
2008-04-21  3:20                     ` Linus Torvalds
2008-04-21 18:27                     ` Junio C Hamano
2008-04-21 19:09                       ` Linus Torvalds
2008-04-21 20:06                         ` Junio C Hamano
2008-04-21 10:04               ` David Kastrup
2008-04-19 22:44     ` Git performance on OS X Jakub Narebski
2008-04-19 22:50       ` Linus Torvalds
2008-04-19 22:54         ` Linus Torvalds
2008-04-19 23:10           ` Pieter de Bie
2008-04-19 23:26             ` Linus Torvalds
2008-04-19 23:35               ` Roman Shaposhnik
2008-04-19 23:57                 ` Pieter de Bie
2008-04-20  0:06                 ` Linus Torvalds
2008-04-20  0:21                   ` Roman Shaposhnik
2008-04-19 23:56               ` Pieter de Bie
2008-04-20  0:31                 ` Linus Torvalds
2008-04-20  1:23                   ` Dmitry Potapov
2008-04-20 16:22                   ` David Kastrup
2008-04-19 23:04         ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804211041.41760.johan@herland.net \
    --to=johan@herland.net \
    --cc=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=luciano@eurotux.com \
    --cc=pdebie@ai.rug.nl \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.