Skip to content

Add support for remote refspecs #255

Closed
@jdavid

Description

There is a regression in the master branch regarding the 0.18.1 release. After the changes in libgit2 0.19 we have lost the Remote.fetchspec setter. To get back the ability to modify remote's refspecs, and to do so properly, we need to:

  • Implement a Refspec type, in a new file src/refspec.c
  • Wrap more libgit2 functions in the Remote type

Volunteers?

Activity

xtao

xtao commented on Jul 4, 2013

@xtao
Contributor

Hi, @jdavid I will do this.
Can you show more details?

jdavid

jdavid commented on Jul 4, 2013

@jdavid
MemberAuthor

Hi @xtao and thank you for volunteering!

This is the API to implement.

Constants:

GIT_DIRECTION_FETCH
GIT_DIRECTION_PUSH

Refspec type, src/refspec.c:

Refspec.direction => GIT_DIRECTION_FETCH / GIT_DIRECTION_PUSH
Refspec.dst => <str>
Refspec.dst_matches(refname:<str>) => True / False
Refspec.force => True/False
Refspec.src => <str>
Refspec.src_matches(refname:<str>) => True/False
Refspec.string => <str>

Remote type, remote.c:

Remote.add_fetch(refspec:<str>) => None
Remote.add_push(refspec:<str>) => None
Remote.clear_refspecs() => None
Remote.get_fetch_refspecs() => [<str>, ...]
Remote.get_push_refspecs() => [<str>, ...]
Remote.get_refspec(n:<int>) => <Refspec>
Remote.remove_refspec(n:<int>) => None

Note that:

Do you have questions?

carlosmn

carlosmn commented on Jan 19, 2014

@carlosmn
Member

With libgit2 v0.20, we have the ability to set the fetch and push refspecs again. Removing the nth refspec isn't something we want to do anyway, so the only parts missing should be add_fetch, and add_push.

xtao

xtao commented on Jan 20, 2014

@xtao
Contributor

Fixed #318

carlosmn

carlosmn commented on Jan 23, 2014

@carlosmn
Member

With the PRs that got merged recently, this can be closed, no?

jdavid

jdavid commented on Jan 24, 2014

@jdavid
MemberAuthor

yes, thanks!

IfeanyiEkperi

IfeanyiEkperi commented on Jan 24, 2014

@IfeanyiEkperi

Fixed #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Add support for remote refspecs · Issue #255 · libgit2/pygit2