git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Adam \"Sinus\" Skawiński" <adam.skawinski@sinpi.net>
To: git@vger.kernel.org
Subject: Re: receive.denyCurrentBranch=updateInstead won't update the repo
Date: Wed, 19 Jul 2023 00:20:04 +0200	[thread overview]
Message-ID: <CAGE71k3tMOtyFVrmGW33RuQ3GufJg8X6ORKCwHQgg6RmXbRCQA@mail.gmail.com> (raw)
In-Reply-To: <CAGE71k3c+CGT=42cfkh+2Z-BcvefojNwpzWfc_XHPkBK8psJfA@mail.gmail.com>

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?

I have now re-tested and, indeed, once I got _rid_ of the hook
entirely, deployment proceeded!
So, shouldn't that be a check for retval instead, perhaps..?

On Tue, 18 Jul 2023 at 00:26, Adam "Sinus" Skawiński
<adam.skawinski@sinpi.net> wrote:
>
> (I seem to have responded privately to the helpful Junio C Hamano,
> instead of to the list, sorry about that.)
>
> Well, there's progress. Indeed I must have borked something with the
> hook, as I can now confirm that the hook works and fails as intended.
>
> Still, local-to-server pushes fail to checkout on the server, without
> any indication as to why. The server clearly recognizes the
> updateInstead option, as it runs the push-to-checkout hook, but then
> it silently fails to update the remote worktree.
>
> Any idea what could be causing this?
>
> Pushing to ssh://*hostname*/home/uuuusername/domains/mywebsite.com
> Enumerating objects: 5, done.
> Counting objects: 100% (5/5), done.
> Delta compression using up to 8 threads
> Compressing objects: 100% (3/3), done.
> Writing objects: 100% (3/3), 284 bytes | 284.00 KiB/s, done.
> Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
> remote: HOOK UPDATE: 1=refs/heads/mywebsite
> 2=650585f1c2abdbbd68de71acfb31b5d66ee1d0f3
> 3=adc4a555cfc23e037ad026a405a13e7a468188c4 GITDIR=
> HOOK PUSH-TO-CHECKOUT 1=adc4a555cfc23e037ad026a405a13e7a468188c4 2= 3= GITDIR=
> To ssh://*hostname*/home/uuuusername/domains/mywebsite.com
> 650585f..adc4a55  mywebsite -> mywebsite
> updating local tracking ref 'refs/remotes/myserver-mywebsite/mywebsite'
>
> --
> Adam "Sinus" Skawiński



-- 
Adam "Sinus" Skawiński

  reply	other threads:[~2023-07-18 22:20 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 [this message]
2023-07-18 22:28         ` Junio C Hamano
2023-07-18 22:49           ` Adam "Sinus" Skawiński
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=CAGE71k3tMOtyFVrmGW33RuQ3GufJg8X6ORKCwHQgg6RmXbRCQA@mail.gmail.com \
    --to=adam.skawinski@sinpi.net \
    --cc=git@vger.kernel.org \
    /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).