Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-03-29 13:38:58 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-02 07:56:59 +0300
commitaf9ded5b7007a4fa9844be7ac1c86f7a6ef2e56a (patch)
tree9d4e514308e8b02bfa08c471a14e9a6099cdacdd /t/t2020-checkout-detach.sh
parentc2a8c1dd001c9ea318f90abedfd56d364f91a2ed (diff)
checkout: advice how to get out of detached HEAD mode
Detached HEAD mode is considered dangerous and confusing for newcomers and we print a big block of warning how to move forward. But we should also suggest the user the way to get out of it if they get into detached HEAD by mistake. While at there, I also suggest how to turn the advice off. This is another thing I find annoying with advices and should be dealt with in a more generic way. But that may require some refactoring in advice.c first. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2020-checkout-detach.sh')
-rwxr-xr-xt/t2020-checkout-detach.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 1fa670625c..743c7248a2 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -206,6 +206,12 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
git checkout -b <new-branch-name>
+ Or undo this checkout with:
+
+ git checkout -
+
+ Turn off this advice by setting config variable advice.detachedHead to false
+
HEAD is now at \$commit three
EOF
@@ -282,6 +288,12 @@ test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked
git checkout -b <new-branch-name>
+ Or undo this checkout with:
+
+ git checkout -
+
+ Turn off this advice by setting config variable advice.detachedHead to false
+
HEAD is now at \$commit... three
EOF