git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tom Rutherford <tmrutherford@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: post-checkout hook aborts rebase
Date: Wed, 26 Aug 2020 17:13:19 -0700	[thread overview]
Message-ID: <xmqq7dtlt080.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAHr-Uu_KeAJZrd+GzymNP47iFi+dZkvVYsWQPtzT_FQrVnWTDg@mail.gmail.com> (Tom Rutherford's message of "Wed, 26 Aug 2020 16:10:42 -0700")

Tom Rutherford <tmrutherford@gmail.com> writes:

> What did you expect to happen? (Expected behavior)
>
> The rebase succeeds.
>
> I expect this because the documentation for the post-checkout hook
> states, "This hook cannot affect the outcome of git switch or git
> checkout" https://www.git-scm.com/docs/githooks#_post_checkout

In general, pre-<anything> hook is run before <anything> subcommand
is executed, and by exiting with non-zero status, the hook can tell
the <anything> subcommand not to proceed.  post-<anything> hook, on
the other hand, runs _after_ <anything> has done its thing already,
so by definition, it cannot say "Hey, <anything>, don't continue".

That is the primary meaning of "cannot affect" in that description. 

Without looking at the contents of the actual hook is, nobody can
say anything definite, but it also means that "Your hook is NOT
ALLOWED TO do any extra modification to files and the index 'git
switch' or 'git checkout' made".  If "git rebase" or whatever
command wanted to place files and the index into some state by using
"git checkout" command, and if the post-checkout hook mucked with
the state in such a way that contradicts with what the "git rebase"
command wanted them to be in, it is not surprising the hook's behavior
broke "git rebase"'s operation.

  reply	other threads:[~2020-08-27  0:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 23:10 post-checkout hook aborts rebase Tom Rutherford
2020-08-27  0:13 ` Junio C Hamano [this message]
2020-08-27  0:22   ` Junio C Hamano
2020-08-27  0:44     ` Tom Rutherford
2020-08-27  5:44       ` Chris Torek
2020-08-27 15:51         ` Junio C Hamano
2020-08-27 19:04           ` Chris Torek
2020-08-27 20:11             ` Elijah Newren
2020-08-27 20:32               ` Chris Torek
2020-09-09  9:43       ` Phillip Wood
2020-09-09 16:07         ` Tom Rutherford
2020-09-11 20:25         ` Philippe Blain
2020-09-12  0:51           ` Junio C Hamano
2020-08-27 16:27     ` Elijah Newren
2020-08-27 17:27       ` Junio C Hamano
2020-08-27 17:47         ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7dtlt080.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tmrutherford@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).