Skip to content

Allow for setting git options, that are persistent across subcommand calls #536

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

Merged

Conversation

bpoldrack
Copy link
Contributor

@bpoldrack bpoldrack commented Oct 18, 2016

Currently _git_options in class Git are reset after each subcommand call. While this is appropriate in most cases, I'm in need to have options for the git executable, that are used with all calls to git on a certain repository and I can't provide this option for each and every call. Therefore I'd like to introduce the possibility to persistently set such options for a given instance of Git.

This is my first PR here, so I'm not exactly sure, what you want me to provide. CONTRIBUTING.md reads: "Write a test that fails unless your patch is present."
Where am I supposed to put such a test?
Just add it to git/test/test_git.py?

@codecov-io
Copy link

codecov-io commented Oct 18, 2016

Current coverage is 94.45% (diff: 100%)

Merging #536 into master will increase coverage by 0.02%

@@             master       #536   diff @@
==========================================
  Files            63         63          
  Lines          9736       9749    +13   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           9193       9208    +15   
+ Misses          543        541     -2   
  Partials          0          0          

Powered by Codecov. Last update 9e4a454...bf8ce94


# reset to empty:
self.git.set_persistent_git_options()
self.assertRaises(GitCommandError, self.git.NoOp)
Copy link
Contributor

Choose a reason for hiding this comment

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

A minor flake8 reported by travis: ./git/test/test_git.py:175:43: E241 multiple spaces after ','

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, forgot this one. Thanks.

@ankostis ankostis merged commit aab7dc2 into gitpython-developers:master Oct 19, 2016
@bpoldrack bpoldrack mentioned this pull request Oct 20, 2016
@Byron
Copy link
Member

Byron commented Oct 22, 2016

@bpoldrack Thanks a lot for your contribution ! I am doing maintenance today, and am confident to manage to put out a new release as well.

@bpoldrack bpoldrack deleted the nf-persistent-git-options branch October 26, 2016 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants