git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Adam \"Sinus\" Skawiński" <adam.skawinski@sinpi.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: receive.denyCurrentBranch=updateInstead won't update the repo
Date: Wed, 19 Jul 2023 00:49:45 +0200	[thread overview]
Message-ID: <CAGE71k28Gao4xuR565qsLmPH02tVAdoCZPeuCjo7r9YZXWs82Q@mail.gmail.com> (raw)
In-Reply-To: <xmqqa5vsg8gp.fsf@gitster.g>

Oh. Then it's different from the other hooks, which merely enhance or
abort the default behaviour by returning non-zero! I hadn't thought of
that. The documentation is phrased in a way that made me assume "This
hook is to be used to override the default behaviour" means overriding
the tree cleanliness checks, not replacing the whole deployment
routine, which - if a hook is in place - needs to be fully
reimplemented in the hook.

All in all, I'm glad it works now. Thank you for the explanation, I
shall bother you no more. :)

On Wed, 19 Jul 2023 at 00:29, Junio C Hamano <gitster@pobox.com> wrote:
>
> "Adam \"Sinus\" Skawiński"  <adam.skawinski@sinpi.net> writes:
>
> > Correct me if I'm wrong, but I'm looking at receive-pack.c and can't
> > grasp one thing.
> >
> > In receive-pack.c:1452-1453,
> >> if (!invoked_hook)
> >>   retval = push_to_deploy(sha1, &env, worktree->path);
> > ... push_to_deploy is reached only if... hook didn't get invoked?
>
> Correct.  The hook is responsible for both DECIDING if it wants to
> touch/update the working tree, AND ACTUALLY UPDATING the working
> tree itself.
>
> And the entire point of the "hook" is that its update does not have
> to be just "checkout the given commit's tree", for which using the
> default push-to-deply is sufficient.  It is for those who want to do
> more.



-- 
Adam "Sinus" Skawiński

  reply	other threads:[~2023-07-18 22:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 20:26 receive.denyCurrentBranch=updateInstead won't update the repo Adam "Sinus" Skawiński
2023-07-17 20:52 ` Junio C Hamano
2023-07-17 21:09 ` Junio C Hamano
     [not found]   ` <CAGE71k2bdy2aYy7speu=OOStopgjzVNOPQ_-V-63aCURLibFWw@mail.gmail.com>
2023-07-17 22:26     ` Adam "Sinus" Skawiński
2023-07-18 22:20       ` Adam "Sinus" Skawiński
2023-07-18 22:28         ` Junio C Hamano
2023-07-18 22:49           ` Adam "Sinus" Skawiński [this message]
2023-07-18 23:03             ` Junio C Hamano
2023-07-18 23:29               ` Adam "Sinus" Skawiński

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

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

  git send-email \
    --in-reply-to=CAGE71k28Gao4xuR565qsLmPH02tVAdoCZPeuCjo7r9YZXWs82Q@mail.gmail.com \
    --to=adam.skawinski@sinpi.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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 NNTP newsgroup(s).