summaryrefslogtreecommitdiff
path: root/git/cmd.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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
|
* apveyor, #519: FIX incomplete Popen pumpKostis Anagnostopoulos2016-09-261-3/+13
| | | | | | | | + 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.
* test, deps: FIX `mock` deps on py3.Kostis Anagnostopoulos2016-09-251-9/+8
| | | | + Del extra spaces, import os.path as osp
* fix(repo): make it serializable with pickleSebastian Thiel2016-09-111-1/+20
| | | | | | | It's entirely untested if this repo still does the right thing, but I'd think it does. Fixes #504
* refactor(cmd): streamline usage of creationflagsSebastian Thiel2016-08-021-13/+4
|
* creationflags must be set to 0 on non-windows platformsBarry Scott2016-08-011-4/+5
|
* Must pass creationflags as a keyworkBarry Scott2016-08-011-1/+1
|
* Prevent CMD windows being shown when starting git in a subprocess.Barry Scott2016-07-291-1/+14
| | | | | 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.
* Fix issue #470Barry Warsaw2016-06-151-5/+6
|
* fix(flake): misc whitespace fixesSebastian Thiel2016-06-141-2/+1
|
* fix(misc): various cleanupSebastian Thiel2016-06-131-25/+6
| | | | | | | | | 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.
* Can get a str object from stream.read rather then bytes.Barry Scott2016-06-061-1/+4
| | | Convert to the expected bytes.
* log all the output from stdout and stderr for debugging process failuresBarry Scott2016-06-061-1/+14
|
* Merge remote-tracking branch 'upstream/master' into ↵Barry Scott2016-06-061-1/+1
|\ | | | | | | pr-cmd-raise-with-stderr-on-error
| * Make sure os is not even partly destroyedDavid Danier2016-06-011-1/+1
| |
* | Make sure that stderr is converted to bytesBarry Scott2016-05-301-3/+12
| | | | | | remove stderr for a wait() that is not the GitPython wrapper.
* | Return all the stderr messge after an error is detected for pull()Barry Scott2016-05-291-3/+3
|/
* Use proper syntax for conditional expressionAleksander Nitecki2016-05-261-1/+1
| | | (instead of abusing the "short-circuit" property of logical operations)
* fix(remote): use universal_newlines for fetch/pushSebastian Thiel2016-05-261-2/+7
| | | | | | That way, real-time parsing of output should finally be possible. Related to #444
* import OrderedDict from git.odict rather than directly from collections, to ↵Kenneth Hoste2016-05-261-1/+1
| | | | pix Py2.6 compatibility
* fix(cmd): fix with_stdout implementationSebastian Thiel2016-05-241-1/+1
| | | | | | | | | | | | | | Admittedly this fix is solely based on the documentation provided for this parameter, which indicated a different intend than was actually implemented. Also I don't believe doing this will cause any harm. As a special note: the call to `open(os.devnull, 'wb')` does not seem leak the handle, apparently it is given as-is to the subprocess, which will then close it naturally. This was tested using an interactive session via `htop` on osx. Fixes #437
* fix(cmd): don't catch progress handler exceptionsSebastian Thiel2016-05-241-6/+1
| | | | Fixes #435
* Fix order of operators before executing the git commandGuyzmo2016-05-121-0/+3
| | | | | | | | | | | | | | | | | | | Since Python 3.3, the hash value of an object is seeded randomly, making it change between each call. As a consequence, the `dict` type relying on the hash value for the order of the items upon iterating on it, and the parameters passed to `git` being passed as `kwargs` to the `execute()` method, the order of parameters will change randomly between calls. For example, when you call `git.remote.pull()` in a code, two consecutives run will generate: 1. git pull --progress -v origin master 2. git pull -v --progress origin master Within the `transform_kwargs()` method, I'm promoting `kwargs` into an `collections.OrderedDict` being built with `kwargs` sorted on the keys. Then it will ensure that each subsequent calls will execute the parameters in the same order.
* Support repeated kwargsVincent Driessen2016-04-191-12/+20
| | | | | | | | | | | | | Some Git command line options are allowed to be repeated multiple times. Examples of this are the -C flag which may occur more than once to "strengthen" its effect, or the -L flag on Git blames, to select multiple blocks of lines to blame. $ git diff -C -C HEAD~1 HEAD $ git blame -L 1-3 -L 12-18 HEAD -- somefile.py This patch supports passing a list/tuple as the value part for kwargs, so that the generated Git command contain the repeated options.
* Make sure .read() and friends always return bytesVincent Driessen2016-04-061-2/+2
|
* fix(cmd): Use buffered readsColin Snover2016-02-241-0/+1
| | | Popen defaults to using unbuffered reads, which are extremely slow.