FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FIX #535: expand also GIT_DIR var on Repo-construction by ankostis · Pull Request #537 · gitpython-developers/GitPython · GitHub

Repository navigation

FIX #535: expand also GIT_DIR var on Repo-construction - #537

Merged
Byron merged 5 commits into
gitpython-developers:masterfrom
ankostis:exp_git_dir
Oct 22, 2016
Merged

Byron merged 5 commits into
gitpython-developers:masterfrom
ankostis:exp_git_dir

Conversation

Copy link
Copy Markdown
Contributor
  • Ignore "empty" GIT_DIR vars.
  • Improve documentation on the constructor path parameter.
    Minor repo-code and doc correcions.
    • Expansion of paths also osp.normalize() them.
    • Make Repo-fields --> class-fields to avoid initializations on
      construct.
    • Explain and rename git.repo.fun.find_git_dir() is for submodules
      (find_submodule_git_dir()).

+ Ignore "empty" GIT_DIR vars.
+ Improve documentation on the constructor `path` parameter.
+ Expansion of paths also `osp.normalize()` them.
+ Make Repo-fields --> class-fields to avoid initializations on
construct.
+ Explain and rename `git.repo.fun.find_git_dir()` is for submodules
(`find_submodule_git_dir()`).

codecov-io commented Oct 19, 2016 •
edited
Loading

Copy link
Copy Markdown

Current coverage is 94.36% (diff: 96.77%)

Merging #537 into master will increase coverage by 0.02%

@@             master       #537   diff @@
==========================================
  Files            63         63          
  Lines          9885       9892     +7   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           9326       9335     +9   
+ Misses          559        557     -2   
  Partials          0          0          

Powered by Codecov. Last update caa0ea7...5fac8d4

Conflicts:
	git/repo/base.py
	git/repo/fun.py
	git/test/test_submodule.py
Comment thread git/repo/base.py Outdated
repo = Repo("$REPOSITORIES/Development/git-python.git")

if `None, current-directory is used.
The :envvar:`GIT_DIR` if set and not empty takes precendance over this parameter.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The environment variable taking precedence over the specified path seems error prone and undesirable. For instance, with GIT_DIR set, you can no longer do something like this:

repo_1 = git.Repo('/path/to/repo1')
repo_2 = git.Repo('/path/to/repo2')

I think GIT_DIR as a fallback makes sense (if path is None for instance). However, is there any reason to prefer it if an explicit path is provided?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Discussion moved to original issue #535

Byron merged commit 4754fa1 into gitpython-developers:master Oct 22, 2016
Byron removed the in progress label Oct 22, 2016

Byron commented Oct 22, 2016

Copy link
Copy Markdown
Member

Thanks a lot @ankostis :) !

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL