git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Documentation/githooks: Clarify the behavior of post-checkout hook

From
MLMagne Land <magne.land@gmail.com>
Date
Mar 13, 2018, 19:59 UTC
Message-ID
<0102016220f23987-d4661c81-cf6e-4c96-8487-acce6bb365c8-000000@eu-west-1.amazonses.com>
From: Magne Land <magne.land@appfolio.com>

This can happen when using 'git rebase -i’: could not detach HEAD

Based on discovering this Stack Overflow discussion:
https://stackoverflow.com/questions/25561485/git-rebase-i-with-squash-cannot-detach-head
---
 Documentation/githooks.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index f877f7b7cd19c..3a4e027d0d175 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -166,7 +166,9 @@ worktree.  The hook is given three parameters: the ref of the previous HEAD,
 the ref of the new HEAD (which may or may not have changed), and a flag
 indicating whether the checkout was a branch checkout (changing branches,
 flag=1) or a file checkout (retrieving a file from the index, flag=0).
-This hook cannot affect the outcome of 'git checkout'.
+
+If this hook exits with a non-zero status, 'git checkout' will exit with the
+same status.
 
 It is also run after 'git clone', unless the --no-checkout (-n) option is
 used. The first parameter given to the hook is the null-ref, the second the

--
https://github.com/git/git/pull/470
Next: Jonathan Nieder
Message 1 of 2 in “Documentation/githooks: Clarify the behavior of post-checkout hook”
  1. Documentation/githooks: Clarify the behavior of post-checkout hookMagne Land, Mar 13, 2018
  2. Jonathan NiederMar 14, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.