{"thread":{"id":"27698","subject":"[PATCH] Documentation: Clarify guessing of core.bare","startedAt":"2011-06-24T14:43:31Z","lastAt":"2011-06-24T14:43:31Z","messageCount":1,"participants":["Christof Krüger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"170533","messageId":"1308926611-27917-1-git-send-email-git@christof-krueger.de","threadId":"27698","inReplyTo":null,"subject":"[PATCH] Documentation: Clarify guessing of core.bare","fromName":"Christof Krüger","fromEmail":"git@christof-krueger.de","sentAt":"2011-06-24T14:43:31Z","receivedAt":"2011-06-24T14:43:31Z","isPatch":true,"sender":{"key":"git@christof-krueger.de","avatar":null},"body":"Make clear that core.bare is guessed based on GIT_DIR only and not on\nwhat is optionally specified as a directory on the command line.\n\nWhile \"git init test.git\" creates a non-bare repo in \"test.git/.git\",\n\"GIT_DIR=test.git git init\" creates a bare repo in \"test.git\".\n\nAlso mention guessing of core.bare in the documentation of \"git init\"\nand \"git clone\".\n\nSigned-off-by: Christof Krüger <git@christof-krueger.de>\n---\n Documentation/config.txt    |    8 ++++----\n Documentation/git-clone.txt |    4 +++-\n Documentation/git-init.txt  |    6 ++++--\n 3 files changed, 11 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 6b93777..c44c112 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -311,10 +311,10 @@ core.bare::\n \tdisabled, such as linkgit:git-add[1] or linkgit:git-merge[1].\n +\n This setting is automatically guessed by linkgit:git-clone[1] or\n-linkgit:git-init[1] when the repository was created.  By default a\n-repository that ends in \"/.git\" is assumed to be not bare (bare =\n-false), while all other repositories are assumed to be bare (bare\n-= true).\n+linkgit:git-init[1] when the repository was created.  By\n+default, a bare repository is assumed if the last directory\n+component in the GIT_DIR environment variable differs from\n+\".git\".\n \n core.worktree::\n \tSet the path to the root of the working tree.\ndiff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\nindex b093e45..4a5af49 100644\n--- a/Documentation/git-clone.txt\n+++ b/Documentation/git-clone.txt\n@@ -127,7 +127,9 @@ objects from the source repository into a pack in the cloned repository.\n \tto corresponding local branch heads, without mapping\n \tthem to `refs/remotes/origin/`.  When this option is\n \tused, neither remote-tracking branches nor the related\n-\tconfiguration variables are created.\n+\tconfiguration variables are created.  Setting GIT_DIR to\n+\ta path whose last directory component is different from\n+\t\".git\" implies --bare.\n \n --mirror::\n \tSet up a mirror of the source repository.  This implies `--bare`.\ndiff --git a/Documentation/git-init.txt b/Documentation/git-init.txt\nindex f2777a7..ba3979c 100644\n--- a/Documentation/git-init.txt\n+++ b/Documentation/git-init.txt\n@@ -46,8 +46,10 @@ Only print error and warning messages, all other output will be suppressed.\n \n --bare::\n \n-Create a bare repository. If GIT_DIR environment is not set, it is set to the\n-current working directory.\n+Create a bare repository. If the GIT_DIR environment variable is not set, the\n+bare repository is created in the current working directory.  Setting GIT_DIR\n+to a path whose last directory component is different from \".git\" implies\n+--bare.\n \n --template=<template_directory>::\n \n-- \n1.7.6.rc3.2.g94021\n"}]}