summaryrefslogtreecommitdiff
path: root/git/cmd.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* fix(cmd): allow improved errors during clone operationSebastian Thiel2016-02-141-2/+3
| | | | Related to #383
* fix(cmd): focus !Sebastian Thiel2016-02-131-1/+1
| | | | Thanks travis, once again !
* fix(cmd): safely read from stderrSebastian Thiel2016-02-131-1/+9
| | | | Fixes #383
* fix(cmd): prevent deadlock on clone/fetch/pullSebastian Thiel2016-02-071-2/+4
| | | | | | | | | | | | | | | We keep stdout closed, which seems to have the side-effect of stdout being connected to your TTY, in case you run a terminal. However, this shold also prevent deadlocks, as only stderr is used. The alternative would have been to try to fetch lines concurrently, and we have been there. For clone(), `communicate()` is used, and with some luck this will just do the right thing. Even though last time I checked, it didn't ... ? Lets see. Stab at #72
* Fixed a non-Windows importAshley Whetter2015-12-211-3/+5
| | | | | signal.SIGKILL is not available on Windows so use signal.SIGTERM as a backup when SIGKILL is not available.
* Merge pull request #354 from dpursehouse/execute-timeoutSebastian Thiel2015-10-161-1/+50
|\ | | | | Include 'timeout' parameter in Git execute
| * Run os.kill for all child pids even after some of them are downOswin Nathanial2015-10-131-1/+4
| | | | | | | | | | | | | | | | Right now, we come out of the iteration in case of failure while trying to kill a child pid. This may result in some of the child pids staying alive. Change-Id: I18d58fcefec2bbdae4ae9bf73594939ade241b52
| * Update docstring for 'kill_after_timeout' parameterOswin Nathanial2015-10-131-1/+5
| | | | | | | | | | | | | | | | Specify that this feature is not supported on Windows and mention about the negative side-effects of SIGKILL on a repository. Change-Id: Ibba2c3f51f84084b4637ae9aaafa87dd84000ef4
| * Rename execute param 'timeout' to 'kill_after_timeout'Oswin Nathanial2015-10-131-10/+10
| | | | | | | | Change-Id: I8ab3d5affb3f040dd9630687fb20aedbd7510070
| * Only create watchdog and event if timeout is specified in execute commandOswin Nathanial2015-10-091-8/+10
| | | | | | | | | | | | | | If the timeout is not specified, we don't need the overhead of creating a watchdog and event. Change-Id: I53ff891af24d4c27fb16bf4bb35910dd1d19d238
| * Raise exception when timeout is used in execute command on WindowsOswin Nathanial2015-10-091-0/+2
| | | | | | | | Change-Id: I2e081c606b75b7f8d3d1ee82d93c3d9f3bdcfcbe
| * Include 'timeout' parameter in Git executeOswin Nathanial2015-09-281-1/+39
| | | | | | | | | | | | | | | | | | This feature enables to set a timeout while executing a git command. After this timeout is over, the process will be killed. If not explicitly specified, the default functionality will not be affected. Change-Id: I2dd5f0de7cb1f5f1b4253dd7ce92d23551d5f9a7
* | fix(cmd): remove unused importSebastian Thiel2015-10-151-1/+0
| |
* | doc(cmd): make sure people know wait() may blockSebastian Thiel2015-10-151-0/+2
| | | | | | | | Related to #357
* | Revert "fix(cmd): fixed deadlock when stderr buffer overflow"revert-357-autointerrupt_deadlock_fixSebastian Thiel2015-10-151-4/+4
| |
* | fix(cmd): fixed deadlock when stderr buffer overflowIvan Ryabchenko2015-10-151-4/+4
|/ | | | | | | Fixed deadlock when using stderr=PIPE in Popen and Git generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data (see https://docs.python.org/2/library/subprocess.html#subprocess.Popen.wait)
* fix(cmd): make short options with arguments become two separate arguments ↵Marcos Dione2015-08-201-1/+1
| | | | for the executable.
* fix(cmd): don't open stdout when fetchingSebastian Thiel2015-07-031-80/+75
| | | | | | | This allows us to use the main thread to parse stderr to get progress, and resolve assertion failures hopefully once and for all. Relates to #301
* fix(cmd): line parsingSebastian Thiel2015-07-031-68/+81
| | | | | | * Previously we could fail to parse the last line within a read buffer, which is now fixed. * Added a test to verify our *slow* line parsing works as expected.
* Added NullHandlers to all loggers to preven "No handler" messagesJames Nowell2015-06-251-0/+1
| | | | | | | | When the code is run without setting up loggers, the loggers have no handlers for the emitted messages. The logging module displays: `No handlers could be found for logger "git.cmd"` on the console. By adding a NullHandler (a no-op) the message disappears, and doesn't affect logging when other handlers are configured.
* fix(git-cmd): set LANGUAGE as wellSebastian Thiel2015-05-311-0/+3
| | | | | | This is a pre-emptive measure based on http://goo.gl/l74GC8 . Related to #290
* fix(git-cmd): use LC_ALL instead of LC_MESSAGESSebastian Thiel2015-05-311-2/+4
| | | | | | | | | Previously, only program messages where forced to the C-locale, now we force the entire program. That way, we should assure a remote will not provide us with branch information in any other language but english. Related to #290
* fix(cmd): throw GitCommandNotFoundError ...Sebastian Thiel2015-04-081-13/+33
| | | | | | | ... if it is not found. Previously, especially on windows, this wasn't explicit. Fixes #248, affects #126
* Added 'insert_kwargs_after' flag for consumption by _call_process.Sebastian Thiel2015-02-211-1/+13
| | | | | | While at it, all other invocations of .git in remote.py were reviewed Fixes #262
* Removed Git.sshkey() as it couldn't be distributed properly.0.3.6Sebastian Thiel2015-01-221-21/+0
| | | | | | | However, I kept information on how to achieve the same thing with `custom_environment()` in the test. Related to #234
* Merge branch 'master' into teeberg-masterSebastian Thiel2015-01-221-1/+0
|\ | | | | | | | | | | Need latest master to proceed with test Conflicts: doc/source/tutorial.rst
* | Intermediate commit on my way to get this finalized.Sebastian Thiel2015-01-221-11/+14
| | | | | | | | | | Renamed context manager 'with_environment' to 'custom_environment'. On my way to implement sshkey test.
* | Rename 'environment' and 'set_environment'Jonas Trappenberg2015-01-211-10/+10
| |
* | Add method to query environmentJonas Trappenberg2015-01-211-0/+3
| |
* | Add 'sshkey' context managerJonas Trappenberg2015-01-211-1/+75
| |
* | Fix some typosJonas Trappenberg2015-01-211-2/+2
|/
* Added advance usage examples to tutorial and made minor fixes.Sebastian Thiel2015-01-211-2/+7
| | | | | | GIT_PYTHON_TRACE would actually fail (now) if we debugged archive operations. Related to #239
* Initial set of documentation improvements, and a fix to the submodule tests.Sebastian Thiel2015-01-211-1/+1
| | | | | | Now travisci tests should work once again. Related to #239
* Another take on fixing the current concurrent read implementation in git.cmdSebastian Thiel2015-01-201-34/+77
| | | | | | | | There have been rather obvious errors in there, as we forgot to unregister the filehandles. Now we will read from a buffer ourselves, which should be faster and ideally, doesn't lead to spurious errors anymore. Related to #232
* Fixed some doc strings to build correctly with sphinxSebastian Thiel2015-01-141-3/+3
| | | | | | Fixes #7 [ci skip]
* An attempt to help the threaded reading to not show spurious errors anymore.Sebastian Thiel2015-01-141-8/+8
| | | | | It does not necessarily seem to work, but at least we don't access a dict concurrently anymore.