Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding support for git remote set-url/get-url API to Remote#446

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

guyzmo
Copy link
Contributor

Both commands enable handling of a little known feature
of git, which is to support multiple URL for one remote.
You can add multiple url using theset_url subcommand of
git remote. Though listing them is also handy, so there's
a nice method to do it, using the configuration.

@guyzmo
Copy link
ContributorAuthor

might need to write some tests for those?

@guyzmoguyzmoforce-pushed theupdating_remote_url_handling branch from546dfeb toba01785CompareMay 26, 2016 19:12
@Byron
Copy link
Member

Oh yes please ! It should be relatively straightforward to deduce how to write tests for this by looking at the existing ones. Usually there are helper functions to setup even more complex fixtures.

@Byron
Copy link
Member

Byron commentedMay 27, 2016
edited
Loading

Before I forget, could you also look at how existing methods are documented and match the documentation style ? This would include documenting all parameters, for example.

@guyzmo
Copy link
ContributorAuthor

I might, but sadly I'm now in the train, going away for four days, during which I'm on a crappy tablet on which I cannot work. Though, I very much would like to see this new methods included in the next patchset so I can remove the monkey patching from my own codebase as well :-)

cfhttps://github.com/guyzmo/git-repo/blob/master/git_repo/services/service.py#L25-43

Both commands enable handling of a little known featureof git, which is to support multiple URL for one remote.You can add multiple url using the `set_url` subcommand of`git remote`. As listing them is also handy, there's anice method to do it, using `get_url`.* adding set_url method that maps to the git remote set-url command¶ * can be used to set an URL, or replace an URL with optional positional arg¶ * can be used to add, delete URL with kwargs (matching set-url options)¶* adding add_url, delete_url methods that wraps around set_url for conveniency¶* adding urls property that yields an iterator over the setup urls for a remote¶* adding a test suite that checks all use case scenarii of this added API.¶Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
@guyzmoguyzmoforce-pushed theupdating_remote_url_handling branch fromba01785 tob366d3fCompareJune 8, 2016 17:35
@guyzmoguyzmo changed the titleAdding set_url and list_urls methods to RemoteAdding support for git remote set-url/get-url API to RemoteJun 8, 2016
@guyzmo
Copy link
ContributorAuthor

So, I've squashed my commit with a new one, featuring a few changes:

  • Theset_url method is a direct wrapper forgit remote set-url ;
  • theurls property is providing an iterator over the remote's URLs (I followed how you namedrefs)

Then I've added a couple of convenience methods, to avoid adding awkward arguments to controlset_url:

  • theadd_url method is there so you can add an URL to a remote
  • anddelete_url method is to delete one.

Finally, I've added a test covering all the new code, with a couple of edge cases, and wrote pydoc for those functions. I hope it's how you like it, mates!

…t remote get-url``get-url` is a new API that is not widely available yet (introduced in git 2.7.0), andprovokes failure on travis.Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
@guyzmoguyzmoforce-pushed theupdating_remote_url_handling branch fromc780aff to3f4b410CompareJune 8, 2016 17:48
@guyzmo
Copy link
ContributorAuthor

I rolled back theurls property, because that was failing on Travis, which isn't using latest git.

Thegit remote get-url API has been introduced ingit 2.7.0, and wasn't availablebefore.

@guyzmo
Copy link
ContributorAuthor

can you ping me when you think you'll be able to merge, and publish on pypi¸ and what version that will be? So I can update my setup.py accordingly ☺

@ByronByron merged commit9bebaca intogitpython-developers:masterJun 14, 2016
Byron added a commit that referenced this pull requestJun 14, 2016
@Byron
Copy link
Member

If@nvie doesn't beat me to it, I will get the new release on the way on my next maintenance slot. Maybe tomorrow ... .

guyzmo reacted with thumbs up emojiguyzmo reacted with hooray emojiguyzmo reacted with heart emoji

@guyzmo
Copy link
ContributorAuthor

thank you ;-)

preparing my own code to be ready to point to the right version! :-)

@nvie
Copy link
Contributor

I'll add 2 more bug fixes tonight to this release. After I'm done with those, I'll roll a new release :)

guyzmo reacted with thumbs up emojiguyzmo reacted with laugh emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@ByronByron

Development

Successfully merging this pull request may close these issues.

3 participants
@guyzmo@Byron@nvie

[8]ページ先頭

©2009-2025 Movatter.jp