Files
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
..
2007-03-22 03:05:25 -07:00
2006-12-13 09:41:18 -08:00
2007-02-17 16:16:48 -08:00
2007-04-25 13:44:45 -07:00
2007-02-12 19:33:03 -08:00
2007-05-17 17:36:57 -07:00
2007-04-16 01:14:46 -07:00
2007-05-18 21:50:56 -07:00
2007-04-15 16:01:35 -07:00
2006-06-07 11:49:35 -07:00
2007-05-07 15:39:57 -07:00
2007-06-04 22:42:49 -07:00
2007-04-26 22:43:10 -07:00
2007-05-18 21:50:56 -07:00
2007-01-11 12:58:10 -08:00
2007-05-24 21:36:53 -07:00
2007-02-08 15:35:24 -08:00
2007-02-03 21:49:54 -08:00
2007-05-26 20:24:07 -07:00
2007-02-03 21:49:54 -08:00
2007-05-24 21:36:53 -07:00
2007-02-18 16:18:43 -08:00
2007-02-26 00:26:06 -08:00
2007-03-04 17:20:38 -08:00
2007-03-14 15:56:49 -07:00
2007-03-18 14:43:29 -07:00
2007-03-28 15:28:14 -07:00
2007-04-03 19:27:41 -07:00
2007-04-21 13:57:07 -07:00
2007-04-30 17:09:48 -07:00
2007-05-08 22:11:17 -07:00
2007-05-20 00:15:53 -07:00
2007-05-20 00:15:53 -07:00
2007-04-03 22:47:01 -07:00
2007-06-02 16:02:49 -07:00
2007-05-20 00:30:39 -07:00
2007-06-02 20:02:15 -07:00