summaryrefslogtreecommitdiff
path: root/git/cmd.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix encoding issue with stderr_value and kill_after_timeoutPaul Belanger2017-10-051-2/+2
| | | | | | We don't properly encode our error message under python3. Signed-off-by: Paul Belanger <pabelanger@redhat.com>
* Merge branch 'master' into masterSebastian Thiel2017-09-281-8/+134
|\
| * Merge branch 'master' into adding_setup_for_git_executableSebastian Thiel2017-09-281-2/+2
| |\
| * | Minor bug fixesOdegard, Ken2017-07-261-5/+15
| | | | | | | | | | | | | | | | | | Added tilde expansion as part of the refresh function. Added python version check such that we properly capture PermissionError in Python >=3 and OSError in Python <3.
| * | Minor additional cleanupOdegard, Ken2017-07-251-27/+50
| | | | | | | | | | | | | | | | | | | | | Added additional information in the import warning/error that tells the user how to silence the warning/error. Also added a GIT_OK variable that allows for a quick check whether the refresh has succeeded instead of needing to test an actual git command.
| * | Renamed GIT_PYTHON_INITERR to GIT_PYTHON_REFRESHOdegard, Ken2017-07-131-27/+36
| | | | | | | | | | | | Renamed and cleaned up variable names.
| * | Removed remaining references to git.setup functionOdegard, Ken2017-07-131-5/+5
| | | | | | | | | | | | | | | Removed few remaining references to git.setup function (as it was renamed to refresh).
| * | Expanded ability of importOdegard, Ken2017-07-131-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | Renamed GIT_PYTHON_NOWARN to GIT_PYTHON_INITERR and added values for quiet import, warning import, and raise import. These respectively mean that no message or error is printed if git is non-existent, a plain warning is printed but the import succeeds, and an ImportError exception is raised.
| * | Added ability to silence initial warningOdegard, Ken2017-07-091-4/+13
| | | | | | | | | | | | | | | Added the ability to silence the first refresh warning upon import by setting an environment variable.
| * | Moved setup function into top level __init__Odegard, Ken2017-07-091-34/+20
| | | | | | | | | | | | | | | | | | | | | | | | Discovered that the remote module also relies on the git executable as such it also needs to be “refreshed” anytime the git executable is updated or changed. This was best solved by moving the setup function into the top level __init__ where the setup simply calls git.cmd.Git.refresh and git.remote.FetchInfo.refresh.
| * | Preliminary implementation of setup/refresh functionsOdegard, Ken2017-07-091-8/+75
| | | | | | | | | | | | | | | | | | | | | | | | Added one function (setup) and an alias (refresh simply calls setup). These functions give the developer one more way to configure the git executable path. This also allows the user to interactively adjust the git executable configured during runtime as these functions dynamically update the executable path for the entire git module.
* | | Merge branch 'master' into masterSebastian Thiel2017-09-281-2/+2
|\ \ \ | | |/ | |/|
| * | util: move expand_path from repo/base and use it in Git class initAlexis Horgix Chotard2017-08-251-2/+2
| |/
* | implemented per-call environment variable supportAnson Mansfield2017-07-191-1/+8
|/
* Spelling fixesVille Skyttä2017-03-091-1/+1
|
* Merge pull request #582 from gitpython-developers/no_devnull_openSebastian Thiel2017-02-251-1/+1
|\ | | | | fix(cmd): checking process.DEVNUL were needlessly opening `os.devnull`
| * fix(cmd): checking process.DEVNUL were needlessly opening `os.devnull`no_devnull_openKostis Anagnostopoulos2017-02-101-1/+1
| | | | | | | | | | | | | | Fixes resource-leak warning on Windows Puython-3.5.3+: D:\python-3.5.2.amd64\lib\site-packages\git\cmd.py:583: ResourceWarning: unclosed file <_io.BufferedWriter name='nul'> else getattr(subprocess, 'DEVNULL', open(os.devnull, 'wb')))
* | Merge pull request #555 from ankostis/cntxtmmanSebastian Thiel2017-02-251-16/+19
|\ \ | | | | | | Retrofit `repo` class as context-man to cleanup global mman on repo-delete
| * | style(cmd): pythonize cmd-args filtering for PY26, improve docstringKostis Anagnostopoulos2016-12-081-16/+19
| |/ | | | | Apply codereview comments of #541.
* | fix(cmd): don't try to use TASKKILL on linuxSebastian Thiel2017-02-251-2/+3
|/ | | | Fixes #576
* Merge pull request #541 from andy-maier/py26_fixesSebastian Thiel2016-12-081-5/+9
|\ | | | | Fixes to support Python 2.6 again.
| * Fixes to support Python 2.6 again.Andreas Maier2016-10-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Details: - Added Python 2.6 again to .travis.yml (it was removed in commit 4486bcb). - Replaced the use of dictionary comprehensions in `git/cmd.py` around line 800 with the code before that change (in commit 25a2ebf). Reason: dict comprehensions were introduced only in Python 2.7. - Changed the import source for `SkipTest` and `skipIf` from `unittest.case` to first trying `unittest` and upon ImportError from `unittest2`. This was done in `git/util.py` and in several testcases. Reason: `SkipTest` and `skipIf` were introduced to unittest only in Python 2.7, and `unittest2` is a backport of `unittest` additions to Python 2.6. - In git/test/lib/helper.py, fixed the definition of `assertRaisesRegex` to work on py26. - For Python 2.6, added the `unittest2` dependency to `requirements.txt` and changed `.travis.yml` to install `unittest2`. Because git/util.py uses SkipTest from unittest/unittest2, the dependency could not be added to `test-requirements.txt`. - Fixed an assertion in `git/test/test_index.py` to also allow a Python 2.6 specific exception message. - In `is_cygwin_git()` in `git/util.py`, replaced `check_output()` with `Popen()`. It was added in Python 2.7. - Enabled Python 2.6 for Windows: - Added Python 2.6 for MINGW in .appveyor.yml. - When defining `PROC_CREATIONFLAGS` in `git/cmd.py`, made use of certain win32 and subprocess flags that were introduced in Python 2.7, dependent on whether we run on Python 2.7 or higher. - In `AutoInterrupt.__del__()` in `git/cmd.py`, allowed for `os` not having `kill()`. `os.kill()` was added for Windows in Python 2.7 (For Linux, it existed in Python 2.6 already).
* | chore(lint): flake8Sebastian Thiel2016-12-081-0/+1
|/ | | | | | | | Interestingly only shows in particular python versions on travis. Maybe some caching effect? Locally it is reproducible easily, with the latest flake8
* Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ↵Sebastian Thiel2016-10-221-2/+21
|\ | | | | | | ankostis-cygwin
| * cygwin, #533: FIX daemon launchingKostis Anagnostopoulos2016-10-141-4/+7
| | | | | | | | | | | | | | | | + Rework git-daemon launching with `with` resource-management. + cmd: add `is_cygwin` optional override kwd on `Git.polish_url()`. - Cygwin TCs failing: - PY2: err: 13, fail: 3 - PY3: err: 12, fail: 3
| * cygwin, #533: Try to make it work with Cygwin's Git.Kostis Anagnostopoulos2016-10-141-1/+17
| | | | | | | | | | | | | | | | | | + Make `Git.polish_url()` convert paths into Cygwin-friendly paths. + Add utility and soe TCs for funcs for detecting cygwin and converting abs-paths to `/cygdrive/c/...`. - Cygwin TCs failing: - PY2: err: 14, fail: 3 - PY3: err: 13, fail: 3
* | Fix some typosSantiago Castro2016-10-201-3/+3
| |
* | Add a test for persistent git optionsBenjamin Poldrack2016-10-181-1/+1
| |
* | Allow for setting git options, that are persistent across subcommand callsBenjamin Poldrack2016-10-181-2/+20
|/
* cmd, #525: Always include stdout+stderr in exceptionsKostis Anagnostopoulos2016-10-141-4/+1
| | | | | + Ignore `with_extended_output` arg when reaising the exception, keep its behavior when `status==0`.
* remote, #525: FIX BUG push-cmd misses error messagesKostis Anagnostopoulos2016-10-141-1/+1
| | | | | | + Bug discovered after enabling TC in prev commit and rework of fetch. + remote_tc: unitestize assertions. + util: DEL unused `_mktemp()`.
* remote, #525: pump fetch-infos instead of GIL-read stderrKostis Anagnostopoulos2016-10-131-2/+6
| | | | | | + `handle_process_output()` accepts null-finalizer, to pump completely stderr before raising any errors. + test: Enable `TestGit.test_environment()` on Windows (to checks stderr consumption).
* test, #525: allow disabling freeze errors separatelyKostis Anagnostopoulos2016-10-131-2/+5
| | | | | + cmd: use DEVNULL for non PIPEs; no open-file. + TCs: some unitestize-assertions on base & remote TCs.
* daemon, #525: FIX remote urls in config-filesKostis Anagnostopoulos2016-10-121-1/+5
| | | | | | | | | | | | + Parse most remote & config-urls \-->/. + Used relative daemon-paths. + Use git-daemon PORT above 10k; on Windows all below need Admin rights. +FIXED git-daemon @with_rw_and_rw_remote_repo(): + test_base.test_with_rw_remote_and_rw_repo() PASS. + test_remote.test_base() now freezes! (so still hidden win_err) + repo_test: minor finally delete test-repos created inside this repo. + util: delete unused `absolute_project_path()`.
* repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedirKostis Anagnostopoulos2016-10-121-12/+3
| | | | + Do not abspath twice when contructing cloned repo. + Add `git.repo.base` logger.
* pumps: FIX don't pump when proc has no streamsKostis Anagnostopoulos2016-10-121-4/+9
|
* FIX regression by #519 on reading stdout/stderr of cmdsKostis Anagnostopoulos2016-10-021-1/+2
|
* Win, #519: FIX repo TCs.Kostis Anagnostopoulos2016-10-011-4/+8
| | | | | | | | | | | | | | | + FIX TestRepo.test_submodule_update(): + submod: del `.git` file prior overwrite; Windows denied otherwise! + FIX TestRepo.test_untracked_files(): + In the `git add <file>` case, it failed with unicode args on PY2. Had to encode them with `locale.getpreferredencoding()` AND use SHELL. + cmd: add `shell` into `execute()` kwds, for overriding USE_SHELL per command. + repo: replace blocky `communicate()` in `_clone()` with thread-pumps. + test_repo.py: unittestize (almost all) assertions. + Replace open --> with open for index (base and TC). + test_index.py: Enabled a dormant assertion.
* ci: Capture logging for Popen() execute statements.Kostis Anagnostopoulos2016-09-301-0/+1
| | | + Collect all known commands
* ABANDON select/poll Kostis Anagnostopoulos2016-09-281-185/+48
|
* remote, #519: INCOMPLETE FIX-2 double-decoding push-infosKostis Anagnostopoulos2016-09-281-11/+19
| | | | + Unicode PY2/3 issues fixed also in pump stream func.
* Proc, #519: Rework error-exc msgs & log thread-pumps errorsKostis Anagnostopoulos2016-09-281-24/+40
| | | | | + No WindowsError exception. + Add `test_exc.py` for unicode issues. + Single-arg for decoding-streams in pump-func.
* io, dif: #519: FIX DIFF freeze when reading from GILKostis Anagnostopoulos2016-09-281-67/+74
| | | | | | | | | | | | | | | + CAUSE: In Windows, Diffs freeze while reading Popen streams, probably buffers smaller; good-thin(TM) in this case because reading a Popen-proc from the launching-thread freezes GIL. The alternative to use `proc.communicate()` also relies on big buffers. + SOLUTION: Use `cmd.handle_process_output()` to consume Diff-proc streams. + Retroffited `handle_process_output()` code to support also byte-streams, both Threading(Windows) and Select/Poll (Posix) paths updated. - TODO: Unfortunately, `Diff._index_from_patch_format()` still slurps input; need to re-phrase header-regexes linewise to resolve it.
* Win, #519: FIX with_rw_directory() to remove read-only dirsKostis Anagnostopoulos2016-09-281-0/+4
| | | | | + Stop using gitdb's respective helper. + Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux).
* src: constify is_<platform>() callsKostis Anagnostopoulos2016-09-281-5/+5
| | | + TCs: unittest-asserts for git-tests.
* Win, #519: Remove `git.cmd` failback - no longer exists.Kostis Anagnostopoulos2016-09-281-54/+15
| | | | | | | + Simplify call_process, no win-code case, no `make_call()` nested func. + Del needless WinError try..catch, in `_call_process()` already converted as GitCommandNotFound by `execute()`. + pyism: kw-loop-->comprehension, facilitate debug-stepping
* test, #519: Try appveyor advice for never-ending buildsKostis Anagnostopoulos2016-09-281-1/+2
| | | | | | | | | | | + see http://help.appveyor.com/discussions/problems/5334-nosetests-finsih-bu-build-stuck-and-next-job-dealys-to-start + Use `io.DEFAULT_BUFFER_SIZE`. + test_commit: replace asserts with unittest-asserts. - TRY Popen() NO universal_newlines: NO, reverted in next commits. + [travisci skip]
* src, #519: collect all is_<platform>() callsKostis Anagnostopoulos2016-09-271-7/+9
|
* Win, #519: FIX WinHangs: Popen() CREATE_NEW_PROCESS_GROUP to allow killKostis Anagnostopoulos2016-09-261-7/+14
| | | | | + FIXED most hangs BUT no more `git-daemon` un-killable! + Use logger for utils to replace stray print().
* test, #519: Popen() pump: remove WaitGroupKostis Anagnostopoulos2016-09-261-13/+6
|