libgit2 / libgit2/pygit2

AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'

Open
#1,219 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

I've installed using pip install pygit2==1.12.1. The environment is a python:3.10 docker container.

I'm receiving:

Traceback (most recent call last):
  ...
  File "...", line 197, in pull_repo
    remote.save()
  File "/app/env/lib/python3.10/site-packages/pygit2/remote.py", line 117, in save
    err = C.git_remote_save(self._remote)
AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'. Did you mean: 'git_remote_name'?

The relevant code associated with this error is as follows:

repo = pygit2.Repository(checkout_location)
remote = repo.remotes['origin']
remote.fetch(callbacks=callbacks)
remote.save()

I attempted to use the Remote.save method because the call to Remote.fetch didn't appear to do anything to the repository, which is known to have changed.

Note, I could be using this all wrong, but I would still think an AttributeError shouldn't be raised. Also, there isn't a good example or clear way to do the equivalent of a git pull, which is why I'm fiddling with fetching the remote in order to advance the index.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the traceback in the python:3.10 container with pygit2==1.12.1, then inspect pygit2/remote.py around Remote.save and the bundled libgit2 bindings. Check how Remote.fetch is expected to update repository state and whether the documented workflow avoids this missing symbol; done means the reported operation no longer raises AttributeError and its behavior is covered or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.