aboutsummaryrefslogtreecommitdiff
path: root/git/cmd.py
AgeCommit message (Collapse)Author
2017-03-09Spelling fixesVille Skyttä
2017-02-25Merge pull request #582 from gitpython-developers/no_devnull_openSebastian Thiel
fix(cmd): checking process.DEVNUL were needlessly opening `os.devnull`
2017-02-25Merge pull request #555 from ankostis/cntxtmmanSebastian Thiel
Retrofit `repo` class as context-man to cleanup global mman on repo-delete
2017-02-25fix(cmd): don't try to use TASKKILL on linuxSebastian Thiel
Fixes #576
2017-02-10fix(cmd): checking process.DEVNUL were needlessly opening `os.devnull`no_devnull_openKostis Anagnostopoulos
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')))
2016-12-08style(cmd): pythonize cmd-args filtering for PY26, improve docstringKostis Anagnostopoulos
Apply codereview comments of #541.
2016-12-08Merge pull request #541 from andy-maier/py26_fixesSebastian Thiel
Fixes to support Python 2.6 again.
2016-12-08chore(lint): flake8Sebastian Thiel
Interestingly only shows in particular python versions on travis. Maybe some caching effect? Locally it is reproducible easily, with the latest flake8
2016-10-24Fixes to support Python 2.6 again.Andreas Maier
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).
2016-10-22Merge branch 'cygwin' of https://github.com/ankostis/GitPython into ↵Sebastian Thiel
ankostis-cygwin
2016-10-20Fix some typosSantiago Castro
2016-10-18Add a test for persistent git optionsBenjamin Poldrack
2016-10-18Allow for setting git options, that are persistent across subcommand callsBenjamin Poldrack
2016-10-14cygwin, #533: FIX daemon launchingKostis Anagnostopoulos
+ 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
2016-10-14cygwin, #533: Try to make it work with Cygwin's Git.Kostis Anagnostopoulos
+ 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
2016-10-14cmd, #525: Always include stdout+stderr in exceptionsKostis Anagnostopoulos
+ Ignore `with_extended_output` arg when reaising the exception, keep its behavior when `status==0`.
2016-10-14remote, #525: FIX BUG push-cmd misses error messagesKostis Anagnostopoulos
+ Bug discovered after enabling TC in prev commit and rework of fetch. + remote_tc: unitestize assertions. + util: DEL unused `_mktemp()`.
2016-10-13remote, #525: pump fetch-infos instead of GIL-read stderrKostis Anagnostopoulos
+ `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).
2016-10-13test, #525: allow disabling freeze errors separatelyKostis Anagnostopoulos
+ cmd: use DEVNULL for non PIPEs; no open-file. + TCs: some unitestize-assertions on base & remote TCs.
2016-10-12daemon, #525: FIX remote urls in config-filesKostis Anagnostopoulos
+ 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()`.
2016-10-12repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedirKostis Anagnostopoulos
+ Do not abspath twice when contructing cloned repo. + Add `git.repo.base` logger.
2016-10-12pumps: FIX don't pump when proc has no streamsKostis Anagnostopoulos
2016-10-02FIX regression by #519 on reading stdout/stderr of cmdsKostis Anagnostopoulos
2016-10-01Win, #519: FIX repo TCs.Kostis Anagnostopoulos
+ 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.
2016-09-30ci: Capture logging for Popen() execute statements.Kostis Anagnostopoulos
+ Collect all known commands
2016-09-28ABANDON select/poll Kostis Anagnostopoulos
2016-09-28remote, #519: INCOMPLETE FIX-2 double-decoding push-infosKostis Anagnostopoulos
+ Unicode PY2/3 issues fixed also in pump stream func.
2016-09-28Proc, #519: Rework error-exc msgs & log thread-pumps errorsKostis Anagnostopoulos
+ No WindowsError exception. + Add `test_exc.py` for unicode issues. + Single-arg for decoding-streams in pump-func.
2016-09-28io, dif: #519: FIX DIFF freeze when reading from GILKostis Anagnostopoulos
+ 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.
2016-09-28Win, #519: FIX with_rw_directory() to remove read-only dirsKostis Anagnostopoulos
+ Stop using gitdb's respective helper. + Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux).
2016-09-28src: constify is_<platform>() callsKostis Anagnostopoulos
+ TCs: unittest-asserts for git-tests.
2016-09-28Win, #519: Remove `git.cmd` failback - no longer exists.Kostis Anagnostopoulos
+ 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
2016-09-28test, #519: Try appveyor advice for never-ending buildsKostis Anagnostopoulos
+ 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]
2016-09-27src, #519: collect all is_<platform>() callsKostis Anagnostopoulos
2016-09-26Win, #519: FIX WinHangs: Popen() CREATE_NEW_PROCESS_GROUP to allow killKostis Anagnostopoulos
+ FIXED most hangs BUT no more `git-daemon` un-killable! + Use logger for utils to replace stray print().
2016-09-26test, #519: Popen() pump: remove WaitGroupKostis Anagnostopoulos
2016-09-26apveyor, #519: FIX incomplete Popen pumpKostis Anagnostopoulos
+ The code in `_read_lines_from_fno()` was reading the stream only once per invocation, so when input was larger than `mmap.PAGESIZE`, bytes were forgotten in the stream. + Replaced buffer-building code with iterate-on-file-descriptors. + Also set deamon-threads.
2016-09-25test, deps: FIX `mock` deps on py3.Kostis Anagnostopoulos
+ Del extra spaces, import os.path as osp
2016-09-11fix(repo): make it serializable with pickleSebastian Thiel
It's entirely untested if this repo still does the right thing, but I'd think it does. Fixes #504
2016-08-02refactor(cmd): streamline usage of creationflagsSebastian Thiel
2016-08-01creationflags must be set to 0 on non-windows platformsBarry Scott
2016-08-01Must pass creationflags as a keyworkBarry Scott
2016-07-29Prevent CMD windows being shown when starting git in a subprocess.Barry Scott
This fixes a UI problem with using GitPython from a GUI python probgram. Each repo that is opened creates a git cat-file processs and that provess will create a console window with out this change.
2016-06-15Fix issue #470Barry Warsaw
2016-06-14fix(flake): misc whitespace fixesSebastian Thiel
2016-06-13fix(misc): various cleanupSebastian Thiel
Just went through all changes and adjusted them to the best of my abilities. As there are no tests to claim otherwise, I believe this is correct enough. However, it becomes evident that it's no longer possible to just make changes without backing them with a respective test.
2016-06-06Can get a str object from stream.read rather then bytes.Barry Scott
Convert to the expected bytes.
2016-06-06log all the output from stdout and stderr for debugging process failuresBarry Scott
2016-06-06Merge remote-tracking branch 'upstream/master' into ↵Barry Scott
pr-cmd-raise-with-stderr-on-error
2016-06-01Make sure os is not even partly destroyedDavid Danier