Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Progress parsing#20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
int3 wants to merge6 commits intogitpython-developers:masterfromint3:master
Closed

Progress parsing#20

int3 wants to merge6 commits intogitpython-developers:masterfromint3:master

Conversation

@int3
Copy link
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 inclass Remote into theutil module 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.

int3 added2 commitsMay 23, 2011 17:55
Recent versions of git do not output progress without this flag when notconnected to a tty.
@Byron
Copy link
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:

def version(self):    res = get_git_version_output()    return parse_res_into_tuple()

which could return a tuple with all version integers, like (1,7,3,2).

What do you think ?

int3 added2 commitsMay 24, 2011 18:22
--progress is not a valid flag for earlier versions of git, so we checkfor the version before using it.
@int3
Copy link
ContributorAuthor

I've tried implementing something like what you suggested. I'm not sure what version the--progress flag was introduced in, though -- I just put down 1.7.0.0 as a guess.

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 whengit.version >= (1,7,0,0) returns False. In principle it should work, though...

I tried runningnosetests but I couldn't seem to get it to work (even without those commits I made.) I get like 96 errors and 1 failure. Are the tests supposed to be broken, or am I doing it wrong?

Also fixed up some indentation in the previous commit (spaces -> tabs).

@Byron
Copy link
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 toversion_info, which resembles sys.version_info.

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.

@int3
Copy link
ContributorAuthor

Most of the errors are AttributeErrors saying that various objects have no attribute calledrorepo. Any idea what might be the cause of that?

@Byron
Copy link
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.
rorepo is setup during the setUpAll classmethods if I remember correctly. If there would not be called, there was no rorepo. Maybe it is nose acting up ? I use nose version 0.10.4.

@int3
Copy link
ContributorAuthor

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 runnosetests from the root of the project directory tree, right?

@Byron
Copy link
Member

Yes, it will do from the root or from the git subdirectory.
You could run it with the--pdb flag, which will drop you into a debugger on the first error. This way you could investigate the type you have and maybe find out more.
The rorepo variable is assigned in git/test/lib/helper.py (search for "rorepo =") - probably nosetest doesn't call the initialization for some reason.

@int3
Copy link
ContributorAuthor

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
Copy link
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.
Thanks for your efforts !

@int3
Copy link
ContributorAuthor

Alright then. I've renamed version to version_info like you suggested. Sorry I couldn't help more!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think you forgot to convert the strings to integers.
The line should be something like

tuple(int(n) for n in version_numbers.split('.'))

@Byron
Copy link
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,
Sebastian

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@int3@Byron

[8]ページ先頭

©2009-2025 Movatter.jp