Go to file
Linus Torvalds 044bbbcb63 Make git_dir a path relative to work_tree in setup_work_tree()
Once we find the absolute paths for git_dir and work_tree, we can make
git_dir a relative path since we know pwd will be work_tree. This should
save the kernel some time traversing the path to work_tree all the time
if git_dir is inside work_tree.

Daniel's patch didn't apply for me as-is, so I recreated it with some
differences, and here are the numbers from ten runs each.

There is some IO for me - probably due to more-or-less random flushing of
the journal - so the variation is bigger than I'd like, but whatever:

	Before:
		real    0m8.135s
		real    0m7.933s
		real    0m8.080s
		real    0m7.954s
		real    0m7.949s
		real    0m8.112s
		real    0m7.934s
		real    0m8.059s
		real    0m7.979s
		real    0m8.038s

	After:
		real    0m7.685s
		real    0m7.968s
		real    0m7.703s
		real    0m7.850s
		real    0m7.995s
		real    0m7.817s
		real    0m7.963s
		real    0m7.955s
		real    0m7.848s
		real    0m7.969s

Now, going by "best of ten" (on the assumption that the longer numbers
are all due to IO), I'm saying a 7.933s -> 7.685s reduction, and it does
seem to be outside of the noise (ie the "after" case never broke 8s, while
the "before" case did so half the time).

So looks like about 3% to me.

Doing it for a slightly smaller test-case (just the "arch" subdirectory)
gets more stable numbers probably due to not filling the journal with
metadata updates, so we have:

	Before:
		real    0m1.633s
		real    0m1.633s
		real    0m1.633s
		real    0m1.632s
		real    0m1.632s
		real    0m1.630s
		real    0m1.634s
		real    0m1.631s
		real    0m1.632s
		real    0m1.632s

	After:
		real    0m1.610s
		real    0m1.609s
		real    0m1.610s
		real    0m1.608s
		real    0m1.607s
		real    0m1.610s
		real    0m1.609s
		real    0m1.611s
		real    0m1.608s
		real    0m1.611s

where I'ld just take the averages and say 1.632 vs 1.610, which is just
over 1% peformance improvement.

So it's not in the noise, but it's not as big as I initially thought and
measured.

(That said, it obviously depends on how deep the working directory path is
too, and whether it is behind NFS or something else that might need to
cause more work to look up).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19 16:44:21 -07:00
Documentation GIT 1.5.6 2008-06-18 13:09:43 -07:00
arm
compat compat/fopen.c: avoid clobbering the system defined fopen macro 2008-05-08 17:43:01 -07:00
contrib completion: add more 'git add' options 2008-06-14 12:47:44 -07:00
git-gui Merge git://repo.or.cz/git-gui 2008-05-26 19:10:43 -07:00
gitk-git Merge git://git.kernel.org/pub/scm/gitk/gitk 2008-06-11 16:22:53 -07:00
gitweb gitweb: remove unused parse_ref method 2008-06-17 16:39:18 -07:00
mozilla-sha1
perl Git.pm: fix return value of config method 2008-06-01 22:28:27 -07:00
ppc
t clean up error conventions of remote.c:match_explicit 2008-06-18 12:39:13 -07:00
templates Fix prepare-commit-msg hook and replace in-place sed 2008-05-21 09:45:53 -07:00
xdiff
.gitattributes
.gitignore
.mailmap
COPYING
GIT-VERSION-GEN GIT 1.5.6 2008-06-18 13:09:43 -07:00
INSTALL The "curl" executable is no longer required 2008-06-15 13:44:44 -07:00
Makefile Makefile: update check-docs target 2008-06-15 13:43:32 -07:00
README
RelNotes GIT 1.5.5.4 2008-06-07 11:45:48 -07:00
alias.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
alloc.c
archive-tar.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
archive-zip.c
archive.c archive.c: format_subst - fixed bogus argument to memchr 2008-04-22 21:23:16 -07:00
archive.h
attr.c Ignore .gitattributes in bare repositories 2008-06-09 15:08:26 -07:00
attr.h
base85.c
blob.c
blob.h
branch.c Allow tracking branches to set up rebase by default. 2008-05-12 17:16:40 -07:00
branch.h
builtin-add.c git add: add long equivalents of '-u' and '-f' options 2008-06-14 12:47:31 -07:00
builtin-annotate.c
builtin-apply.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-archive.c
builtin-blame.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-branch.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-bundle.c
builtin-cat-file.c cat-file --batch / --batch-check: do not exit if hashes are missing 2008-06-09 13:46:08 -07:00
builtin-check-attr.c
builtin-check-ref-format.c
builtin-checkout-index.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-checkout.c checkout: "best effort" checkout 2008-05-29 17:35:22 -07:00
builtin-clean.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-clone.c Use nonrelative paths instead of absolute paths for cloned repositories 2008-06-06 11:23:10 -07:00
builtin-commit-tree.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-commit.c commit: drop duplicated parents 2008-06-02 23:55:57 -07:00
builtin-config.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-count-objects.c
builtin-describe.c describe: match pattern for lightweight tags too 2008-06-04 13:08:03 -07:00
builtin-diff-files.c Merge branch 'jc/diff-no-no-index' 2008-05-26 22:38:19 -07:00
builtin-diff-index.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-diff-tree.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-diff.c Merge branch 'jc/diff-no-no-index' 2008-05-26 22:38:19 -07:00
builtin-fast-export.c fast-export: Correctly generate initial commits with no parents 2008-06-12 22:42:20 -07:00
builtin-fetch--tool.c
builtin-fetch-pack.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-fetch.c builtin-fetch.c (store_updated_refs): Honor update_local_ref() return value 2008-05-28 10:47:12 -07:00
builtin-fmt-merge-msg.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-for-each-ref.c
builtin-fsck.c
builtin-gc.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-grep.c
builtin-http-fetch.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-init-db.c git-init: accept --bare option 2008-05-28 18:31:19 -07:00
builtin-log.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-ls-files.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-ls-remote.c
builtin-ls-tree.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-mailinfo.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-mailsplit.c mailsplit: minor clean-up in read_line_with_nul() 2008-05-25 13:23:57 -07:00
builtin-merge-base.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-merge-file.c
builtin-merge-ours.c
builtin-merge-recursive.c Merge branch 'js/merge-recursive' 2008-06-09 16:13:10 -07:00
builtin-mv.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-name-rev.c Merge branch 'maint' 2008-06-06 09:21:48 -07:00
builtin-pack-objects.c Remove now unnecessary 'sync()' calls 2008-05-31 14:49:29 -07:00
builtin-pack-refs.c
builtin-prune-packed.c Remove now unnecessary 'sync()' calls 2008-05-31 14:49:29 -07:00
builtin-prune.c Remove now unnecessary 'sync()' calls 2008-05-31 14:49:29 -07:00
builtin-push.c Add a remote.*.mirror configuration option 2008-04-20 18:49:22 -07:00
builtin-read-tree.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-reflog.c Make git reflog expire honour core.sharedRepository. 2008-06-15 15:54:06 -07:00
builtin-remote.c "remote prune": be quiet when there is nothing to prune 2008-06-11 23:43:25 -07:00
builtin-rerere.c builtin-rerere: fix a small leak 2008-06-17 16:39:59 -07:00
builtin-reset.c git-reset: honor -q and do not show progress message 2008-05-31 18:10:58 -07:00
builtin-rev-list.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-rev-parse.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-revert.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-rm.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-send-pack.c add special "matching refs" refspec 2008-05-04 17:41:39 -07:00
builtin-shortlog.c
builtin-show-branch.c Merge branch 'maint' 2008-05-26 19:49:01 -07:00
builtin-show-ref.c
builtin-stripspace.c
builtin-symbolic-ref.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-tag.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-tar-tree.c
builtin-unpack-objects.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-update-index.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
builtin-update-ref.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-upload-archive.c
builtin-verify-pack.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-verify-tag.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin-write-tree.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
builtin.h Print info about "git help COMMAND" on git's main usage pages 2008-06-06 09:22:18 -07: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 Make git_dir a path relative to work_tree in setup_work_tree() 2008-06-19 16:44:21 -07:00
check-builtins.sh
check-racy.c
color.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
color.h Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
combine-diff.c Cleanup xread() loops to use read_in_full() 2008-05-03 22:15:25 -07:00
command-list.txt
commit.c Remove unused code in parse_commit_buffer() 2008-06-08 13:46:37 -07:00
commit.h
config.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
config.mak.in
configure.ac Consistency: Use "libcurl" instead of "cURL library" and "curl" 2008-06-15 13:35:10 -07:00
connect.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
convert.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
copy.c copy.c: copy_fd - correctly report write errors 2008-04-22 21:21:08 -07:00
csum-file.c Make pack creation always fsync() the result 2008-05-31 14:46:57 -07:00
csum-file.h Make pack creation always fsync() the result 2008-05-31 14:46:57 -07:00
ctype.c
daemon.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
date.c Fix approxidate("never") to always return 0 2008-06-17 16:40:09 -07:00
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c "git diff": do not ignore index without --no-index 2008-05-24 00:16:39 -07:00
diff-no-index.c git diff --no-index: default to page like other diff frontends 2008-05-26 22:35:07 -07:00
diff.c Merge branch 'maint' 2008-06-16 17:39:50 -07:00
diff.h Merge branch 'jc/diff-no-no-index' 2008-05-26 22:38:19 -07:00
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c diff: make "too many files" rename warning optional 2008-05-03 13:40:43 -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
environment.c Merge branch 'db/clone-in-c' 2008-05-25 13:41:37 -07:00
exec_cmd.c
exec_cmd.h
fast-import.c Make pack creation always fsync() the result 2008-05-31 14:46:57 -07:00
fetch-pack.h
fixup-builtins
fsck.c
fsck.h
generate-cmdlist.sh
git-add--interactive.perl
git-am.sh git-am: head -1 is obsolete and doesn't work on some new systems 2008-06-17 16:40:09 -07:00
git-archimport.perl
git-bisect.sh bisect: use "$GIT_DIR/BISECT_START" to check if we are bisecting 2008-05-28 11:47:58 -07:00
git-compat-util.h Port to 12 other Platforms. 2008-06-08 14:27:46 -07:00
git-cvsexportcommit.perl Merge branch 'js/cvsexportcommit' 2008-05-25 13:37:20 -07:00
git-cvsimport.perl git-cvsimport: do not fail when CVSROOT is / 2008-06-10 22:24:01 -07:00
git-cvsserver.perl git-cvsserver: add ability to guess -kb from contents 2008-05-16 12:05:35 -07:00
git-filter-branch.sh Merge 1.5.5.3 in 2008-05-27 22:34:19 -07:00
git-instaweb.sh git-instaweb: improve auto-discovery of httpd and call conventions. 2008-06-13 22:08:30 -07:00
git-lost-found.sh
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-merge-stupid.sh
git-merge.sh git-merge: exclude unnecessary options from OPTIONS_SPEC 2008-05-21 12:54:49 -07:00
git-mergetool.sh mergetool: Make ECMerge use the settings as specified by the user in the GUI 2008-05-11 10:12:19 -07:00
git-parse-remote.sh
git-pull.sh pull --rebase: exit early when the working directory is dirty 2008-05-22 23:05:11 -07:00
git-quiltimport.sh
git-rebase--interactive.sh git-rebase -i: mention the short command aliases in the todo list 2008-06-08 13:46:37 -07:00
git-rebase.sh Ignore dirty submodule states during rebase and stash 2008-05-15 16:12:43 -07:00
git-relink.perl
git-repack.sh Remove now unnecessary 'sync()' calls 2008-05-31 14:49:29 -07:00
git-request-pull.sh
git-send-email.perl git-send-email: allow whitespace in addressee list 2008-06-08 13:46:38 -07:00
git-sh-setup.sh
git-stash.sh Ignore dirty submodule states during rebase and stash 2008-05-15 16:12:43 -07:00
git-submodule.sh git-submodule - Fix errors regarding resolve_relative_url 2008-06-14 11:34:00 -07:00
git-svn.perl git-svn: don't append extra newlines at the end of commit messages. 2008-06-14 11:47:55 -07:00
git-web--browse.sh
git.c Ignore .gitattributes in bare repositories 2008-06-09 15:08:26 -07:00
git.spec.in Update RPM spec to drop curl executable requirement 2008-06-15 13:47:14 -07:00
graph.c git log --graph: print '*' for all commits, including merges 2008-06-06 11:56:43 -07:00
graph.h log --graph --left-right: show left/right information in place of '*' 2008-05-25 12:06:52 -07:00
grep.c
grep.h
hash-object.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
hash.c
hash.h
help.c Print info about "git help COMMAND" on git's main usage pages 2008-06-06 09:22:18 -07:00
http-push.c http-push.c: remove duplicated code 2008-06-08 13:46:37 -07:00
http-walker.c Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
http.c Don't allocate too much memory in quote_ref_url 2008-06-14 12:53:09 -07:00
http.h Make walker.fetch_ref() take a struct ref. 2008-04-26 17:36:17 -07:00
ident.c commit: Show committer if automatic 2008-05-06 16:50:17 -07:00
imap-send.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
index-pack.c Make pack creation always fsync() the result 2008-05-31 14:46:57 -07:00
interpolate.c
interpolate.h
list-objects.c
list-objects.h
ll-merge.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
ll-merge.h
lockfile.c rollback lock files on more signals than just SIGINT 2008-05-31 14:33:59 -07:00
log-tree.c log --graph --left-right: show left/right information in place of '*' 2008-05-25 12:06:52 -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
match-trees.c
merge-file.c
merge-index.c
merge-recursive.h
merge-tree.c
mktag.c
mktree.c
name-hash.c
object.c
object.h
pack-check.c make verify-pack a bit more useful with bad packs 2008-06-01 23:25:38 -07:00
pack-redundant.c
pack-revindex.c
pack-revindex.h
pack-write.c Make pack creation always fsync() the result 2008-05-31 14:46:57 -07:00
pack.h
pager.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
parse-options.c
parse-options.h
patch-delta.c
patch-id.c
patch-ids.c
patch-ids.h
path-list.c
path-list.h
path.c Make git_dir a path relative to work_tree in setup_work_tree() 2008-06-19 16:44:21 -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 --pretty: do not accept bogus "--prettyshort" 2008-05-25 20:29:07 -07:00
progress.c progress.c: avoid use of dynamic-sized array 2008-06-08 13:56:32 -07:00
progress.h
quote.c
quote.h
reachable.c
reachable.h
read-cache.c Add shortcut in refresh_cache_ent() for marked entries. 2008-05-31 14:18:20 -07:00
receive-pack.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
reflog-walk.c
reflog-walk.h
refs.c Merge branch 'db/clone-in-c' 2008-05-25 13:41:37 -07:00
refs.h Allow for having for_each_ref() list extra refs 2008-05-04 17:41:44 -07:00
remote.c clean up error conventions of remote.c:match_explicit 2008-06-18 12:39:13 -07:00
remote.h Merge branch 'db/clone-in-c' 2008-05-25 13:41:37 -07:00
revision.c log --pretty: do not accept bogus "--prettyshort" 2008-05-25 20:29:07 -07:00
revision.h log and rev-list: add --graph option 2008-05-05 18:46:35 -07:00
run-command.c
run-command.h
send-pack.h
server-info.c
setup.c Make git_dir a path relative to work_tree in setup_work_tree() 2008-06-19 16:44:21 -07:00
sha1-lookup.c
sha1-lookup.h
sha1_file.c sha1_file.c: simplify parse_pack_index() 2008-06-16 22:19:00 -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
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
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
test-sha1.c
test-sha1.sh
thread-utils.c
thread-utils.h
trace.c
transport.c Merge branch 'db/clone-in-c' 2008-05-25 13:41:37 -07:00
transport.h Mark the list of refs to fetch as const 2008-05-04 17:41:44 -07:00
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unpack-file.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
unpack-trees.c unpack_trees(): allow callers to differentiate worktree errors from merge errors 2008-05-29 17:35:21 -07:00
unpack-trees.h unpack-trees: allow Porcelain to give different error messages 2008-05-19 19:30:13 -07:00
update-server-info.c
upload-pack.c
usage.c
utf8.c
utf8.h
var.c Provide git_config with a callback-data parameter 2008-05-14 12:34:44 -07:00
walker.c Fix "git clone http://$URL" to check out the worktree when asked 2008-06-04 13:33:25 -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 pack creation always fsync() the result 2008-05-31 14:46:57 -07:00
ws.c
wt-status.c Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
wt-status.h Merge branch 'js/config-cb' 2008-05-25 14:25:02 -07:00
xdiff-interface.c
xdiff-interface.h

README

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

	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.