summaryrefslogtreecommitdiff
path: root/git/repo
Commit message (Collapse)AuthorAgeFilesLines
* feat(blame): Support custom `rev_opts` for blameJoseph Hale2022-08-301-3/+8
| | | | | | | | | | | | | | | | The `git blame` CLI offers a repeated `-C` option that can be used to detect lines that move within/between files. While a slower operation, it yields more accurate authorship reports. https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Cltnumgt While GitPython does enable passing custom kwargs to the command line `git` invocation, the fact that kwargs is a dictionary (i.e. no duplicate keys) means that there was no way to request the `-C` option in `git blame` more than once. This commit adds an optional `rev_opts` parameter to the `blame` method which accepts a list of strings to propagate to the CLI invocation of `git blame`. By using a `List[str]` for `rev_opts`, users of GitPython can pass now the `-C` option multiple times to get more detailed authorship reports from `git blame`.
* docs: add typerror exception to active_branch methodPatrick Gerard2022-08-201-0/+2
| | | | | | | | docs: add typerror exception to active_branch method fix: sphinx syntax add author
* BUG: Use Cygwin paths for Cygwin gitDWesl2022-06-111-2/+4
|
* STY: Remove import of now-unused functionDWesl2022-06-111-1/+0
|
* BUG: Convert to native path before checking if absoluteDWesl2022-06-101-1/+5
|
* reformat according to 'black' configuration file.Sebastian Thiel2022-05-182-90/+30
|
* Revert "Remove flake8 linting in favor of `black` formatting"Sebastian Thiel2022-05-181-0/+1
| | | | This reverts commit a7c5d887e943aa51f2270e517954c024a8c01500.
* Remove flake8 linting in favor of `black` formattingSebastian Thiel2022-05-181-1/+0
| | | | `flake8` seems to dislike the formatting of black.
* Run everything through 'black'Sebastian Thiel2022-05-182-257/+456
| | | | | That way people who use it won't be deterred, while it unifies style everywhere.
* Fix various typosluz paz2022-05-072-3/+3
| | | Found via `codespell -q 3 -S ./git/ext/gitdb,./test/fixtures/reflog_master,./test/fixtures/diff_mode_only,./test/fixtures/reflog_HEAD`
* Allow `repo.create_head`'s `commit` arg to be a `SymbolicReference`David Robertson2022-04-021-1/+2
| | | | This matches the signature from `Head.create`.
* fix iter_commits comment, more in line with iter_itemsHoussam Kherraz2022-02-241-2/+2
|
* Fix typing issues with delete_head and Remote.addRuss Allbery2021-09-201-1/+1
| | | | | | | | | | | | | | delete_head and Head.delete historically accept either Head objects or a str name of a head. Adjust the typing to match. This unfortunately requires suppressing type warnings in the signature of RemoteReference.delete, since it inherits from Head but does not accept str (since it needs access to the richer data of RemoteReference). Using assignment to make add an alias for create unfortunately confuses mypy, since it loses track of the fact that it's a classmethod and starts treating it like a staticmethod. Replace with a stub wrapper instead.
* Use the Git class type definition within Repo classmethodsMichael Mulich2021-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the GitCommandWrapperType definition to be used within the Repo classmethods. This change follows the intended purpose as stated in the code, "Subclasses may easily bring in their own custom types by placing a constructor or type here." The usecase that prompted this change has to do with `GIT_SSH_COMMAND`. The goal is to setup a custom `Git` class with knowledge of the value, something like as follows ```python from git import Git as BaseGit, Repo as BaseRepo class Git(BaseGit): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # For example, assign the SSH command using the current flask # app's configured setting. self.update_environment(GIT_SSH_COMMAND=current_app.config['GIT_SSH_COMMAND']) class Repo(BaseRepo): GitCommandWrapperType = _Git ``` With this change, the above example will allow the developer to use `Repo.clone_from(...)` with the indended outcome. Otherwise the developer will have two differing result when using `Repo(...)` vs `Repo.clone_from(...)`.
* Improve type of repo.currently_rebasing_on()Yobmod2021-08-021-2/+2
|
* Improve type of repo.blame_incremental()Yobmod2021-08-021-9/+9
|
* Choose TypedDict!Yobmod2021-08-021-37/+32
|
* Test Dataclass in repo.base.blame() 6Yobmod2021-08-021-6/+5
|
* Test Dataclass in repo.base.blame() 5Yobmod2021-08-021-30/+37
|
* Test Dataclass in repo.base.blame() 4Yobmod2021-08-021-11/+10
|
* Test TypedDict in repo.base.blame() 1Yobmod2021-08-021-13/+14
|
* Test TypedDict in repo.base.blame() 2Yobmod2021-08-021-44/+36
|
* Test Dataclass in repo.base.blame() 3Yobmod2021-08-021-13/+14
|
* Test Dataclass in repo.base.blame() 2Yobmod2021-08-021-2/+2
|
* Test Dataclass in repo.base.blame()Yobmod2021-08-021-37/+66
|
* Test trailing comma in args (>py3.6?)Yobmod2021-08-021-3/+5
|
* Test new union syntax (Pep604)Yobmod2021-08-021-1/+1
|
* Add __future__.annotations to repo/base.pyYobmod2021-08-022-5/+6
|
* Add __future__.annotations to cmd.py2Yobmod2021-08-021-3/+3
|
* Add __future__.annotations to cmd.pyYobmod2021-08-021-7/+7
|
* increase mypy strictness (warn unused ignored and warn unreachable)Yobmod2021-08-022-8/+14
|
* replace more TBDs wiht runtime typesYobmod2021-07-311-4/+5
|
* Add type to repo.base._to_full_tag_pathYobmod2021-07-311-6/+7
|
* Fix more missing types in Symbolic.py, cos GuthubActions pytest stuckYobmod2021-07-281-1/+2
|
* Fix some SymbolicReference typesYobmod2021-07-281-1/+1
|
* Fix SymbolicReference reference typingYobmod2021-07-281-3/+2
|
* Added support of spaces for clone multi_optionsIgor Lakhtenkov2021-07-271-1/+2
|
* Rmv with_metaclass shim, make section constraint generic wrt its ↵Yobmod2021-07-241-2/+4
| | | | configparser type
* Replace all Typeguard with cast, revert update to typing-extensions==3.10.0Yobmod2021-07-241-2/+3
|
* Rmv old py2.7 __future__ importsYobmod2021-07-191-1/+0
|
* Make pathlike a forward refYobmod2021-07-191-3/+4
|
* Change remaining type comments to py3.6+ typesYobmod2021-07-192-14/+15
|
* Make types in refs compatible with repoYobmod2021-07-191-3/+4
|
* Increase mypy strictness (no_implicit_optional & warn_redundant_casts) and ↵Yobmod2021-07-081-4/+4
| | | | fix errors
* Fix for mrepo2Yobmod2021-07-061-1/+1
|
* Add types to submodule.update()Yobmod2021-07-061-3/+6
|
* Improve BlameEntry.commit typingYobmod2021-07-051-4/+4
|
* Improve typing of config_levels, add assert_never()Yobmod2021-07-051-9/+10
|
* Add missed types to Commit, uncomment to_native_path_linux()Yobmod2021-07-011-1/+1
|
* Type Traversable.traverse() better, start types of submoduleYobmod2021-06-301-8/+8
|