-
-
Notifications
You must be signed in to change notification settings - Fork 894
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
Revise comments, docstrings, some messages, and a bit of code #1725
Commits on Oct 22, 2023
-
Fix docstrings that intend '\' literally
This intended '\' literally, but it was actually '' because the \' became just ' (backslash-apostrophe becomes just aspostrophe).
Configuration menu - View commit details
-
Copy full SHA for 7dd2095 - Browse repository at this point
Copy the full SHA 7dd2095View commit details -
Put all regex patterns in r-strings
This improves consistency, because most were already. For a few it allows backslashes to removed, improving readability. Even for the others, some editors will highlight them as regular expressions now that they are raw string literals.
Configuration menu - View commit details
-
Copy full SHA for ffcbf07 - Browse repository at this point
Copy the full SHA ffcbf07View commit details -
Remove r prefix from strings that need not be raw
These are a couple strings that, in addition to not having any escape sequences, don't represent regular expressions, Windows paths, or anything else that would be clarified by raw literals.
Configuration menu - View commit details
-
Copy full SHA for 2c94b6a - Browse repository at this point
Copy the full SHA 2c94b6aView commit details -
Fix _index_from_*_format docstrings (proc reading)
In the git.diff.Diff class, the _index_from_patch_format and _index_from_raw_format methods' docstrings had still described them as reading from streams, even though they have instead read from processes (and taken "proc", not "stream", arguments) since gitpython-developers#519 when the change was made in a5db3d3 to fix a freezing bug. This updates the docstrings to reflect that they read from processes.
Configuration menu - View commit details
-
Copy full SHA for 35fd65b - Browse repository at this point
Copy the full SHA 35fd65bView commit details -
Fix case in IndexObject.abspath exception message
The message refers to the (public) working_tree_dir attribute by name, so that should be uncapitalized to reflect the case by which it must be accessed, even when it appears at the beginning of a sentence.
Configuration menu - View commit details
-
Copy full SHA for 5af7446 - Browse repository at this point
Copy the full SHA 5af7446View commit details -
Remove Commit._deserialize doc for param_from_rev_list
The git.objects.commit.Commit._deserialize method stopped accepting a param_from_rev_list argument in ae5a69f, but the documentation for that parameter was never removed. Because that was the only part of the method's docstring, and it is a nonpublic method, and the associated _serialize method does not have a docstring, this change simply removes the _deserialize method's docstring without adding anything.
Configuration menu - View commit details
-
Copy full SHA for 692e59e - Browse repository at this point
Copy the full SHA 692e59eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab46192 - Browse repository at this point
Copy the full SHA ab46192View commit details -
Remove obsolete comment in Submodule.module
The local (i.e. late) import was removed in 7b3ef45, but the comment about it on (what was) the preceding line has persisted until now.
Configuration menu - View commit details
-
Copy full SHA for 1114828 - Browse repository at this point
Copy the full SHA 1114828View commit details -
Clarify "master repository" in RootModule docs
This changes master repository to superproject (master repository) in the RootModule class docstring and in the tutorial, to make even clearer what this is referring to. This way, users who are less familiar with submodules will be less likely to confuse this with a "master" branch (since "master" is one of the popular default branch names), while users who are more familiar with submodules and may search for the official term "superproject" will find the docs when doing so. This retains "master repository" parenthesized rather than completely replacing it because although "superproject" is the official term for this, it is a bit obscure and unintuitive.
Configuration menu - View commit details
-
Copy full SHA for f95d4fd - Browse repository at this point
Copy the full SHA f95d4fdView commit details -
Change spelling from "commit'ish" to "commit-ish"
Since the hyphen spelling is what the official Git docs use. This change affects only docstrings.
Configuration menu - View commit details
-
Copy full SHA for 9fea488 - Browse repository at this point
Copy the full SHA 9fea488View commit details -
Update git-source citation in Reference.set_object
Reference.set_object explains its handling of oldbinsha by quoting a comment from refs.c in the Git source code. However, that comment now appears in refs/files-backend.c in that codebase. This updates the reference so readers can look it up and find the comment in its surrounding context. The commit to the git project's source code that moved the code that includes that comment is: git/git@7bd9bcf
Configuration menu - View commit details
-
Copy full SHA for 4536b63 - Browse repository at this point
Copy the full SHA 4536b63View commit details -
Fix message in SymbolicReference.from_path
This rarely-seen ValueError message had said SymbolicRef, and is now changed to SymbolicReference.
Configuration menu - View commit details
-
Copy full SHA for 59d208c - Browse repository at this point
Copy the full SHA 59d208cView commit details -
Since the value of __class__ is a type, comparing it to another type object should use "is" rather than "==". Some of these, involving type(), were fixed in bf7af69, but flake8 did not catch the .__class__ variation addressed here.
Configuration menu - View commit details
-
Copy full SHA for add46d9 - Browse repository at this point
Copy the full SHA add46d9View commit details -
Revise docstrings and comments for clarity and formatting
In the git module (including the modules it contains). This also makes one small change in doc/ to synchronize with a change made in a docstring.
Configuration menu - View commit details
-
Copy full SHA for cd16a35 - Browse repository at this point
Copy the full SHA cd16a35View commit details -
Firm up comment about is_win in util.is_cygwin_git
The is_cygwin_git function returns False when we have is_win, because is_win is not True on Cygwin systems. The existing comment explained why, but was tentative. The claims are accurate, so this rewrites the comment to state it more definitively.
Configuration menu - View commit details
-
Copy full SHA for e8343e2 - Browse repository at this point
Copy the full SHA e8343e2View commit details -
Remove explicit inheritance from object
Within the git module. In Python 2, it was necessary to inherit from object to have a new-style class. In Python 3, all classes are new-style classes, and inheritance from object is implied. Usually, removing explicit inheritance from object is only a small clarity benefit while modernizing Python codebases. However, in GitPython, the benefit is greater, because it is possible to confuse object (the root of the Python class hierarchy) with Object (the root of the GitPython subhierarchy of classes representing things in the git object model).
Configuration menu - View commit details
-
Copy full SHA for f78587f - Browse repository at this point
Copy the full SHA f78587fView commit details -
Make all one-element __slots__ be tuples
Most already were, but a few were strings.
Configuration menu - View commit details
-
Copy full SHA for 0327f8f - Browse repository at this point
Copy the full SHA 0327f8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d4a87c1 - Browse repository at this point
Copy the full SHA d4a87c1View commit details
Commits on Oct 23, 2023
-
Revise docstrings/comments in most other test modules
Intentionally untouched test modules in this commit: - Modules where there are no such changes to be made. - Modules in test/performance/ -- will be done separately. - test/lib/ modules (these are test *helpers* and will be done separately). - test/test_util.py, because although it has a few comments that might be improved, it may make more sense to do that together with some further refactoring changes.
Configuration menu - View commit details
-
Copy full SHA for 11fce8a - Browse repository at this point
Copy the full SHA 11fce8aView commit details -
Add a module docstring to tstrunner.py
It benefits from a docstring because it is not referenced in code or documentation, and its purpose is/was otherwise unclear. The docstring includes a reference to gitpython-developers#1188 for more information.
Configuration menu - View commit details
-
Copy full SHA for cf9243a - Browse repository at this point
Copy the full SHA cf9243aView commit details -
Slightly improve readability of installation-test strings
This modifies content of the strings themselves, but only slightly. - Make an exception message more readable. - Improve spacing of the "python -c" script string in the sys.path test.
Configuration menu - View commit details
-
Copy full SHA for b5c3ca4 - Browse repository at this point
Copy the full SHA b5c3ca4View commit details -
More wording improvements (in git module)
This futher improves some wording in docstrings and comments in a handful of places within the git module.
Configuration menu - View commit details
-
Copy full SHA for f444470 - Browse repository at this point
Copy the full SHA f444470View commit details
Commits on Oct 24, 2023
-
:return: was used extensively, while :returns: only appeared in two docstrings.
Configuration menu - View commit details
-
Copy full SHA for db317f1 - Browse repository at this point
Copy the full SHA db317f1View commit details -
Fix TestBigRepoR.setUp info message
Changes that fix the message itself: - Add a missing space between words (two parts were concatenated, with no space at the edge of either). - Capitalize "GitPython" since that is the repo and project name. Changes that improve how the message is produced: - Make the entire literal part of the string the format string, instead of formatting the first part and concatenating the second part. - Pass the format string and k_env_git_repo variable as separate arguments to logging.info, so the logging machinery takes care of substituting it for %s, rather than doing the substitution.
Configuration menu - View commit details
-
Copy full SHA for 720e4bb - Browse repository at this point
Copy the full SHA 720e4bbView commit details -
Remove outdated git_daemon_launched Windows info
This removes the Windows-specific information in the warning message in git_daemon_launched. After the associated functionality was updated in gitpython-developers#1684 and the warning message was abridged accordingly, the functionality was updated again in gitpython-developers#1697, causing the message to be outdated and no longer helpeful (since having git-daemon.exe in a PATH directory is no longer necessary or useful), without any corresponding change to the message.
Configuration menu - View commit details
-
Copy full SHA for faa19ac - Browse repository at this point
Copy the full SHA faa19acView commit details -
Configuration menu - View commit details
-
Copy full SHA for bffc537 - Browse repository at this point
Copy the full SHA bffc537View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30f49d9 - Browse repository at this point
Copy the full SHA 30f49d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d3efc5 - Browse repository at this point
Copy the full SHA 8d3efc5View commit details -
Improve consistency of "END" comments
In the git module (including modules it contains). This does not add any new "# end" or "# END" comments. Instead, it improves the consistency and clarity of existing ones by converting each "# end" comment to "# END" (since capitalization was not used systematically to indicate nesting level or other semantic information, and capitalizing "END" makes clear the nature of the comment), and by adding some information to a few of the comments. This also removes end comments that did not provide information or significant visual indication that a "section" was ending, or where the visual indication they provided was at least as well provided by replacing them with a blank line. However, it does *not* attempt to apply this change everywhere it might be applicable.
Configuration menu - View commit details
-
Copy full SHA for a5fc1d8 - Browse repository at this point
Copy the full SHA a5fc1d8View commit details
Commits on Oct 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for c2eb6b5 - Browse repository at this point
Copy the full SHA c2eb6b5View commit details -
Improve consistency of "END" comments in test suite
As in the recent roughly corresponding change inside git/, this does not add new END comments (and actually removes some), but instead focuses on making the existing ones more consistent in style, mainly adjusting capitalization (turning "end" to "END").
Configuration menu - View commit details
-
Copy full SHA for ddb4417 - Browse repository at this point
Copy the full SHA ddb4417View commit details -
Avoid making "END" notation more verbose
This changes the style "END" comments appearing after local function definitions from "END def X" to "END X". Note that this still does not add such comments where they were not present, it only adjusts their style where they already existed.
Configuration menu - View commit details
-
Copy full SHA for 1d3f275 - Browse repository at this point
Copy the full SHA 1d3f275View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81dad7e - Browse repository at this point
Copy the full SHA 81dad7eView commit details -
Shorten some docstring references with tilde notation
This uses the Sphinx ~ notation to express references like: :class:`Z <a.b.c.Z>` In the abbreviated form, which Sphinx renders the same way: :class:`~a.b.c.Z` (This commit also makes some other polishing changes to affected and nearby text.)
Configuration menu - View commit details
-
Copy full SHA for a040edb - Browse repository at this point
Copy the full SHA a040edbView commit details -
Fix commented *.py names at the top of modules
A number of them were incorrect, due to how files were renamed, and code moved between them, over time. Some were corrected earlier, and most of the rest are corrected here. Not all modules have these at all. This does not add any to modules that don't have them. It only fixes them where present but wrong.
Configuration menu - View commit details
-
Copy full SHA for af1b5d4 - Browse repository at this point
Copy the full SHA af1b5d4View commit details -
In Python 3, UTF-8 is the default encoding when no encoding declaration is present, and omitting the encoding declaration when UTF-8 is intended is officially suggested. - https://docs.python.org/3/reference/lexical_analysis.html - https://pep8.org/#source-file-encoding Furthermore, not all files in this project had them (and their presence or absence seems to have been mainly for historical reasons rather than file contents).
Configuration menu - View commit details
-
Copy full SHA for b970d42 - Browse repository at this point
Copy the full SHA b970d42View commit details