Re: [PATCH v2] receive-pack: purge temporary data if no command is ready to run
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- Feb 7, 2022, 03:36 UTC
- Message-ID
- <CANYiYbHbFmjbMOCKc=UTDEwcL1bpGRrKRafFCUuYxvuHYVkhTg@mail.gmail.com>
- In-Reply-To
- <CADuS7AoAbtbC3RKrXR=SGvfs7C-n57Y9zkaGne_XrfyJh46zXg@mail.gmail.com>
On Sat, Feb 5, 2022 at 4:15 PM Bojun Chen <bojun.cbj@gmail.com> wrote:
Show 27 quoted lines
>
> Junio C Hamano <gitster@pobox.com> 于2022年2月2日周三 06:51写道:
> >
> > Chen BoJun <bojun.cbj@gmail.com> writes:
> >
> > > From: Chen Bojun <bojun.cbj@alibaba-inc.com>
> > >
> > > When pushing a hidden ref, e.g.:
> > >
> > > $ git push origin HEAD:refs/hidden/foo
> > >
> > > "receive-pack" will reject our request with an error message like this:
> > >
> > > ! [remote rejected] HEAD -> refs/hidden/foo (deny updating a hidden ref)
> > >
> > > The remote side ("git-receive-pack") will not create the hidden ref as
> > > expected, but the pack file sent by "git-send-pack" is left inside the
> > > remote repository. I.e. the quarantine directory is not purged as it
> > > should be.
> >
> > I was puzzled by the reference to "pushing a hidden ref" at the
> > beginning of the proposed log message, as it wasn't quite clear that
> > it was merely an easy-to-reproduce recipe to fall into such a
> > situation where all ref updates are rejected.
> >
>
> Thanks for the suggestion. Do I have to rewrite this commit message on the v3?You can start your commit message like this:
receive-pack: purge temporary data if no command is ready to run
When pushing to "receive-pack", commands may have already been
marked with error_string or skip_update before being fed to the
"pre-receive" hook. E.g.: * inconsistent push options for signed push.
* not permited shallow updates.
* encounter connectivity issues.
* push to hidden references.Take pushing to hidden references as an example.
In order to reduce the size of reference advertisement for git-push
from a client which does not support protocol v2 and push negotiation,
the administrator may set certain config variables to hide some
references like:$ git config --system --add receive.hideRefs refs/merge-requests
Then, if a user made a push like this:
$ git push origin HEAD:refs/merge-requests/123/head
...
-- Jiang Xin