1
0
mirror of https://github.com/git/git.git synced 2024-10-01 06:01:27 +02:00
git/Documentation
Matthias Lederhofer 892c41b98a introduce GIT_WORK_TREE to specify the work tree
setup_gdg is used as abbreviation for setup_git_directory_gently.

The work tree can be specified using the environment variable
GIT_WORK_TREE and the config option core.worktree (the environment
variable has precendence over the config option).  Additionally
there is a command line option --work-tree which sets the
environment variable.

setup_gdg does the following now:

GIT_DIR unspecified
repository in .git directory
    parent directory of the .git directory is used as work tree,
    GIT_WORK_TREE is ignored

GIT_DIR unspecified
repository in cwd
    GIT_DIR is set to cwd
    see the cases with GIT_DIR specified what happens next and
    also see the note below

GIT_DIR specified
GIT_WORK_TREE/core.worktree unspecified
    cwd is used as work tree

GIT_DIR specified
GIT_WORK_TREE/core.worktree specified
    the specified work tree is used

Note on the case where GIT_DIR is unspecified and repository is in cwd:
    GIT_WORK_TREE is used but is_inside_git_dir is always true.
    I did it this way because setup_gdg might be called multiple
    times (e.g. when doing alias expansion) and in successive calls
    setup_gdg should do the same thing every time.

Meaning of is_bare/is_inside_work_tree/is_inside_git_dir:

(1) is_bare_repository
    A repository is bare if core.bare is true or core.bare is
    unspecified and the name suggests it is bare (directory not
    named .git).  The bare option disables a few protective
    checks which are useful with a working tree.  Currently
    this changes if a repository is bare:
        updates of HEAD are allowed
        git gc packs the refs
        the reflog is disabled by default

(2) is_inside_work_tree
    True if the cwd is inside the associated working tree (if there
    is one), false otherwise.

(3) is_inside_git_dir
    True if the cwd is inside the git directory, false otherwise.
    Before this patch is_inside_git_dir was always true for bare
    repositories.

When setup_gdg finds a repository git_config(git_default_config) is
always called.  This ensure that is_bare_repository makes use of
core.bare and does not guess even though core.bare is specified.

inside_work_tree and inside_git_dir are set if setup_gdg finds a
repository.  The is_inside_work_tree and is_inside_git_dir functions
will die if they are called before a successful call to setup_gdg.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-06 16:07:53 -07:00
..
howto
technical
.gitignore
asciidoc.conf
blame-options.txt
build-docdep.perl
callouts.xsl
cmd-list.perl
config.txt
core-intro.txt
core-tutorial.txt
cvs-migration.txt
diff-format.txt
diff-options.txt
diffcore.txt
docbook-xsl.css
everyday.txt
fetch-options.txt
git-add.txt
git-am.txt
git-annotate.txt
git-apply.txt
git-archimport.txt
git-archive.txt
git-bisect.txt
git-blame.txt
git-branch.txt
git-bundle.txt
git-cat-file.txt
git-check-attr.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt
git-cherry.txt
git-clean.txt
git-clone.txt
git-commit-tree.txt
git-commit.txt
git-config.txt
git-convert-objects.txt
git-count-objects.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-fast-import.txt
git-fetch-pack.txt
git-fetch.txt
git-fmt-merge-msg.txt
git-for-each-ref.txt
git-format-patch.txt
git-fsck-objects.txt
git-fsck.txt
git-gc.txt
git-get-tar-commit-id.txt
git-grep.txt
git-hash-object.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt
git-init-db.txt
git-init.txt
git-instaweb.txt
git-local-fetch.txt
git-log.txt
git-lost-found.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-p4import.txt
git-pack-objects.txt
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-peek-remote.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt
git-push.txt
git-quiltimport.txt
git-read-tree.txt
git-rebase.txt
git-receive-pack.txt
git-reflog.txt
git-relink.txt
git-remote.txt
git-repack.txt
git-repo-config.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt
git-rev-list.txt
git-rev-parse.txt introduce GIT_WORK_TREE to specify the work tree 2007-06-06 16:07:53 -07:00
git-revert.txt
git-rm.txt
git-runstatus.txt
git-send-email.txt
git-send-pack.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-ssh-fetch.txt
git-ssh-upload.txt
git-status.txt
git-stripspace.txt
git-submodule.txt
git-svn.txt
git-svnimport.txt
git-symbolic-ref.txt
git-tag.txt
git-tar-tree.txt
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-pack.txt
git-verify-tag.txt
git-whatchanged.txt
git-write-tree.txt
git.txt
gitattributes.txt
gitignore.txt
gitk.txt
glossary.txt
hooks.txt
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
Makefile
merge-options.txt
merge-strategies.txt
pretty-formats.txt
pretty-options.txt
pull-fetch-param.txt
RelNotes-1.5.0.1.txt
RelNotes-1.5.0.2.txt
RelNotes-1.5.0.3.txt
RelNotes-1.5.0.4.txt
RelNotes-1.5.0.5.txt
RelNotes-1.5.0.6.txt
RelNotes-1.5.0.7.txt
RelNotes-1.5.0.txt
RelNotes-1.5.1.1.txt
RelNotes-1.5.1.2.txt
RelNotes-1.5.1.3.txt
RelNotes-1.5.1.4.txt
RelNotes-1.5.1.5.txt
RelNotes-1.5.1.6.txt
RelNotes-1.5.1.txt
RelNotes-1.5.2.1.txt
RelNotes-1.5.2.txt
RelNotes-1.5.3.txt
repository-layout.txt
SubmittingPatches
tutorial-2.txt
tutorial.txt
urls.txt
user-manual.conf
user-manual.txt