Gitpython: NameError: name 'self' is not defined in GitPython Tutorial

Created on 23 Feb 2019  路  5Comments  路  Source: gitpython-developers/GitPython

Most helpful comment

repo = Repo('.') # for current dir

All 5 comments

Next line in the doc reads:
In the above example, the directory self.rorepo.working_tree_dir equals /Users/mtrier/Development/git-python

I vote that we close the issue, seeing this is not an issue. However, I do think that example is awful, and easily has the potential to confuse new users and less-experienced developers. So perhaps a new issue should be opened to discuss revising the tutorial.

I agree that this example can confuse new users, and this issue is a proof for that. Currently using self.rorepo is a technical requirement, as the documentation is run to assure it functions as advertised.
As @CptMikhailov suggests, an issue to drive revising the tutorial would be the way to go forward.

The comment by @CptMikhailov is fantastically constructive and drives this conversation forward, and it would be even more effective without the mention of the word awful.

repo = Repo('.') # for current dir

before using GitPython make sure you have a repository on path
if you haven't a repository use this command git init

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnlinp picture johnlinp  路  6Comments

theckman picture theckman  路  6Comments

niso120b picture niso120b  路  4Comments

theyonibomber picture theyonibomber  路  5Comments

jon-armstrong picture jon-armstrong  路  7Comments