1. 12 5月, 2008 10 次提交
  2. 11 5月, 2008 4 次提交
    • L
      Optimize symlink/directory detection · c40641b7
      Linus Torvalds 提交于
      This is the base for making symlink detection in the middle fo a pathname
      saner and (much) more efficient.
      
      Under various loads, we want to verify that the full path leading up to a
      filename is a real directory tree, and that when we successfully do an
      'lstat()' on a filename, we don't get a false positive due to a symlink in
      the middle of the path that git should have seen as a symlink, not as a
      normal path component.
      
      The 'has_symlink_leading_path()' function already did this, and cached
      a single level of symlink information, but didn't cache the _lack_ of a
      symlink, so the normal behaviour was actually the wrong way around, and we
      ended up doing an 'lstat()' on each path component to check that it was a
      real directory.
      
      This caches the last detected full directory and symlink entries, and
      speeds up especially deep directory structures a lot by avoiding to
      lstat() all the directories leading up to each entry in the index.
      
      [ This can - and should - probably be extended upon so that we eventually
        never do a bare 'lstat()' on any path entries at *all* when checking the
        index, but always check the full path carefully. Right now we do not
        generally check the whole path for all our normal quick index
        revalidation.
      
        We should also make sure that we're careful about all the invalidation,
        ie when we remove a link and replace it by a directory we should
        invalidate the symlink cache if it matches (and vice versa for the
        directory cache).
      
        But regardless, the basic function needs to be sane to do that. The old
        'has_symlink_leading_path()' was not capable enough - or indeed the code
        readable enough - to really do that sanely. So I'm pushing this as not
        just an optimization, but as a base for further work. ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c40641b7
    • L
      Avoid some unnecessary lstat() calls · d177cab0
      Linus Torvalds 提交于
      The commit sequence used to do
      
      	if (file_exists(p->path))
      		add_file_to_cache(p->path, 0);
      
      where both "file_exists()" and "add_file_to_cache()" needed to do a
      lstat() on the path to do their work.
      
      This cuts down 'lstat()' calls for the partial commit case by two
      for each path we know about (because we do this twice per path).
      
      Just move the lstat() to the caller instead (that's all that
      "file_exists()" really does), and pass the stat information down to the
      add_to_cache() function.
      
      This essentially makes 'add_to_index()' the core function that adds a path
      to the index, getting the index pointer, the pathname and the stat
      information as arguments. There are then shorthand helper functions that
      use this core function:
      
       - 'add_to_cache()' is just 'add_to_index()' with the default index
      
       - 'add_file_to_cache/index()' is the same, but does the lstat() call
         itself, so you can pass just the pathname if you don't already have the
         stat information available.
      
      So old users of the 'add_file_to_xyzzy()' are essentially left unchanged,
      and this just exposes the more generic helper function that can take
      existing stat information into account.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d177cab0
    • J
      Merge branch 'py/diff-submodule' · 2855e70a
      Junio C Hamano 提交于
      * py/diff-submodule:
        is_racy_timestamp(): do not check timestamp for gitlinks
        diff-lib.c: rename check_work_tree_entity()
        diff: a submodule not checked out is not modified
        Add t7506 to test submodule related functions for git-status
        t4027: test diff for submodule with empty directory
      2855e70a
    • J
      Merge branch 'lt/case-insensitive' · 380a7426
      Junio C Hamano 提交于
      * lt/case-insensitive:
        Make git-add behave more sensibly in a case-insensitive environment
        When adding files to the index, add support for case-independent matches
        Make unpack-tree update removed files before any updated files
        Make branch merging aware of underlying case-insensitive filsystems
        Add 'core.ignorecase' option
        Make hash_name_lookup able to do case-independent lookups
        Make "index_name_exists()" return the cache_entry it found
        Move name hashing functions into a file of its own
        Make unpack_trees_options bit flags actual bitfields
      380a7426
  3. 09 5月, 2008 14 次提交
  4. 07 5月, 2008 2 次提交
  5. 06 5月, 2008 10 次提交