Skip to content

git log -L rejected despite being correct #273

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gausie opened this issue Mar 23, 2015 · 8 comments
Closed

git log -L rejected despite being correct #273

gausie opened this issue Mar 23, 2015 · 8 comments

Comments

@gausie
Copy link

gausie commented Mar 23, 2015

GitPython seems to not understand the form git log -L start,end:file where start is a regex.

@Byron
Copy link
Member

Byron commented Mar 24, 2015

Will you please tell me what code you execute to get to which error, exactly ? Also which version of GitPython are you using, and on which platform ?
Please remember that I will have to reproduce an issue to have a chance to fix it, which in turn is in your interest.

Thanks

@gausie
Copy link
Author

gausie commented Mar 24, 2015

This is the bit of code I'm executing

command = '-L "^/function before/",+5:' + filepath

return repo.git.log(command)

I am using v0.3.6 on Linux.

@Byron
Copy link
Member

Byron commented Mar 24, 2015

I think what you should try to do is to pass each argument as a single string. GitPython executes git without a surrounding shell, so for git your command would look like "a very long single argument", even though it is in fact multiple ones.
Please close this issue if it works for you.

@gausie
Copy link
Author

gausie commented Mar 24, 2015

Well it is one long single argument

It's just git log -L <argument to -L>

@Byron
Copy link
Member

Byron commented Mar 25, 2015

What about this:

repo.git.log('-L', '"^/function before/",+5:' + filepath)

@gausie
Copy link
Author

gausie commented Mar 25, 2015

Unfortunately I still get the same error.

@Byron
Copy link
Member

Byron commented Mar 25, 2015

An error you never posted here despite me asking for it. I'd like to see the full stack trace.

@Byron
Copy link
Member

Byron commented Mar 26, 2015

I have just had a look at it again, and realized that I am totally out of ideas here. As there is absolutely no evidence that this is related to GitPython at all, you are just using the git command wrapper, I am closing this issue.
You may find asking a question on StackOverflow (using the GitPython tag) more helpful - also I recommend to be prepared to post more information right off the bat, including the note that says it is 'rejected'.

@Byron Byron closed this as completed Mar 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants