Skip to content
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

remotes: support anonymous remotes #1229

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

pmrowla
Copy link
Contributor

@pmrowla pmrowla commented Jul 25, 2023

Adds support for git_remote_create_anonymous for creating anonymous (in-memory) remotes when you have a URL but do not want to create a named remote and the associated config entries

Comment on lines +347 to +350
def create_anonymous(self, url):
"""Create a new anonymous (in-memory only) remote with the given URL.
Returns a <Remote> object.
"""
Copy link
Contributor Author

@pmrowla pmrowla Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done in the existing create() by checking something like

if not name:
    C.git_remote_create_anonymous()

but I wasn't sure if that would be explicit enough since create(None, url) could also imply that the user intended to make a libgit2 detached remote instead of an anonymous one. (Or we could also do it with create(None, url, anonymous=True))

Adding the separate method seemed like the cleanest solution to me, but I don't have a problem with changing it to one of the alternatives if you'd prefer.

@jdavid jdavid merged commit 2accdf9 into libgit2:master Jul 25, 2023
4 of 6 checks passed
@pmrowla pmrowla deleted the remote-anonymous branch July 25, 2023 11:45
netbsd-srcmastr referenced this pull request in NetBSD/pkgsrc Nov 5, 2023
1.13.2 (2023-10-30)
-------------------------

- Support Python 3.12

- Documentation updates
  `#1242 <https://github.com/libgit2/pygit2/pull/1242>`_


1.13.1 (2023-09-24)
-------------------------

- Fix crash in reference rename
  `#1233 <https://github.com/libgit2/pygit2/issues/1233>`_


1.13.0 (2023-09-07)
-------------------------

- Upgrade to libgit2 v1.7.1

- Don't distribute wheels for pypy, only universal wheels for macOS

- New ``Repository.remotes.create_anonymous(url)``
  `#1229 <https://github.com/libgit2/pygit2/pull/1229>`_

- docs: update links to pypi, pygit2.org
  `#1228 <https://github.com/libgit2/pygit2/pull/1228>`_

- Prep work for Python 3.12 (not yet supported)
  `#1223 <https://github.com/libgit2/pygit2/pull/1223>`_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants