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

[PATCH v2] git-rebase.txt: add another hook to the hooks section, and explain more

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 4, 2020, 01:30 UTC
Message-ID
<pull.749.v2.git.git.1585963816430.gitgitgadget@gmail.com>
In-Reply-To
<pull.749.git.git.1585888520572.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
For more discussion about these hooks, their history relative to rebase,
and logical consistency between different types of operations, see
  https://lore.kernel.org/git/CABPp-BG0bFKUage5cN_2yr2DkmS04W2Z9Pg5WcROqHznV3XBdw@mail.gmail.com/
and the links to some threads referenced therein.
Signed-off-by: Elijah Newren <newren@gmail.com>
---
    git-rebase.txt: add another hook to the hooks section, and explain more
    
    Changes since v1:
    
     * Updated the wording of the last sentence as per Junio's suggestion.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-749%2Fnewren%2Frebase-and-hooks-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-749/newren/rebase-and-hooks-v2
Pull-Request: https://github.com/git/git/pull/749
Range-diff vs v1:
 1:  29a1ff520ba ! 1:  45a5c1c1ff9 git-rebase.txt: add another hook to the hooks section, and explain more
     @@ Documentation/git-rebase.txt: Hooks
      +originally implemented as shell scripts and happened to invoke other
      +commands like 'git checkout' or 'git commit' that would call the
      +hooks).  Both backends should have the same behavior, though it is not
     -+entirely clear which, if any, is correct.  We will likely remove both
     -+of these hooks in the future.
     ++entirely clear which, if any, is correct.  We will likely make rebase
     ++stop calling either of these hooks in the future.
       
       Interruptability
       ~~~~~~~~~~~~~~~~
 Documentation/git-rebase.txt | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index f7a6033607f..5e0fcd4e9bd 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -684,9 +684,15 @@ Hooks
 ~~~~~
 
 The apply backend has not traditionally called the post-commit hook,
-while the merge backend has.  However, this was by accident of
-implementation rather than by design.  Both backends should have the
-same behavior, though it is not clear which one is correct.
+while the merge backend has.  In contrast, the apply backend has
+traditionally called the post-checkout hook while the merge backend
+has not.  However, the calling of these hooks in both cases was by
+accident of implementation rather than by design (both backends were
+originally implemented as shell scripts and happened to invoke other
+commands like 'git checkout' or 'git commit' that would call the
+hooks).  Both backends should have the same behavior, though it is not
+entirely clear which, if any, is correct.  We will likely make rebase
+stop calling either of these hooks in the future.
 
 Interruptability
 ~~~~~~~~~~~~~~~~

base-commit: 274b9cc25322d9ee79aa8e6d4e86f0ffe5ced925
-- 
gitgitgadget
Previous: Elijah NewrenNext: Phillip Wood
Message 4 of 6 in “git-rebase.txt: add another hook to the hooks section, and explain more”
  1. git-rebase.txt: add another hook to the hooks section, and explain moreElijah Newren via GitGitGadget, Apr 3, 2020
  2. Junio C HamanoApr 3, 2020
  3. Elijah NewrenApr 3, 2020
  4. git-rebase.txt: add another hook to the hooks section, and explain moreElijah Newren via GitGitGadget, Apr 4, 2020
  5. Phillip WoodApr 4, 2020
  6. git-rebase.txt: add another hook to the hooks section, and explain moreElijah Newren via GitGitGadget, Apr 5, 2020

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.