{"thread":{"id":"60400","subject":"pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP","startedAt":"2023-10-19T09:33:49Z","lastAt":"2023-10-19T12:07:58Z","messageCount":3,"participants":["Michal Suchánek","Konstantin Khomoutov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483476","messageId":"20231019093344.GS6241@kitsune.suse.cz","threadId":"60400","inReplyTo":null,"subject":"pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2023-10-19T09:33:44Z","receivedAt":"2023-10-19T09:33:49Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"Hello,\n\nafter upgrade from git 2.26 to git 2.35 pygit would claim that my\nrepository does not exist:\n\n:~> git ls-remote /srv/git/kernel-source.git | head -n3\n41037b9c54949ab7df9d32e8bc753c059b27c66c        HEAD\n7a68c4c0c640ac07b89722271f866287b9047459        refs/heads/ALP-current\n4993d1b0a96a0fa7fb0e87d3b1725bc775162283        refs/heads/ALP-current-RT\n:~> python3\nPython 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import pygit2\n>>> pygit2.Repository(\"/srv/git/kernel-source.git\")\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\n  File \"/usr/lib64/python3.6/site-packages/pygit2/repository.py\", line 1498, in __init__\n    path_backend = init_file_backend(path, flags)\n_pygit2.GitError: Repository not found at /srv/git/kernel-source.git\n>>> \n\nCould a reasonable diagnostic be provided?\n\nThanks\n\nMichal\n"},{"id":"483478","messageId":"20231019101058.oxu7o2jxq346zxha@carbon","threadId":"60400","inReplyTo":"20231019093344.GS6241@kitsune.suse.cz","subject":"Re: pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP","fromName":"Konstantin Khomoutov","fromEmail":"kostix@bswap.ru","sentAt":"2023-10-19T10:10:58Z","receivedAt":"2023-10-19T11:01:32Z","isPatch":false,"sender":{"key":"kostix@bswap.ru","avatar":null},"body":"On Thu, Oct 19, 2023 at 11:33:44AM +0200, Michal Suchánek wrote:\n\n> after upgrade from git 2.26 to git 2.35 pygit would claim that my\n> repository does not exist:\n> \n> :~> git ls-remote /srv/git/kernel-source.git | head -n3\n> 41037b9c54949ab7df9d32e8bc753c059b27c66c        HEAD\n> 7a68c4c0c640ac07b89722271f866287b9047459        refs/heads/ALP-current\n> 4993d1b0a96a0fa7fb0e87d3b1725bc775162283        refs/heads/ALP-current-RT\n> :~> python3\n> Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux\n> Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n> >>> import pygit2\n> >>> pygit2.Repository(\"/srv/git/kernel-source.git\")\n> Traceback (most recent call last):\n>   File \"<stdin>\", line 1, in <module>\n>   File \"/usr/lib64/python3.6/site-packages/pygit2/repository.py\", line 1498, in __init__\n>     path_backend = init_file_backend(path, flags)\n> _pygit2.GitError: Repository not found at /srv/git/kernel-source.git\n> >>> \n> \n> Could a reasonable diagnostic be provided?\n\nIt's a bit hard to ask what exactly you are after.\n\nIf you meant more diagnistics from Git, then I think they are in place, but\npygit2 does not display them (that is, it reads and possibly parses them\nitself).\n\nYou can possibly run your Python code while having at least GIT_TRACE=1 in the\nenvironment (see the output of `git help git` for the various environment\nvariables having the word \"TRACE\" in their names for ways to get more copious\noutputs) and see whether you'll be able to get that trace printed - Git prints\nwhich command it calls and with which arguments; you will then be able to call\nthem by hand and see exactly how they fail.\n\nIf you ask about better diagnistics in pygit2, then this question is\nmisdirected, I'm afraid, as pygit2 is not being developed using this mailing\nlist - ask in Discussions or issues tracker at [1] instead.\n\n 1. https://github.com/libgit2/pygit2\n\n"},{"id":"483479","messageId":"20231019120728.GV6241@kitsune.suse.cz","threadId":"60400","inReplyTo":"20231019093344.GS6241@kitsune.suse.cz","subject":"Re: pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2023-10-19T12:07:28Z","receivedAt":"2023-10-19T12:07:58Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Thu, Oct 19, 2023 at 11:33:44AM +0200, Michal Suchánek wrote:\n> Hello,\n> \n> after upgrade from git 2.26 to git 2.35 pygit would claim that my\n> repository does not exist:\n> \n> :~> git ls-remote /srv/git/kernel-source.git | head -n3\n> 41037b9c54949ab7df9d32e8bc753c059b27c66c        HEAD\n> 7a68c4c0c640ac07b89722271f866287b9047459        refs/heads/ALP-current\n> 4993d1b0a96a0fa7fb0e87d3b1725bc775162283        refs/heads/ALP-current-RT\n> :~> python3\n> Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux\n> Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n> >>> import pygit2\n> >>> pygit2.Repository(\"/srv/git/kernel-source.git\")\n> Traceback (most recent call last):\n>   File \"<stdin>\", line 1, in <module>\n>   File \"/usr/lib64/python3.6/site-packages/pygit2/repository.py\", line 1498, in __init__\n>     path_backend = init_file_backend(path, flags)\n> _pygit2.GitError: Repository not found at /srv/git/kernel-source.git\n> >>> \n> \n> Could a reasonable diagnostic be provided?\n\nIt turns out that I have relatively recent python3-pygit2 but it's\nlinked against ancient libgit2 causing this error.\n\nRebuilding python3-pygit2 fixes the problem.\n\nSorry about the noise.\n\nThanks\n\nMichal\n"}]}