1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-08 18:23:01 +01:00
Find a file
Linus Torvalds c40641b77b Optimize symlink/directory detection
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: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-10 18:16:31 -07:00
arm
compat compat/fopen.c: avoid clobbering the system defined fopen macro 2008-05-08 17:43:01 -07:00
contrib Merge branch 'sg/merge-options' (early part) 2008-05-08 20:06:36 -07:00
Documentation Merge branch 'maint' 2008-05-08 20:50:03 -07:00
git-gui Merge git://repo.or.cz/git-gui 2008-04-04 22:38:32 -07:00
gitk-git Merge git://git.kernel.org/pub/scm/gitk/gitk 2008-04-07 21:52:23 -07:00
gitweb gitweb: Use feed link according to current view 2008-04-26 17:48:48 -07:00
mozilla-sha1
perl Git.pm: Don't require repository instance for ident 2008-03-15 01:43:56 -07:00
ppc
t Merge branch 'py/diff-submodule' 2008-05-10 18:16:25 -07:00
templates Merge branch 'maint' 2008-02-29 00:00:09 -08:00
xdiff
.gitattributes
.gitignore use build-time SHELL_PATH in test scripts 2008-02-29 00:00:29 -08:00
.mailmap
alias.c make alias lookup a public, procedural function 2008-02-24 18:31:49 -08:00
alloc.c
archive-tar.c git-archive: ignore prefix when checking file attribute 2008-04-10 00:20:38 -07:00
archive-zip.c git-archive: ignore prefix when checking file attribute 2008-04-10 00:20:38 -07:00
archive.c archive.c: format_subst - fixed bogus argument to memchr 2008-04-22 21:23:16 -07:00
archive.h
attr.c gitattributes: Fix subdirectory attributes specified from root directory 2008-04-22 21:12:37 -07:00
attr.h
base85.c
blob.c
blob.h
branch.c
branch.h
builtin-add.c Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes) 2008-03-07 00:14:43 -08:00
builtin-annotate.c
builtin-apply.c Optimize symlink/directory detection 2008-05-10 18:16:31 -07:00
builtin-archive.c
builtin-blame.c
builtin-branch.c git-branch: add support for --merged and --no-merged 2008-04-20 18:16:46 -07:00
builtin-bundle.c Always set *nongit_ok in setup_git_directory_gently() 2008-03-26 15:41:35 -07:00
builtin-cat-file.c
builtin-check-attr.c
builtin-check-ref-format.c
builtin-checkout-index.c
builtin-checkout.c Merge branch 'maint' 2008-05-03 22:15:09 -07:00
builtin-clean.c git clean: Don't automatically remove directories when run within subdirectory 2008-04-14 23:14:58 -07:00
builtin-commit-tree.c
builtin-commit.c Avoid some unnecessary lstat() calls 2008-05-10 18:16:30 -07:00
builtin-config.c Merge branch 'mk/color' 2008-04-19 21:09:54 -07:00
builtin-count-objects.c
builtin-describe.c Merge branch 'jc/describe-always' 2008-03-08 20:10:09 -08:00
builtin-diff-files.c Always set *nongit_ok in setup_git_directory_gently() 2008-03-26 15:41:35 -07:00
builtin-diff-index.c
builtin-diff-tree.c
builtin-diff.c Always set *nongit_ok in setup_git_directory_gently() 2008-03-26 15:41:35 -07:00
builtin-fast-export.c Merge branch 'jm/free' 2008-02-27 13:03:50 -08:00
builtin-fetch--tool.c
builtin-fetch-pack.c fetch-pack: brown paper bag fix 2008-04-30 11:42:05 -07:00
builtin-fetch.c Merge branch 'jk/fetch-status' 2008-05-05 19:16:12 -07:00
builtin-fmt-merge-msg.c Merge branch 'sg/merge-options' (early part) 2008-05-08 20:06:36 -07:00
builtin-for-each-ref.c builtin-for-each-ref.c: fix typo in error message 2008-02-24 18:34:34 -08:00
builtin-fsck.c Merge branch 'mk/maint-parse-careful' 2008-03-02 15:11:07 -08:00
builtin-gc.c git-gc --auto: add pre-auto-gc hook 2008-04-09 01:31:13 -07:00
builtin-grep.c add NO_EXTERNAL_GREP build option 2008-03-13 00:57:53 -07:00
builtin-http-fetch.c Merge branch 'mh/maint-http-proxy-fix' 2008-03-02 15:11:26 -08:00
builtin-init-db.c Make core.sharedRepository more generic 2008-04-16 18:23:54 -07:00
builtin-log.c Remove dead code: show_log() sep argument and diff_options.msg_sep 2008-05-03 11:48:03 -07:00
builtin-ls-files.c Revert part of d089eba (setup: sanitize absolute and funny paths in get_pathspec()) 2008-03-07 00:14:43 -08:00
builtin-ls-remote.c Always set *nongit_ok in setup_git_directory_gently() 2008-03-26 15:41:35 -07:00
builtin-ls-tree.c
builtin-mailinfo.c
builtin-mailsplit.c
builtin-merge-base.c
builtin-merge-file.c Merge branch 'maint' 2008-03-14 00:16:42 -07:00
builtin-merge-ours.c
builtin-merge-recursive.c Merge branch 'maint' 2008-03-14 00:16:42 -07:00
builtin-mv.c Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files) 2008-03-07 00:14:43 -08:00
builtin-name-rev.c describe --always: fall back to showing an abbreviated object name 2008-03-03 00:52:17 -08:00
builtin-pack-objects.c pack-objects: proper pack time stamping with --max-pack-size 2008-03-13 22:51:30 -07:00
builtin-pack-refs.c
builtin-prune-packed.c
builtin-prune.c builtin-prune: protect objects listed on the command line 2008-03-27 15:39:57 -07:00
builtin-push.c Add a remote.*.mirror configuration option 2008-04-20 18:49:22 -07:00
builtin-read-tree.c Move name hashing functions into a file of its own 2008-04-09 01:22:25 -07:00
builtin-reflog.c builtin-reflog.c: don't install new reflog on write failure 2008-02-27 13:26:24 -08:00
builtin-remote.c Merge branch 'pb/remote-mirror-config' 2008-05-05 19:15:39 -07:00
builtin-rerere.c Merge branch 'maint' 2008-02-26 00:14:22 -08:00
builtin-reset.c Make builtin-reset.c use parse_options. 2008-03-05 12:16:27 -08:00
builtin-rev-list.c Add --reverse to the git-rev-list usage string 2008-03-19 17:31:51 -07:00
builtin-rev-parse.c rev-parse: fix --verify to error out when passed junk after a good rev 2008-04-27 13:19:46 -07:00
builtin-revert.c Allow cherry-pick (and revert) to add signoff line 2008-04-26 14:06:17 -07:00
builtin-rm.c
builtin-send-pack.c Tighten refspec processing 2008-03-26 00:10:55 -07:00
builtin-shortlog.c Merge branch 'maint-1.5.4' into maint 2008-04-12 15:41:19 -07:00
builtin-show-branch.c
builtin-show-ref.c
builtin-stripspace.c
builtin-symbolic-ref.c
builtin-tag.c Merge branch 'maint-1.5.4' into maint 2008-04-10 00:29:33 -07:00
builtin-tar-tree.c
builtin-unpack-objects.c unpack-objects: fix --strict handling 2008-03-05 10:53:11 -08:00
builtin-update-index.c
builtin-update-ref.c
builtin-upload-archive.c
builtin-verify-pack.c make verify_one_pack() a bit less wrong wrt packed_git structure 2008-03-01 01:44:45 -08:00
builtin-verify-tag.c verify-tag: Clean up the temporary file if gpg cannot be started. 2008-04-02 00:08:30 -07:00
builtin-write-tree.c
builtin.h Make git-remote a builtin 2008-03-01 01:51:44 -08:00
bundle.c
bundle.h
cache-tree.c Merge branch 'maint-1.5.4' into maint 2008-04-24 21:50:48 -07:00
cache-tree.h
cache.h Optimize symlink/directory detection 2008-05-10 18:16:31 -07:00
check-builtins.sh
check-racy.c
color.c
color.h
combine-diff.c Cleanup xread() loops to use read_in_full() 2008-05-03 22:15:25 -07:00
command-list.txt
commit.c builtin-fsck: reports missing parent commits 2008-02-25 23:57:35 -08:00
commit.h log: teach "terminator" vs "separator" mode to "--pretty=format" 2008-04-10 03:25:03 -07:00
config.c Merge branch 'lt/case-insensitive' 2008-05-10 18:14:28 -07:00
config.mak.in autoconf: Test FREAD_READS_DIRECTORIES 2008-03-11 02:10:43 -07:00
configure.ac autoconf: Test FREAD_READS_DIRECTORIES 2008-03-11 02:10:43 -07:00
connect.c
convert.c
copy.c copy.c: copy_fd - correctly report write errors 2008-04-22 21:21:08 -07:00
COPYING
csum-file.c
csum-file.h
ctype.c
daemon.c daemon: ensure that base-path is an existing directory 2008-02-27 14:47:36 -08:00
date.c timezone_names[]: fixed the tz offset for New Zealand. 2008-02-25 21:56:10 -08:00
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c Optimize symlink/directory detection 2008-05-10 18:16:31 -07:00
diff.c Remove dead code: show_log() sep argument and diff_options.msg_sep 2008-05-03 11:48:03 -07:00
diff.h Remove dead code: show_log() sep argument and diff_options.msg_sep 2008-05-03 11:48:03 -07:00
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c Merge branch 'jc/rename' 2008-04-09 01:09:12 -07:00
diffcore.h
dir.c Merge branch 'lt/case-insensitive' 2008-05-10 18:14:28 -07:00
dir.h
dump-cache-tree.c
entry.c Fix possible Solaris problem in 'checkout_entry()' 2008-03-18 22:18:57 -07:00
environment.c Merge branch 'lt/case-insensitive' 2008-05-10 18:14:28 -07:00
exec_cmd.c
exec_cmd.h
fast-import.c fast-import: Allow "reset" to delete a new branch without error 2008-03-16 14:24:32 -07:00
fetch-pack.h Teach fetch-pack/upload-pack about --include-tag 2008-03-04 23:28:14 -08:00
fixup-builtins
fsck.c fsck.c: fix bogus "empty tree" check 2008-03-05 10:32:01 -08:00
fsck.h add common fsck error printing function 2008-02-25 23:57:35 -08:00
generate-cmdlist.sh
git-add--interactive.perl add--interactive: allow user to choose mode update 2008-03-27 13:54:57 -07:00
git-am.sh Merge branch 'jc/maint-rebase-am' into maint 2008-04-19 23:01:51 -07:00
git-archimport.perl
git-bisect.sh Merge branch 'maint' 2008-04-16 00:45:52 -07:00
git-clone.sh Be more careful with objects directory permissions on clone 2008-05-06 21:34:35 -07:00
git-compat-util.h compat-util: avoid macro redefinition warning 2008-05-08 17:47:25 -07:00
git-cvsexportcommit.perl Merge branch 'js/maint-cvsexport' into maint 2008-03-08 02:13:52 -08:00
git-cvsimport.perl Merge branch 'maint-1.5.4' into maint 2008-04-29 22:55:07 -07:00
git-cvsserver.perl Merge branch 'pb/cvsserver' 2008-04-02 00:22:20 -07:00
git-filter-branch.sh Merge branch 'bc/filter-branch' 2008-05-05 19:16:20 -07:00
git-instaweb.sh
git-lost-found.sh
git-merge-octopus.sh
git-merge-one-file.sh git-merge-one-file: fix longstanding stupid thinko 2008-03-18 22:17:17 -07:00
git-merge-resolve.sh
git-merge-stupid.sh
git-merge.sh merge, pull: add '--(no-)log' command line option 2008-04-12 19:28:18 -07:00
git-mergetool.sh Teach git mergetool to use custom commands defined at config time 2008-03-05 12:07:04 -08:00
git-parse-remote.sh
git-pull.sh merge, pull: add '--(no-)log' command line option 2008-04-12 19:28:18 -07:00
git-quiltimport.sh quiltimport: fix misquoting of parsed -p<num> parameter 2008-03-12 21:07:19 -07:00
git-rebase--interactive.sh remove use of "tail -n 1" and "tail -1" 2008-03-13 00:57:52 -07:00
git-rebase.sh rebase [--onto O] A B: omit needless checkout 2008-03-16 01:25:24 -07:00
git-relink.perl
git-repack.sh
git-request-pull.sh
git-send-email.perl send-email: Don't require to be called in a repository 2008-03-15 01:43:56 -07:00
git-sh-setup.sh
git-stash.sh
git-submodule.sh Merge branch 'lh/git-file' 2008-05-05 19:16:16 -07:00
git-svn.perl git-svn: Make create-ignore use git add -f 2008-05-05 16:54:16 -07:00
GIT-VERSION-GEN Teach GIT-VERSION-GEN about the .git file 2008-04-09 01:22:50 -07:00
git-web--browse.sh web--browse: use custom commands defined at config time 2008-03-14 00:31:06 -07:00
git.c make git-status use a pager 2008-04-29 23:11:57 -07:00
git.spec.in
grep.c
grep.h
hash-object.c
hash.c Add 'const' where appropriate to index handling functions 2008-03-09 00:43:48 -08:00
hash.h Add 'const' where appropriate to index handling functions 2008-03-09 00:43:48 -08:00
help.c help: use "man.<tool>.cmd" as custom man viewer command 2008-04-26 14:33:56 -07:00
http-push.c Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
http-walker.c Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
http.c Make ls-remote http://... list HEAD, like for git://... 2008-04-26 17:36:18 -07:00
http.h Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
ident.c ident.c: reword error message when the user name cannot be determined 2008-03-08 19:43:21 -08:00
imap-send.c Don't force imap.host to be set when imap.tunnel is set 2008-04-22 21:42:23 -07:00
index-pack.c index-pack: introduce checking mode 2008-02-28 21:56:02 -08:00
INSTALL INSTALL: add a note about GNU interactive tools has been renamed 2008-05-05 16:53:54 -07:00
interpolate.c
interpolate.h
list-objects.c
list-objects.h
ll-merge.c
ll-merge.h
lockfile.c
log-tree.c log: print log entry terminator even if the message is empty 2008-05-03 11:50:41 -07:00
log-tree.h Remove dead code: show_log() sep argument and diff_options.msg_sep 2008-05-03 11:48:03 -07:00
mailmap.c
mailmap.h
Makefile Merge branch 'lt/case-insensitive' 2008-05-10 18:14:28 -07:00
match-trees.c
merge-file.c
merge-index.c
merge-recursive.h
merge-tree.c Make 'traverse_trees()' traverse conflicting DF entries in parallel 2008-03-09 00:43:47 -08:00
mktag.c mktag.c: tweak validation of tagger field and adjust test script 2008-03-31 22:43:34 -07:00
mktree.c
name-hash.c Make hash_name_lookup able to do case-independent lookups 2008-04-09 01:22:25 -07:00
object.c
object.h Remove unused object-ref code 2008-02-25 23:57:35 -08:00
pack-check.c add storage size output to 'git verify-pack -v' 2008-03-01 01:44:46 -08:00
pack-redundant.c
pack-revindex.c factorize revindex code out of builtin-pack-objects.c 2008-03-01 01:44:45 -08:00
pack-revindex.h factorize revindex code out of builtin-pack-objects.c 2008-03-01 01:44:45 -08:00
pack-write.c Cleanup xread() loops to use read_in_full() 2008-05-03 22:15:25 -07:00
pack.h
pager.c
parse-options.c Merge branch 'maint-1.5.4' into maint 2008-04-10 00:29:33 -07:00
parse-options.h parse-options.c: introduce OPT_DATE 2008-03-27 13:55:15 -07:00
patch-delta.c
patch-id.c
patch-ids.c
patch-ids.h
path-list.c path-list: add functions to work with unsorted lists 2008-03-01 01:51:44 -08:00
path-list.h path-list: add functions to work with unsorted lists 2008-03-01 01:51:44 -08:00
path.c Make read_in_full() and write_in_full() consistent with xread() and xwrite() 2008-04-29 23:11:57 -07:00
pkt-line.c Cleanup xread() loops to use read_in_full() 2008-05-03 22:15:25 -07:00
pkt-line.h
pretty.c log: teach "terminator" vs "separator" mode to "--pretty=format" 2008-04-10 03:25:03 -07:00
progress.c
progress.h
quote.c Merge branch 'dp/clean-fix' 2008-03-08 21:29:56 -08:00
quote.h Make private quote_path() in wt-status.c available as quote_path_relative() 2008-03-07 21:22:25 -08:00
reachable.c
reachable.h
read-cache.c Avoid some unnecessary lstat() calls 2008-05-10 18:16:30 -07:00
README
receive-pack.c receive-pack: allow using --strict mode for unpacking objects 2008-03-05 11:36:30 -08:00
reflog-walk.c
reflog-walk.h
refs.c Merge branch 'lh/git-file' 2008-05-05 19:16:16 -07:00
refs.h
RelNotes First batch of post 1.5.5 updates 2008-04-20 16:03:40 -07:00
remote.c Merge branch 'db/learn-HEAD' 2008-05-08 20:06:23 -07:00
remote.h Merge branch 'db/learn-HEAD' 2008-05-08 20:06:23 -07:00
revision.c Merge branch 'jc/terminator-separator' 2008-04-19 21:10:54 -07:00
revision.h log: teach "terminator" vs "separator" mode to "--pretty=format" 2008-04-10 03:25:03 -07:00
run-command.c run-command: Redirect stderr to a pipe before redirecting stdout to stderr 2008-03-05 12:18:03 -08:00
run-command.h
send-pack.h
server-info.c
setup.c Merge branch 'lh/git-file' 2008-05-05 19:16:16 -07:00
sha1-lookup.c sha1-lookup: make selection of 'middle' less aggressive 2008-04-09 01:30:18 -07:00
sha1-lookup.h sha1-lookup: more memory efficient search in sorted list of SHA-1 2008-04-09 01:23:52 -07:00
sha1_file.c Cleanup xread() loops to use read_in_full() 2008-05-03 22:15:25 -07:00
sha1_name.c Merge branch 'maint-1.5.4' into maint 2008-04-29 22:55:07 -07:00
shallow.c
shell.c
shortlog.h Add API access to shortlog 2008-02-25 19:57:06 -08:00
show-index.c
sideband.c
sideband.h
strbuf.c
strbuf.h
symlinks.c Optimize symlink/directory detection 2008-05-10 18:16:31 -07:00
tag.c Merge branch 'mk/maint-parse-careful' 2008-03-02 15:11:07 -08:00
tag.h
tar.h
test-absolute-path.c
test-chmtime.c
test-date.c
test-delta.c
test-genrandom.c
test-match-trees.c
test-parse-options.c parse-options: new option type to treat an option-like parameter as an argument. 2008-03-02 14:07:47 -08:00
test-sha1.c
test-sha1.sh more tr portability test script fixes 2008-03-13 00:57:52 -07:00
thread-utils.c
thread-utils.h
trace.c
transport.c Make ls-remote http://... list HEAD, like for git://... 2008-04-26 17:36:18 -07:00
transport.h Teach git-fetch to exploit server side automatic tag following 2008-03-04 23:28:15 -08:00
tree-diff.c
tree-walk.c Fix tree-walking compare_entry() in the presense of --prefix 2008-03-09 00:43:47 -08:00
tree-walk.h Make 'traverse_trees()' traverse conflicting DF entries in parallel 2008-03-09 00:43:47 -08:00
tree.c Merge branch 'mk/maint-parse-careful' 2008-03-02 15:11:07 -08:00
tree.h
unpack-file.c
unpack-trees.c Optimize symlink/directory detection 2008-05-10 18:16:31 -07:00
unpack-trees.h Make branch merging aware of underlying case-insensitive filsystems 2008-04-09 01:22:25 -07:00
update-server-info.c
upload-pack.c Teach fetch-pack/upload-pack about --include-tag 2008-03-04 23:28:14 -08:00
usage.c
utf8.c
utf8.h
var.c var: Don't require to be in a git repository. 2008-03-15 01:43:56 -07:00
walker.c Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
walker.h Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
write_or_die.c Make read_in_full() and write_in_full() consistent with xread() and xwrite() 2008-04-29 23:11:57 -07:00
ws.c git-apply --whitespace=fix: fix off by one thinko 2008-02-26 12:24:40 -08:00
wt-status.c builtin-status: submodule summary support 2008-04-12 20:00:45 -07:00
wt-status.h
xdiff-interface.c Merge branch 'maint' 2008-03-14 00:16:42 -07:00
xdiff-interface.h

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.