-
Notifications
You must be signed in to change notification settings - Fork 223
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
Compare against branch indicates no changes and differs from "git diff <branch>" #568
Comments
Temporary files are created using python's |
Also note, GitGutter just calls |
It was not related to the temporary files. After a few hours of debugging through print statements I found the culprit to be the encoding. The branch I was comparing with had a swedish comment and the character 0xC5 ('Å'). Fixing that and the comparison works as expected. An error printed to the console would be helpful here, or possible a message in the statusbar? def _decode_diff(self, results):
encoding = self.view_cache.python_friendly_encoding()
try:
decoded_results = results.decode(encoding)
except AttributeError as e:
# git returned None on stdout
decoded_results = ''
except UnicodeError:
try:
decoded_results = results.decode('utf-8')
except UnicodeDecodeError as e:
print("unicode: {}".format(str(e))) # Get here
decoded_results = ''
except LookupError:
try:
decoded_results = codecs.decode(results)
except UnicodeDecodeError as e:
decoded_results = ''
print("Decoded '{}' for view '{}'".format(decoded_results,self.view.file_name()))
# cache the diff result for reuse with diff_popup.
self._git_diff_cache = decoded_results
return self.process_diff(decoded_results) |
Yeah, I have this issue too. Do the devs have the time/energy/will to fix this bug by any chance? |
Changing branch to compare against gives me no changes compared to git diff . After adding some debug printouts to git_gutter it seems like the temporary files it creates for comparison relates to a completely different project (I have several sublime projects open in parallel). Any ideas?
The text was updated successfully, but these errors were encountered: