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

git rebase backend change: post-checkout hook is not ran by 'merge' backend

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Apr 2, 2020, 15:57 UTC
Message-ID
<9945492E-1D97-4741-B999-F30CA561D4DE@gmail.com>
Hello,

I'm not sure if this has been reported yet (couldn't find it), but I noticed a behavioral difference between the merge and apply backends that is not mentioned in the documentation: The 'apply' backend will run the post-checkout hook just after moving HEAD to the commit we are rebasing onto; this does not happen with the merge backend:

    $ echo "echo \"Running post-checkout hook\"" > .git/hooks/post-checkout
    $ git checkout -b <branch1> <commit2>
    $ git rebase upstream/master --apply
    First, rewinding head to replay your work on top of it...
    Running post-checkout hook
    Applying: <commit1>
    Applying: <commit2>
    $ git checkout -b <branch2> <commit2>
    Successfully rebased and updated refs/heads/<branch2>

Cheers, Philippe.

Next: Philippe Blain
Message 1 of 4 in “git rebase backend change: post-checkout hook is not ran by 'merge' backend”
  1. Philippe BlainApr 2, 2020
  2. Philippe BlainApr 2, 2020
  3. Elijah NewrenApr 2, 2020
  4. Phillip WoodApr 3, 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.