Git development
 help / color / mirror / Atom feed
* pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP
@ 2023-10-19  9:33 Michal Suchánek
  2023-10-19 10:10 ` Konstantin Khomoutov
  2023-10-19 12:07 ` Michal Suchánek
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Suchánek @ 2023-10-19  9:33 UTC (permalink / raw)
  To: git

Hello,

after upgrade from git 2.26 to git 2.35 pygit would claim that my
repository does not exist:

:~> git ls-remote /srv/git/kernel-source.git | head -n3
41037b9c54949ab7df9d32e8bc753c059b27c66c        HEAD
7a68c4c0c640ac07b89722271f866287b9047459        refs/heads/ALP-current
4993d1b0a96a0fa7fb0e87d3b1725bc775162283        refs/heads/ALP-current-RT
:~> python3
Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygit2
>>> pygit2.Repository("/srv/git/kernel-source.git")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/pygit2/repository.py", line 1498, in __init__
    path_backend = init_file_backend(path, flags)
_pygit2.GitError: Repository not found at /srv/git/kernel-source.git
>>> 

Could a reasonable diagnostic be provided?

Thanks

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP
  2023-10-19  9:33 pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP Michal Suchánek
@ 2023-10-19 10:10 ` Konstantin Khomoutov
  2023-10-19 12:07 ` Michal Suchánek
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Khomoutov @ 2023-10-19 10:10 UTC (permalink / raw)
  To: git

On Thu, Oct 19, 2023 at 11:33:44AM +0200, Michal Suchánek wrote:

> after upgrade from git 2.26 to git 2.35 pygit would claim that my
> repository does not exist:
> 
> :~> git ls-remote /srv/git/kernel-source.git | head -n3
> 41037b9c54949ab7df9d32e8bc753c059b27c66c        HEAD
> 7a68c4c0c640ac07b89722271f866287b9047459        refs/heads/ALP-current
> 4993d1b0a96a0fa7fb0e87d3b1725bc775162283        refs/heads/ALP-current-RT
> :~> python3
> Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pygit2
> >>> pygit2.Repository("/srv/git/kernel-source.git")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib64/python3.6/site-packages/pygit2/repository.py", line 1498, in __init__
>     path_backend = init_file_backend(path, flags)
> _pygit2.GitError: Repository not found at /srv/git/kernel-source.git
> >>> 
> 
> Could a reasonable diagnostic be provided?

It's a bit hard to ask what exactly you are after.

If you meant more diagnistics from Git, then I think they are in place, but
pygit2 does not display them (that is, it reads and possibly parses them
itself).

You can possibly run your Python code while having at least GIT_TRACE=1 in the
environment (see the output of `git help git` for the various environment
variables having the word "TRACE" in their names for ways to get more copious
outputs) and see whether you'll be able to get that trace printed - Git prints
which command it calls and with which arguments; you will then be able to call
them by hand and see exactly how they fail.

If you ask about better diagnistics in pygit2, then this question is
misdirected, I'm afraid, as pygit2 is not being developed using this mailing
list - ask in Discussions or issues tracker at [1] instead.

 1. https://github.com/libgit2/pygit2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP
  2023-10-19  9:33 pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP Michal Suchánek
  2023-10-19 10:10 ` Konstantin Khomoutov
@ 2023-10-19 12:07 ` Michal Suchánek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Suchánek @ 2023-10-19 12:07 UTC (permalink / raw)
  To: git

On Thu, Oct 19, 2023 at 11:33:44AM +0200, Michal Suchánek wrote:
> Hello,
> 
> after upgrade from git 2.26 to git 2.35 pygit would claim that my
> repository does not exist:
> 
> :~> git ls-remote /srv/git/kernel-source.git | head -n3
> 41037b9c54949ab7df9d32e8bc753c059b27c66c        HEAD
> 7a68c4c0c640ac07b89722271f866287b9047459        refs/heads/ALP-current
> 4993d1b0a96a0fa7fb0e87d3b1725bc775162283        refs/heads/ALP-current-RT
> :~> python3
> Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pygit2
> >>> pygit2.Repository("/srv/git/kernel-source.git")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib64/python3.6/site-packages/pygit2/repository.py", line 1498, in __init__
>     path_backend = init_file_backend(path, flags)
> _pygit2.GitError: Repository not found at /srv/git/kernel-source.git
> >>> 
> 
> Could a reasonable diagnostic be provided?

It turns out that I have relatively recent python3-pygit2 but it's
linked against ancient libgit2 causing this error.

Rebuilding python3-pygit2 fixes the problem.

Sorry about the noise.

Thanks

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-19 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-19  9:33 pygit2 claims repository does not exist on GIT_DIR_INVALID_OWNERSHIP Michal Suchánek
2023-10-19 10:10 ` Konstantin Khomoutov
2023-10-19 12:07 ` Michal Suchánek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox