-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
receive-pack: purge temporary data if no command is ready to run #1124
base: master
Are you sure you want to change the base?
Conversation
/submit |
Submitted as pull.1124.git.1642987616372.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
|
User |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Jiang Xin wrote (reply to this):
|
User |
On the Git mailing list, Lertz Chen wrote (reply to this):
|
On the Git mailing list, Bojun Chen wrote (reply to this):
|
On the Git mailing list, Chen BoJun wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Bojun Chen wrote (reply to this):
|
On the Git mailing list, Bojun Chen wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
In certain push scenarios, the object migration is still executed when no ref updates are done for any reason. For instance, in the following push when the remote sets refs/hidden/ as receive.hideRefs: $ 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. Add a checkpoint before calling "tmp_objdir_migrate()" and after calling the "pre-receive" hook to purge that temporary data in the quarantine area when there is no command ready to run. The reason we do not add the checkpoint before the "pre-receive" hook, but after it, is that the "pre-receive" hook is called with a switch-off "skip_broken" flag, and all commands, even broken ones, should be fed by calling "feed_receive_hook()". Add a new test case in t5516 as well. Helped-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Helped-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Chen Bojun <bojun.cbj@alibaba-inc.com>
f6e5681
to
4a5f93d
Compare
On the Git mailing list, Jiang Xin wrote (reply to this):
|
On the Git mailing list, Bojun Chen wrote (reply to this):
|
On the Git mailing list, Chen BoJun wrote (reply to this):
|
On the Git mailing list, Chen BoJun wrote (reply to this):
|
When pushing a hidden ref, e.g.:
"receive-pack" will reject our request with an error message like this:
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.
Add a checkpoint before calling "tmp_objdir_migrate()" and after calling
the "pre-receive" hook to purge that temporary data in the quarantine
area when there is no command ready to run.
The reason we do not add the checkpoint before the "pre-receive" hook,
but after it, is that the "pre-receive" hook is called with a switch-off
"skip_broken" flag, and all commands, even broken ones, should be fed
by calling "feed_receive_hook()".
Add a new test case and fix some formatting issues in t5516 as well.
Helped-by: Jiang Xin zhiyou.jx@alibaba-inc.com
Helped-by: Teng Long dyroneteng@gmail.com
Signed-off-by: Chen Bojun bojun.cbj@alibaba-inc.com
Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.
Please read the "guidelines for contributing" linked above!
cc: Ævar Arnfjörð Bjarmason avarab@gmail.com
cc: Jiang Xin worldhello.net@gmail.com