Progress parsing by int3 · Pull Request #20 · gitpython-developers/GitPython
Repository navigation
Progress parsing - #20
Closed
int3 wants to merge 6 commits into gitpython-developers:master from int3:master
Closed
Progress parsing #20 int3 wants to merge 6 commits into gitpython-developers:master from int3:master
Conversation
int3 commented May 24, 2011
Copy link Copy Markdown
Contributor
These 3 commits do the following:
- Add the --progress flag, which is necessary to get git (as of version 1.7?) to print progress output when not connected to a tty.
- Add more output 'opcodes'.
- Parse the output of git-clone with the same code used for git-fetch. To achieve this I moved some of the methods originally in
class Remoteinto theutilmodule so that the git-clone code could use it as well. I'm not sure this is the best way to organize things; let me know if I should make changes.
Add --progress flag.
a0ca05e
Recent versions of git do not output progress without this flag when not connected to a tty.
Parse more git-fetch operation log codes.
1f8cb16
Byron commented May 24, 2011
Copy link Copy Markdown
Member
|
Your change looks good - and to get things done I would probably have ended up with a similar solution. Something I am wondering about is whether we should break support for git pre 1.7 which didn't yet have the --progress flag. Probably that wouldn't be such a good idea, and a prior check to repo.git.version() could help to fix this. Something I don't like about git.version() yet is that it would call a command every time and return a string that needs to be parsed manually. Instead the method could be implemented on the git command type itself to cache the result, and return parsed information, something like:
which could return a tuple with all version integers, like (1,7,3,2). What do you think ? |
Add progress tracking for git-clone.
f0f02bb
Add version-specific behavior.
6b655be
--progress is not a valid flag for earlier versions of git, so we check for the version before using it.
int3 commented May 24, 2011
Copy link Copy Markdown
Contributor
Author
|
I've tried implementing something like what you suggested. I'm not sure what version the Also, I don't have earlier versions on my system and it would be a pain to install them, so I haven't really tested whether the code works when I tried running Also fixed up some indentation in the previous commit (spaces -> tabs). |
Byron commented May 25, 2011
Copy link Copy Markdown
Member
|
The tests are supposed to run, except for two which will require a git-daemon to run (the error message would tell you what to do though). Besides I just noticed that its probably not a good idea to override git.version directly, as this breaks code for everyone who wanted to use the 'old' version as git.version(). Hence I suggest it to be renamed to Once you could verify the tests are still working, especially the push/pull tests which use the git-daemon, I will have a look and see which version introduced --progress, in order to set the version to compare to correctly. |
Rename version to version_info.
12c93f5
int3 commented May 25, 2011
Copy link Copy Markdown
Contributor
Author
|
Most of the errors are AttributeErrors saying that various objects have no attribute called |
Byron commented May 25, 2011
Copy link Copy Markdown
Member
|
Actually I have no idea. I know that the rorepo attribute is created on the base type for all test cases, and on my recent checkout of master it works without an issue. |
int3 commented May 25, 2011
Copy link Copy Markdown
Contributor
Author
|
Hmm. I switched to your version of nose but the problem remains.. just to make sure I am getting things right: to run the tests, I just need to run |
Byron commented May 25, 2011
Copy link Copy Markdown
Member
|
Yes, it will do from the root or from the git subdirectory. |
int3 commented May 25, 2011
Copy link Copy Markdown
Contributor
Author
|
Is it possible for the tests to be run on just your end? I really can't get it to work on my box. |
Byron commented May 25, 2011
Copy link Copy Markdown
Member
|
Ok, will do. I might not get to it too soon, as I am actually applying plenty of changes in another branch which will clearly collide with these changes here. Nonetheless I try to maintain master in the meanwhile, so lets see when I get to it. |
int3 commented May 25, 2011
Copy link Copy Markdown
Contributor
Author
|
Alright then. I've renamed version to version_info like you suggested. Sorry I couldn't help more! |
Fix up the renaming.
c296c6f
Byron
reviewed
Jun 7, 2011
View reviewed changes
Comment thread
git/cmd.py
Byron commented Jun 7, 2011
Copy link Copy Markdown
Member
|
I have implemented the contents of this pull request and pushed the changes to the new 0.3 branch. This is to indicate that GitPython 0.3 reached the end of its life and is in maintenance mode. A proper release of 0.3 will follow. Master now moved on to the latest stable development, which will be 0.4 one day. As master was reset, you will have to reset your local master as well. Thanks for your participation, |