1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-16 22:14:53 +01: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 user-manual: move howto/using-topic-branches into manual 2007-05-17 21:20:10 -04:00
technical Merge branch 'maint' 2007-03-22 03:05:25 -07:00
.gitignore Ignore all man sections as they are generated files. 2007-04-23 22:19:36 -07:00
asciidoc.conf Documentation: robustify asciidoc GIT_VERSION replacement 2007-06-02 11:28:13 -07:00
blame-options.txt Update -L documentation for git-blame/git-annotate 2007-04-26 22:43:10 -07:00
build-docdep.perl Documentation/build-docdep.perl: Fix dependencies for included asciidoc files 2007-03-01 13:24:54 -08:00
callouts.xsl spurious .sp in manpages 2006-12-13 09:41:18 -08:00
cmd-list.perl Merge branches 'lh/submodules' and 'pb/am' 2007-06-02 19:04:54 -07:00
config.txt introduce GIT_WORK_TREE to specify the work tree 2007-06-06 16:07:53 -07:00
core-intro.txt Merge branch 'maint' 2007-02-17 16:16:48 -08:00
core-tutorial.txt core-tutorial: minor fixes 2007-04-25 13:44:45 -07:00
cvs-migration.txt Documentation: mention module option to git-cvsimport 2007-03-04 16:47:32 -08:00
diff-format.txt diff format documentation: describe raw combined diff format 2007-05-04 16:58:17 -07:00
diff-options.txt Document --quiet option to git-diff 2007-03-24 22:32:55 -07:00
diffcore.txt Remove git-diff-stages. 2007-02-12 19:33:03 -08:00
docbook-xsl.css Documentation: add git user's manual 2007-01-07 20:33:06 -05:00
everyday.txt git-fsck-objects is now synonym to git-fsck 2007-01-28 16:33:58 -08:00
fetch-options.txt Document additional options for git-fetch 2007-04-26 22:43:10 -07:00
git-add.txt Merge branch 'maint' 2007-05-17 17:36:57 -07:00
git-am.txt Merge branches 'lh/submodules' and 'pb/am' 2007-06-02 19:04:54 -07:00
git-annotate.txt Update git-annotate/git-blame documentation 2007-04-16 01:14:46 -07:00
git-apply.txt Update git-apply documentation 2007-04-16 01:14:46 -07:00
git-archimport.txt git-archimport: allow remapping branch names 2007-03-07 10:30:22 -08:00
git-archive.txt Merge branch 'maint' 2007-05-18 21:50:56 -07:00
git-bisect.txt Documentation: bisect: "start" accepts one bad and many good commits 2007-04-05 15:13:14 -07:00
git-blame.txt blame -s: suppress author name and time. 2007-04-29 02:05:06 -07:00
git-branch.txt Documentation/branch: fix small typo in -D example 2007-05-14 20:17:00 -07:00
git-bundle.txt Documentation: Added [verse] to SYNOPSIS where necessary 2007-05-18 21:47:40 -07:00
git-cat-file.txt Update git-cat-file documentation 2007-01-31 13:32:38 -08:00
git-check-attr.txt Document git-check-attr 2007-04-15 16:01:35 -07:00
git-check-ref-format.txt Some doc typo fixes 2006-06-07 11:49:35 -07:00
git-checkout-index.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-checkout.txt Reverse the order of -b and --track in the man page. 2007-04-23 16:58:10 -07:00
git-cherry-pick.txt Update git-cherry-pick documentation 2007-04-18 22:07:57 -07:00
git-cherry.txt git-cherry: document limit and add diagram 2006-10-26 18:53:18 -07:00
git-clean.txt Fix minor documentation errors 2007-05-07 15:39:57 -07:00
git-clone.txt tiny fix in documentation of git-clone 2007-05-12 09:20:51 -07:00
git-commit-tree.txt Fall back to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL 2007-04-29 02:05:06 -07:00
git-commit.txt git-commit: add a --interactive option 2007-03-09 00:05:23 -08:00
git-config.txt git-config: Improve documentation of git-config file handling 2007-05-30 23:56:37 -07:00
git-convert-objects.txt Convert usage of GIT and Git into git 2005-10-10 16:01:31 -07:00
git-count-objects.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-cvsexportcommit.txt Add option to cvs update before export 2007-05-24 21:37:00 -07:00
git-cvsimport.txt cvsimport: Improve formating consistency 2007-04-06 16:46:23 -07:00
git-cvsserver.txt cvsserver: Fix some typos in asciidoc documentation 2007-05-29 00:11:22 -07:00
git-daemon.txt git-daemon documentation on enabling services. 2007-01-24 15:29:07 -08:00
git-describe.txt Teach git-describe how to run name-rev 2007-05-21 23:56:28 -07:00
git-diff-files.txt Removing -n option from git-diff-files documentation 2007-04-26 22:43:10 -07:00
git-diff-index.txt Minor grammar fixes for git-diff-index.txt 2006-11-02 18:03:31 -08:00
git-diff-tree.txt Documentation: Split description of pretty formats of commit log 2007-05-13 18:44:50 -07:00
git-diff.txt Merge branch 'master-for-junio' of git://repo.or.cz/git/fastimport; branch 'maint' 2007-03-05 21:23:46 -08:00
git-fast-import.txt Fix documentation of tag in git-fast-import.txt 2007-05-09 19:04:54 -07:00
git-fetch-pack.txt fetch & clone: do not output progress when not on a tty 2007-02-19 19:20:05 -08:00
git-fetch.txt git-fetch: document automatic tag following. 2007-02-09 15:41:35 -08:00
git-fmt-merge-msg.txt Documentation: Added [verse] to SYNOPSIS where necessary 2007-05-18 21:47:40 -07:00
git-for-each-ref.txt Documentation: Reformatted SYNOPSIS for several commands 2007-05-18 21:47:45 -07:00
git-format-patch.txt Add the --numbered-files option to git-format-patch. 2007-06-06 00:35:15 -07:00
git-fsck-objects.txt git-fsck-objects is now synonym to git-fsck 2007-01-28 16:33:58 -08:00
git-fsck.txt git-fsck: learn about --verbose 2007-06-04 22:42:49 -07:00
git-gc.txt Fix minor grammatical typos in the git-gc man page 2007-05-31 16:22:28 -07:00
git-get-tar-commit-id.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-grep.txt Update git-grep documentation 2007-04-26 22:43:10 -07:00
git-hash-object.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-http-fetch.txt Update git-http-fetch documentation 2007-04-26 22:43:11 -07:00
git-http-push.txt Update git-http-push documentation 2007-04-26 22:43:10 -07:00
git-imap-send.txt Several trivial documentation touch ups. 2006-05-05 14:21:18 -07:00
git-index-pack.txt Merge branch 'maint' 2007-05-18 21:50:56 -07:00
git-init-db.txt Document git-init 2007-01-11 12:58:10 -08:00
git-init.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-instaweb.txt Documentation: Reformatted SYNOPSIS for several commands 2007-05-18 21:47:45 -07:00
git-local-fetch.txt Documentation: Reformatted SYNOPSIS for several commands 2007-05-18 21:47:45 -07:00
git-log.txt Documentation: Split description of pretty formats of commit log 2007-05-13 18:44:50 -07:00
git-lost-found.txt Documentation: minor edits of git-lost-found manpage 2007-04-16 01:10:28 -07:00
git-ls-files.txt Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00
git-ls-remote.txt Documentation: a few spelling fixes 2007-01-17 08:44:32 -08:00
git-ls-tree.txt Add an option to git-ls-tree to display also the size of blob 2007-05-20 21:43:46 -07:00
git-mailinfo.txt Remove git-applypatch 2007-05-24 21:36:53 -07:00
git-mailsplit.txt Teach mailsplit about Maildir's 2007-05-24 19:01:56 -07:00
git-merge-base.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-merge-file.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-merge-index.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-merge-one-file.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-merge-tree.txt Documentation: add a couple of missing docs. 2006-04-13 00:21:06 -07:00
git-merge.txt Add a configuration option to control diffstat after merge 2007-05-24 21:37:08 -07:00
git-mergetool.txt Document 'opendiff' value in config.txt and git-mergetool.txt 2007-05-03 22:56:23 -07:00
git-mktag.txt
git-mktree.txt Documentation: add a couple of missing docs. 2006-04-13 00:21:06 -07:00
git-mv.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-name-rev.txt Teach git-describe how to run name-rev 2007-05-21 23:56:28 -07:00
git-p4import.txt Documentation: Reformatted SYNOPSIS for several commands 2007-05-18 21:47:45 -07:00
git-pack-objects.txt git-repack --max-pack-size: add option parsing to enable feature 2007-05-20 21:55:26 -07:00
git-pack-redundant.txt git-fsck-objects is now synonym to git-fsck 2007-01-28 16:33:58 -08:00
git-pack-refs.txt Documentation: pack-refs --all vs default behaviour 2007-01-26 00:02:51 -08:00
git-parse-remote.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-patch-id.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-peek-remote.txt rename --exec to --upload-pack for fetch-pack and peek-remote 2007-01-24 16:12:15 -08:00
git-prune-packed.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-prune.txt git-fsck-objects is now synonym to git-fsck 2007-01-28 16:33:58 -08:00
git-pull.txt Documentation/git-pull: describe default behaviour and config interactions 2007-02-08 23:35:43 -08:00
git-push.txt Documentation: Reformatted SYNOPSIS for several commands 2007-05-18 21:47:45 -07:00
git-quiltimport.txt Documentation/git-quiltimport.txt: Fix labeled list formatting 2007-03-01 13:25:14 -08:00
git-read-tree.txt Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00
git-rebase.txt Documentation: Added [verse] to SYNOPSIS where necessary 2007-05-18 21:47:40 -07:00
git-receive-pack.txt Change {pre,post}-receive hooks to use stdin 2007-03-11 22:56:03 -07:00
git-reflog.txt git reflog show 2007-02-08 15:35:24 -08:00
git-relink.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-remote.txt Documentation: fix typo in git-remote.txt 2007-05-05 23:10:59 -07:00
git-repack.txt git-repack --max-pack-size: add option parsing to enable feature 2007-05-20 21:55:26 -07:00
git-repo-config.txt [PATCH] Rename git-repo-config to git-config. 2007-01-28 16:16:53 -08:00
git-request-pull.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-rerere.txt Convert update-index references in docs to add. 2007-02-17 10:20:27 -08:00
git-reset.txt Documentation/git-reset.txt: suggest git commit --amend in example. 2007-04-23 23:55:08 -07:00
git-rev-list.txt git-rev-list: Add regexp tuning options 2007-05-20 20:31:50 -07:00
git-rev-parse.txt introduce GIT_WORK_TREE to specify the work tree 2007-06-06 16:07:53 -07:00
git-revert.txt Refer users to git-rev-parse for revision specification syntax. 2007-01-17 20:45:41 -08:00
git-rm.txt Add --ignore-unmatch option to exit with zero status when no files are removed. 2007-04-17 00:19:11 -07:00
git-runstatus.txt Convert update-index references in docs to add. 2007-02-17 10:20:27 -08:00
git-send-email.txt send-email documentation: clarify --smtp-server 2007-04-30 16:50:55 -07:00
git-send-pack.txt Assorted typo fixes 2007-02-03 21:49:54 -08:00
git-sh-setup.txt Documentation/git-sh-setup.txt: programmer's docs 2007-01-17 01:13:05 -08:00
git-shell.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-shortlog.txt git shortlog documentation: add long options and fix a typo 2007-04-27 23:17:58 -07:00
git-show-branch.txt show-branch -g: default to the current branch. 2007-02-03 23:34:22 -08:00
git-show-index.txt Convert usage of GIT and Git into git 2005-10-10 16:01:31 -07:00
git-show-ref.txt Documentation: show-ref: document --exclude-existing 2007-04-09 18:54:52 -07:00
git-show.txt Documentation: Split description of pretty formats of commit log 2007-05-13 18:44:50 -07:00
git-ssh-fetch.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-ssh-upload.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-status.txt Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00
git-stripspace.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-submodule.txt Add git-submodule command 2007-05-26 20:24:07 -07:00
git-svn.txt Add --no-rebase option to git-svn dcommit 2007-05-04 15:08:31 -07:00
git-svnimport.txt Documentation/git-svnimport.txt: fix typo. 2007-03-29 01:38:11 -07:00
git-symbolic-ref.txt add logref support to git-symbolic-ref 2007-01-28 02:16:46 -08:00
git-tag.txt Teach git-tag about showing tag annotations. 2007-06-02 20:04:14 -07:00
git-tar-tree.txt git-tar-tree: complete deprecation conversion message 2007-04-18 17:57:25 -07:00
git-tools.txt Add hg-to-git conversion utility. 2007-02-05 13:52:45 -08:00
git-unpack-file.txt
git-unpack-objects.txt fix documentation of unpack-objects -n 2007-06-06 15:20:13 -07:00
git-update-index.txt Added a reference to git-add in the documentation for git-update-index 2007-05-07 00:15:00 -07:00
git-update-ref.txt git-update-ref: add --no-deref option for overwriting/detaching ref 2007-05-10 15:24:44 -07:00
git-update-server-info.txt Documentation: HTTP needs update-server-info. 2005-12-17 11:39:39 -08:00
git-upload-archive.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git-upload-pack.txt Fixup no-progress for fetch & clone 2007-02-24 00:26:18 -08:00
git-var.txt [PATCH] Rename git-repo-config to git-config. 2007-01-28 16:16:53 -08:00
git-verify-pack.txt Fix up docs where "--" isn't displayed correctly. 2006-05-05 14:21:52 -07:00
git-verify-tag.txt Remove trailing dot after short description 2006-03-09 11:44:11 -08:00
git-whatchanged.txt Documentation/git-whatchanged.txt: show -<n> instead of --max-count. 2007-01-17 01:11:56 -08:00
git-write-tree.txt Documentation: sync git.txt command list and manual page title 2007-01-18 15:53:37 -08:00
git.txt introduce GIT_WORK_TREE to specify the work tree 2007-06-06 16:07:53 -07:00
gitattributes.txt Use $Id$ as the ident attribute keyword rather than $ident$ to be consistent with other VCSs 2007-05-14 19:03:32 -07:00
gitignore.txt Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00
gitk.txt Assorted typo fixes 2007-02-03 21:49:54 -08:00
glossary.txt Documentation: Add definition of "evil merge" to GIT Glossary 2007-05-25 20:54:38 -07:00
hooks.txt Remove git-applypatch 2007-05-24 21:36:53 -07:00
howto-index.sh
i18n.txt Documentation/i18n.txt: it is i18n.commitencoding not core.commitencoding 2007-02-18 15:58:20 -08:00
install-doc-quick.sh Makefile: add quick-install-doc for installing pre-built manpages 2006-12-23 09:22:30 -08:00
install-webdoc.sh user-manual: install user manual stylesheet with other web documents 2007-03-10 23:05:02 -05:00
Makefile Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00
merge-options.txt Add a configuration option to control diffstat after merge 2007-05-24 21:37:08 -07:00
merge-strategies.txt Documentation: recursive is the default strategy these days. 2005-12-08 14:04:33 -08:00
pretty-formats.txt Documentation: Split description of pretty formats of commit log 2007-05-13 18:44:50 -07:00
pretty-options.txt Documentation: Split description of pretty formats of commit log 2007-05-13 18:44:50 -07:00
pull-fetch-param.txt Documentation: remove master:origin example from pull-fetch-param.txt 2007-01-01 14:38:08 -08:00
RelNotes-1.5.0.1.txt GIT 1.5.0.1 2007-02-18 16:18:43 -08:00
RelNotes-1.5.0.2.txt GIT 1.5.0.2 2007-02-26 00:26:06 -08:00
RelNotes-1.5.0.3.txt GIT 1.5.0.3 2007-03-04 17:20:38 -08:00
RelNotes-1.5.0.4.txt GIT 1.5.0.4 2007-03-14 15:56:49 -07:00
RelNotes-1.5.0.5.txt GIT 1.5.0.5 2007-03-18 14:43:29 -07:00
RelNotes-1.5.0.6.txt GIT 1.5.0.6 2007-03-28 15:28:14 -07:00
RelNotes-1.5.0.7.txt GIT 1.5.0.7 2007-04-03 19:27:41 -07:00
RelNotes-1.5.0.txt git-clone: Sync documentation to usage note. 2007-02-19 18:14:29 -08:00
RelNotes-1.5.1.1.txt git-svn: don't allow globs to match regular files 2007-04-18 12:39:04 -07:00
RelNotes-1.5.1.2.txt GIT 1.5.1.2 2007-04-21 13:57:07 -07:00
RelNotes-1.5.1.3.txt GIT v1.5.1.3 2007-04-30 17:09:48 -07:00
RelNotes-1.5.1.4.txt GIT v1.5.1.4 2007-05-08 22:11:17 -07:00
RelNotes-1.5.1.5.txt GIT 1.5.1.6 2007-05-20 00:15:53 -07:00
RelNotes-1.5.1.6.txt GIT 1.5.1.6 2007-05-20 00:15:53 -07:00
RelNotes-1.5.1.txt GIT 1.5.1 2007-04-03 22:47:01 -07:00
RelNotes-1.5.2.1.txt GIT 1.5.2.1 2007-06-02 16:02:49 -07:00
RelNotes-1.5.2.txt GIT 1.5.2 2007-05-20 00:30:39 -07:00
RelNotes-1.5.3.txt Release Notes: start preparing for 1.5.3 2007-06-02 19:34:54 -07:00
repository-layout.txt Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00
SubmittingPatches Update to SubmittingPatches 2007-06-02 20:02:15 -07:00
tutorial-2.txt tutorials: add user-manual links 2007-05-19 00:57:19 -04:00
tutorial.txt tutorial: revise index introduction 2007-05-19 01:00:27 -04:00
urls.txt Fix formatting for urls section of fetch, pull, and push manpages 2006-12-31 18:40:17 -08:00
user-manual.conf Documentation: add git user's manual 2007-01-07 20:33:06 -05:00
user-manual.txt Create a new manpage for the gitignore format, and reference it elsewhere 2007-06-02 11:59:19 -07:00