Learn more about these different git repos.
Other Git URLs
Releng issue: https://pagure.io/releng/issue/11968
Several users have encountered an error message when pushing private branches to their forks of various repositories, including google-noto-sans-cjk-fonts. The issue appears to be related to a pre-push script in Pagure that fails to handle private branches correctly.
Clone a repository using fedpkg clone <repo-name>. Fork the repository using fedpkg fork. Create a new branch and switch to it: git branch <new-branch> and git checkout <new-branch>. Add commits to the new branch. Push the branch to the fork: git push <remote> <new-branch>.
The push operation completes, but an error message is logged from the remote. The error seems to originate from the pre-push script which cannot handle private branches. Here is an example log snippet:
The pre-push script can't check private branches. Push operation continues. Enumerating objects: 17, done. Counting objects: 100% (17/17), done. Delta compression using up to 8 threads Compressing objects: 100% (11/11), done. Writing objects: 100% (16/16), 6.64 KiB | 6.64 MiB/s, done. Total 16 (delta 1), reused 15 (delta 0), pack-reused 0 remote: - to fedora-message remote: 2024-02-19 05:48:24,637 [WARNING] pagure.lib.notify: pagure is about to send a message that has no schemas: pagure.git.branch.creation remote: Sending to redis to log activity and send commit notification emails remote: ERROR: ['git', 'diff', '--name-status', '-z', '^0000000000000000000000000000000000000000', '6a72681f0228f0dae29d649a5a9e04f62e0cff7f'] =-- 128 remote: remote: fatal: bad object 0000000000000000000000000000000000000000 remote: remote: * Publishing information for 1 commits remote: - to fedora-message remote: 2024-02-19 05:48:24,819 [WARNING] pagure.lib.notify: pagure is about to send a message that has no schemas: pagure.git.receive remote: remote: Create a pull-request for <new-branch> remote: https://src.fedoraproject.org/fork/<user>/rpms/<repo-name>/diff/rawhide..<new-branch>
The error seems to be caused by an issue in Pagure's handling of private branches in the pre-push script. Specifically, the error occurs when the script tries to process a commit with an old revision hash of all zeros (0000000000000000000000000000000000000000). The problematic code can be found in Pagure's git.py file, where the old revision is incorrectly replaced:
elif set(oldrev) == set(["0"]): oldrev = "^%s" % oldrev
This should likely be (Check Aurelien's comment from the releng issue)
oldrev = "^%s" % newrev
Please investigate and fix the handling of private branches in the pre-push script to prevent these errors from occurring. This issue (I take it as a warning that is not blocking but it still affects multiple users and repositories, making it a significant concern for those using private branches in their workflows.)
Metadata Update from @wombelix: - Issue assigned to wombelix
Metadata Update from @wombelix: - Issue set to the milestone: 5.14
Metadata Update from @wombelix: - Assignee reset
Fixed by https://pagure.io/pagure/pull-request/5459 which was backported (https://src.fedoraproject.org/rpms/pagure/blob/rawhide/f/fix_pagure_lib_git_get_changed_files.patch) to pagure-5.13.3-13.fc41 and will be part of the upcoming release 5.14.1.
pagure-5.13.3-13.fc41
5.14.1
Metadata Update from @wombelix: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.