aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2008-06-20Merge branch 'master' of git://gitorious.org/git-python/david into bisectFlorian Apolloner
2008-06-20fixed second problem in ↵Florian Apolloner
http://groups.google.com/group/git-python/browse_thread/thread/b8f3580abf31f9db?hl=en# I'll look at the other one in an hour
2008-06-15cmd: rename with_keep_cwd to keep_cwdDavid Aguilar
Having execute() use a different directory is an important piece of API information so I added more documentation about it and renamed the flag to just "keep_cwd" since that's shorter and simpler. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-15Merge commit 'sverre/master' into davidDavid Aguilar
* commit 'sverre/master': Added a with_keep_cwd option Improved the GIT_PYTHON_TRACE=full output format Added /dist to .gitignore Conflicts: lib/git/cmd.py Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-15cmd: better support for bare repositoriesDavid Aguilar
In order to avoid the expense of parsing .git/config just to know whether or not a repository is bare at __init__ time, we just pass an optional flag to Git.__init__(): bare_repo with a default value of False. Repo.init_bare() was updated to pass this flag. We could have an optional Git.read_bare_status() function that does the expensive lookup. Then, users can optionally call it at runtime if they really need to know whether or not a repository is bare. That seems like a decent tradeoff between speed, correctness, and common use cases. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-13Added a with_keep_cwd optionSverre Rabbelier
When executing commands, if the with_keep_cwd option is specified, the current working directory will be set to os.getcwd() instead of the directory containing the .git directory.
2008-06-13Improved the GIT_PYTHON_TRACE=full output formatSverre Rabbelier
It now also shows stderr if there was any on it, and only shows stdout if there was any output. Also added a '->' between the command and the return value as a visual clue.
2008-06-12cmd: properly handle cwd for repos with work treesDavid Aguilar
This is a fix on top of Govind's latest performance improvement. self._cwd was always set to self._git_dir which means a lot of commands that require work trees were not available to GitPython. Execute now uses self._cwd which is equal to self._git_dir by default, and self.get_work_tree() if a work tree exists. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-12repo: these changes make Govind's latest changes pass the test casesDavid Aguilar
Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-12Determine git_dir and git_work_tree in python.Govind Salinas
Calling git to find the git_dir and work_tree is very costly. This patch uses the same mechanisim to find the git_dir as native git does without shelling out. Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
2008-06-11stupid typo *grr*Florian Apolloner
2008-06-11removed to much :þFlorian Apolloner
2008-06-11added support for GIT_PYTHON_TRACE=='full', thx to SRabbelier for the suggestionFlorian Apolloner
2008-06-11fixed init_bareFlorian Apolloner
2008-06-07Merge branch 'master' of git://gitorious.org/git-python/mainlineFlorian Apolloner
2008-06-07fixed up the getattr stuffFlorian Apolloner
2008-06-05use getattr instead of gettatributeFlorian Apolloner
2008-06-02changed svn to git. This makes more sense. I tried trunk, master, edge.Michael Trier
2008-06-01Git: guard against passing False to git commandsDavid Aguilar
git does not accept commands of the form: git cmd --xx=False or git cmd -xFalse This patch prevents transform_kwargs from producing command lines with those values. This adds some flexibility/syntactic sugar for callers since they can then assume that kwargs with a False value are not passed to git commands. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-01style: follow PEP 8 in git/cmd.pyDavid Aguilar
Keyword args shouldn't use spaces around the equals sign per PEP 8. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-01put version stuff back.Michael Trier
2008-05-31Git: guard against passing False to git commandsDavid Aguilar
git does not accept commands of the form: git cmd --xx=False or git cmd -xFalse This patch prevents transform_kwargs from producing command lines with those values. This adds some flexibility/syntactic sugar for callers since they can then assume that kwargs with a False value are not passed to git commands. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-06-01fixed ↵Florian Apolloner
http://gitorious.org/projects/git-python/repos/apollo13/comments#comment_105 my mistake ;) I'll investigate this further, but I think we are on the safe side now...
2008-06-01reverted to the cleaner and safer proc.wait method instead of communicate.Florian Apolloner
2008-05-31whoops forgot cmd.Michael Trier
2008-05-31renamed gitter to cmd since that makes more sense. Fixed up changes doc.Michael Trier
2008-05-30renamed git_python to git. Removed pop_key and replaced with dict.pop. Fixed ↵Michael Trier
up tests so they pass except for stderr test. Modified version information retrieval.
2008-05-29git.py: make git_dir an optional parameterDavid Aguilar
git_dir is now optional in the constructor for git.Git. Git now falls back to os.getcwd() when git_dir is not specified. Furthermore, extra checks were added so that the git_dir variable always points to the root of the worktree for non-bare repositories. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git_python: add utils.pop_key to __init__.pyDavid Aguilar
This keeps the interface consistent by importing utils.pop_key into the git_python namespace. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git.py: always strip trailing whitespace and add an option to not do soDavid Aguilar
We now strip off any trailing whitespace. We inhibit this behavior when git.foo( with_raw_output=True ) is called. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git.py: add support for merging stderr into stdoutDavid Aguilar
When git.foo( with_stderr=True ) is called, stderr is returned along with stdout in a merged stream. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git.py: add a with_exceptions keyword argumentDavid Aguilar
When git.foo( with_exceptions=True ) is called a GitCommandError is raised when the exit status is non-zero. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29errors: add a GitCommandError classDavid Aguilar
The next commit will raise GitCommandError when a flag is passed to method_missing and the exit status is non-zero. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git.py: add support for git.foo( with_status=True )David Aguilar
Passing with_status to an arbitrary git command causes execute to return (status_code, output) instead of the typical returned output. This is useful when callers need access to the exit status code. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git.py: add support for passing in a stdin input streamDavid Aguilar
execute/method_missing now support: fh = open('filename', 'r') print git.foo( istream=fh ) fh.close() The name "istream" was chosen so that it would not conflict with any of the builtin git flags. "stdin", for instance, is used by git. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29git.py: always use "git foo" and never "git-foo"David Aguilar
gitsters on the git mailing list have been slowly deprecating the usage of "git-foo" commands. The preferred invocation is "git foo". Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-29utils: add a pop_key helper functionDavid Aguilar
pop_key removes a value from a dictionary and it in one step. This function will be used in the next integration. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-28git.py: add support for a GIT_PYTHON_TRACE environment variableDavid Aguilar
GIT_PYTHON_TRACE allows us to debug GitPython's usage of git through the use of an environment variable. This is preferred over a hard-coded print statement. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-28git.py: properly handle single-character flags with argumentsDavid Aguilar
"git diff -U5" is correct while "git diff -U 5" is not. ditto for "git log -U5", "git commit -F/some/path", etc. The original version of transform_kwargs was setting up the command line arguments such that single-character flags with arguments were not understood by git. This changes transform_kwargs so that the flag and argument are both part of the same string for single-character flags. Signed-off-by: David Aguilar <davvid@gmail.com>
2008-05-26Merge git://gitorious.org/git-python/apollo13Michael Trier
2008-05-25Fixed up problem where name doesn't exist on root of tree.Michael Trier
2008-05-22removed stupid printFlorian Apolloner
2008-05-21fixed errors in the test, two permission errors remaining, thx to mock?!?!Florian Apolloner
Also removed the shell_escape tests...
2008-05-20removed some unused stuffFlorian Apolloner
2008-05-20made subprocess not use a shell...Florian Apolloner
2008-05-20removed some more spacesFlorian Apolloner
2008-05-20removed unneeded spacesFlorian Apolloner
2008-05-20Missing os import. Thanks apollo13.Michael Trier
2008-05-18lots of little fixes. Corrected problem with creating bare repo. Added ↵Michael Trier
Repo.create alias.
2008-05-17Corrected problem with tree.__len__ getting confused with zero length files. ↵Michael Trier
Thanks Alan Briolat.