Closed
Description
>>> import git
>>> repo = git.Repo("C:/Users/s2sajs/Documents/GitHub/Reactive.jl")
>>> fr = repo.remote().fetch("--dry-run")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\git\remote.py", line 657, in fetch
res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())
File "C:\Python27\lib\site-packages\git\remote.py", line 576, in _get_fetch_info_from_stderr
assert l_fil >= l_fhi, "len(%s) <= len(%s)" % (l_fil, l_fhi)
AssertionError: len(5) <= len(6)
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
Byron commentedon May 25, 2016
Which version of GitPython are you using ?
What is the remote that you are trying to pull ?
In case you are not using the latest version from pypi, please try again with that one.
Thanks
josefsachsconning commentedon May 25, 2016
I'm using GitPython-2.0.3. That's the latest, right?
Byron commentedon May 25, 2016
I was unable to reproduce it. Here is what I tried:
Does this work for you ? Maybe there is more to it, like the git version installed on the system.
josefsachsconning commentedon May 25, 2016
The behavior is dependent on the condition of the working copy. If I try the fetch in a freshly cloned working copy, it works just fine.
Byron commentedon May 25, 2016
This is what I get when running the command git-python runs from the terminal:
Could you run that on your end ?
josefsachsconning commentedon May 25, 2016
Byron commentedon May 25, 2016
I still can't reproduce it - even when manipulating my local repository to update the remote master:
Maybe it's related to the git version somehow, or to windows. In any case, what you could do is to have a look at the line that throws the assertion, and add some debug-printing yourself. That way you can find out which line it fails to handle correctly. I am not sure what else I can do here, unfortunately.
Personally I'd think it does not matter whether or not you use
--dry-run
either, as the output should be exactly the same.josefsachsconning commentedon May 25, 2016
Thanks for trying. In case it helps anyone,
fetch_info_lines
isand
fetch_head_info
isThat demonstrates that
l_fil < l_fhi
.The problem, apparently, is that
teh/throttle_typ
is infetch_head_info
but not infetch_info_lines
.Byron commentedon May 25, 2016
Indeed ! This assertion was the cause for many issues in the past, and so far there was no good fix for it. This is the comment at the respective line:
# NOTE: We assume to fetch at least enough progress lines to allow matching each fetch head line with it.
The problem is that I never understood why git would sometimes do that, or what the correct behaviour is. Should GitPython provide only partial information, or should it simply ignore the partial data ?
Currently it matches the lines one on one, maybe it's safe to just ignore extra lines in the fetch head info ... and get rid of this issue once and for all.
josefsachsconning commentedon May 25, 2016
Yes, my inclination would be to ignore extra lines in the fetch head info.
josefsachsconning commentedon May 25, 2016
Did you get that backwards? Don't you want to ignore extra lines in
fetch_head_info
, not extra lines infetch_info_lines
?Byron commentedon May 25, 2016
Thanks for the review ! I totally did - fix is on the way.
fix(remote): better array truncation logic