summaryrefslogtreecommitdiff
path: root/git
Commit message (Collapse)AuthorAgeFilesLines
* move cmd.py types to another branch, mark typing import as unusedyobmod2021-02-282-10/+7
|
* add py.typed, mypy.ini and git/types.pyyobmod2021-02-282-0/+6
|
* drop py3.4 supportyobmod2021-02-281-4/+7
|
* add replace method to git.CommitLars Kellogg-Stedman2021-02-151-7/+36
| | | | | | | | | | | This adds a replace method to git.Commit. The replace method returns a copy of the Commit object with attributes replaced from keyword arguments. For example: >>> old = repo.head.commit >>> new = old.replace(message='This is a test') closes #1123
* version bump3.1.13Sebastian Thiel2021-02-091-0/+0
|
* Fix inheritance issue at commit.iter_itemsYuri Volchkov2021-02-051-1/+1
| | | | | | | The iterator used to yield Commit() objects, which does not play well with inheritance. Yield cls() instead. Signed-off-by: Yuri Volchkov <yuri@volch.org>
* fix universal_newlines TypeErrorx-santiaga-x2021-01-281-1/+3
| | | | Fixes #1116
* Make git.cmd.Git.CatFileContentStream iterableHex0522021-01-171-0/+3
| | | Add __next__ method to git.cmd.Git.CatFileContentStream, so it can actually be used as an iterable
* fix(fetch): use the correct FETCH_HEAD from within a worktreeGiel van Schijndel2021-01-141-3/+2
| | | | | | | | FETCH_HEAD is one of the symbolic references local to the current worktree and as such should _not_ be looked up in the 'common_dir'. But instead of just hard coding the "right thing" (git_dir) lets defer this to the SymbolicReference class which already contains this knowledge in its 'abspath' property.
* fix flakeSebastian Thiel2021-01-081-0/+1
|
* First attempt to fix failing test of #1103fix-1103Sebastian Thiel2021-01-071-4/+10
| | | | | | | | | | | | However, the test asserts on the provided context to be correct, which is hard to do in this branch while it's easy to doubt the value of this. Lastly, there seems to be no way to ignore errors in `git` without muting all output, which is in fact parsed. Maybe it's possible to ignore errors while parsing the new kind of error message.
* Fix handle_diff_line for -z option.Martin Liska2021-01-061-49/+49
|
* try fixing up test fixtures and implementationSebastian Thiel2021-01-061-2/+2
|
* Add '-z' on top of '--raw' to avoid path name manglingSebastian Thiel2021-01-061-1/+2
| | | | | | | Authored based on https://github.com/gitpython-developers/GitPython/issues/1099#issuecomment-754606044 Fixes #1099
* fix universal_newlines TypeErrorJim Wisniewski2020-12-301-3/+4
|
* docs: fix simple typo, repostory -> repositoryTim Gates2020-12-251-1/+1
| | | | | | There is a small typo in git/repo/base.py. Should read `repository` rather than `repostory`.
* Added ability to define git environment in submodule add/update methodsIgor Solovey2020-11-191-4/+16
|
* change decode type and add replace flagDavide Spadini2020-11-101-1/+1
|
* Fix default actor name handlingAthos Ribeiro2020-10-231-1/+1
| | | | | | | | In c96476b, the new default_name nested function does not contain a retun statement. This leads to an issue when the environment variables are not present, where the actor name would not be set. Signed-off-by: Athos Ribeiro <athos@redhat.com>
* Get system user id in a lazy mannerAthos Ribeiro2020-10-221-4/+12
| | | | | | | | | | | | | | | | Calling getpass.getuser may lead to breakage in environments where there is no entries in the /etc/passwd file for the current user. Setting the environment variables for the git user configurations should prevents GitPython from using values from /etc/passwd. However, doing so will not prevent reading /etc/passwd and looking for an entry with the current user UID. This patch changes the behavior described above so GitPython will perform a lazy evaluation of /etc/passwd, only doing so when the environment variables for the git user configuration are not available. Signed-off-by: Athos Ribeiro <athos@redhat.com>
* Do not break convention when updating sys.pathXavier Verges2020-10-051-1/+1
|
* rename sublist to subsetSagi Shadur2020-09-291-1/+1
|
* Rename get_ignored to ignored and fix the documentationSagi Shadur2020-09-291-2/+2
|
* Find paths ignored in .gitignoreSagi Shadur2020-09-291-0/+13
|
* git/repo/base.py: is_dirty(): Fix pathspec handlingArnaud Patard2020-09-281-1/+1
| | | | | | | | | | | | | It's possible to specify a pathspec (eg :!foo) to git diff/status/... but it currently fails with: git.exc.GitCommandError: Cmd('/usr/bin/git') failed due to: exit code(128) cmdline: /usr/bin/git diff --abbrev=40 --full-index --raw :!foo stderr: 'fatal: ambiguous argument ':!foo': unknown revision or path not in the working tree. Add missing '--' to the arguments to fix this ambiguity Signed-off-by: Arnaud Patard <apatard@hupstream.com>
* Ensure that detached HEAD does not raise when comparing branch name.Jeremy Retailleau2020-09-031-1/+7
|
* Reformat code to remove unnecessary indentationJeremy Retailleau2020-09-031-29/+31
|
* Add missing blank lineJeremy Retailleau2020-09-021-0/+1
|
* Add missing rules to match hierarchy pathJeremy Retailleau2020-09-021-12/+16
|
* Fix logic to properly compare glob pattern to valueJeremy Retailleau2020-09-021-15/+16
|
* Add method to retrieve all possible paths to includeJeremy Retailleau2020-09-021-1/+36
|
* Add reference to repository to config.Jeremy Retailleau2020-09-022-4/+8
| | | | | | | This is necessary when working with conditional include sections as it requires the git directory or active branch name. https://git-scm.com/docs/git-config#_conditional_includes
* Update check method to find all includesJeremy Retailleau2020-09-021-1/+4
|
* Add Regex to match content of "includeIf" sectionJeremy Retailleau2020-09-021-0/+3
|
* accept datetime instances as datesAlba Mendez2020-08-311-0/+5
| | | | | | There's no easy way to re-create a commit (i.e. for rewriting purposes), because dates must be formatted as strings, passed, then parsed back. This patch allows parse_date() to accept datetime instances, such as those produced by from_timestamp() above.
* Ensure only fully matching symrefs are deletedSimon Westphahl2020-08-121-2/+4
| | | | | | | | Deleting a symbolic ref with e.g. the name 'refs/remotes/origin/mas' would also delete 'refs/remotes/origin/master' if the ref had to be deleted from the pack file. In order to fix this the full ref is now checked for a match.
* Fixed all warnings in documentation and updated Makefile to treat warnings ↵Kian Cross2020-07-135-13/+12
| | | | as errors.
* tests: move to root dirKonrad Weihmann2020-07-1298-17463/+0
| | | | | | | | | This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
* Revert moving tests out of 'git' folder, related to #1030Sebastian Thiel2020-07-1298-0/+17463
|
* tests: move to root dirKonrad Weihmann2020-07-1298-17463/+0
| | | | | | | | | This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
* Fix exception causes all over the codebaseRam Rachum2020-06-147-26/+26
|
* Fix exception causes in 7 modulesRam Rachum2020-06-137-29/+31
|
* Fix exception causes in cmd.pyRam Rachum2020-06-121-4/+4
|
* BF: tollerate errors while parsing fetch linesYaroslav Halchenko2020-05-311-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At first I thought to provide special treatment to git config lines and otherwise keep raising uncaught exception, but then decided that it might be better to loose some progress information than to crash. Also _get_push_info below is doing similarish catching of all exceptions (although doesn't even log them). With this change, log (if enabled and not suppressed) would show [WARNING] Git informed while fetching: git config pull.rebase false # merge (the default strategy) in the case of recently introduced change to the output in the following git commit : d18c950a69f3a24e1e3add3d9fc427641f53e12b is the first bad commit commit d18c950a69f3a24e1e3add3d9fc427641f53e12b Author: Alex Henrie <alexhenrie24@gmail.com> Date: Mon Mar 9 21:54:20 2020 -0600 pull: warn if the user didn't say whether to rebase or to merge Often novice Git users forget to say "pull --rebase" and end up with an unnecessary merge from upstream. What they usually want is either "pull --rebase" in the simpler cases, or "pull --ff-only" to update the copy of main integration branches, and rebase their work separately. The pull.rebase configuration variable exists to help them in the simpler cases, but there is no mechanism to make these users aware of it. Issue a warning message when no --[no-]rebase option from the command line and no pull.rebase configuration variable is given. This will inconvenience those who never want to "pull --rebase", who haven't had to do anything special, but the cost of the inconvenience is paid only once per user, which should be a reasonable cost to help a number of new users. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> builtin/pull.c | 16 ++++++++++++++++ t/t5521-pull-options.sh | 22 +++++++++++----------- t/t7601-merge-pull-config.sh | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 11 deletions(-) Closes #1014
* Fix flake8 errorsSebastian Thiel2020-05-284-5/+5
|
* Improve unfortunate wordingSebastian Thiel2020-05-281-1/+1
| | | | Fixes #1013
* Bump patch level, this time with known signature3.1.2Sebastian Thiel2020-05-051-0/+0
|
* Accept that this arguably simple feature can't be tested easily…Sebastian Thiel2020-05-041-1/+2
| | | | | | | | | …and time is previous. Since I could reproduce it and see it working with the steps provided in the comment: https://github.com/gitpython-developers/GitPython/pull/1009#issuecomment-623008816 I think it's good for now. We also assume there won't be a regression.
* allow setting depth when cloning a submoduleLiam Beguin2020-05-021-1/+9
| | | | Signed-off-by: Liam Beguin <liambeguin@gmail.com>
* add test case for submodule depth parameterLiam Beguin2020-05-021-0/+8
| | | | Signed-off-by: Liam Beguin <liambeguin@gmail.com>