jisaacks / GitGutter

A Sublime Text 2/3 plugin to see git diff in gutter
MIT License
3.88k stars 225 forks source link

GitGutter "fails to update" after first file load / restart #536

Open stdedos opened 5 years ago

stdedos commented 5 years ago

Description

Replication (for me) is quite simple:

Results:

Adding / removing it from Disabled Packages works, but I restart in-between. I don't think the "acceptable" solution to be to restart every time I edit one file.

Support Info

- Sublime Text 3176
- Platform: linux
- Arch: x64
- GitGutter 1.9.5
- Install via PC: True
- git version 2.20.1
- mdpopups 3.4.0
- markdown 2.6.11
- pygments 2.1a0
- jinja2 2.8
deathaxe commented 5 years ago

Can't reproduce. Works well on my Ubuntu 18.04 VM.

stdedos commented 5 years ago

I don't doubt that @deathaxe. I would appreciate some more debuging instructions though, since I have already read Troubleshooting, and nothing came up.

deathaxe commented 5 years ago

Did you try to set "debug: true" in GitGutter.sublime-settings?

With some luck it may provide some more infos about the reason.

Is the string from the "Results:" part (Gutter output "does not match" git diff) from console?

What distro are u using?

stdedos commented 5 years ago

Did you try to set "debug: true" in GitGutter.sublime-settings? With some luck it may provide some more infos about the reason.

I did:

{
  // Add a special marker on untracked files
  "show_markers_on_untracked_file": true,

  // Determines whether GitGutter will show informations in the status bar
  // Set "none" to hide these informations
  // Set "default" to show in the status bar what you are comparing
  // against, how many lines have been inserted or modified and how many regions
  // have been deleted.
  // Set "all" to also show on what branch you are
  "show_status": "all",
  "debug": true
}

Unfortunately, it only gives

reloading plugin GitGutter.plugin
GitGutter: disabled for "untitled" because file not in a working tree
GitGutter: disabled for "test.log" because file not in a working tree
// here I closed and reopened a file under a repo
GitGutter: disabled for "untitled" because file not in a working tree

Is the string from the "Results:" part (Gutter output "does not match" git diff) from console?

No. it's just me saying that: git diff != GitGutter "gutter" marks

What distro are u using?

Ooops! :smile: Ubuntu 16.04.5

stdedos commented 5 years ago

The repository is a big one, if that helps ... but I cannot thing of something else causing this :confused:

deathaxe commented 5 years ago

The only thing I can see from your logs is an unsaved view and a "test.log" to be open, which is not within the repository. GitGutter itself does not create a message which matches the git diff != GitGutter "gutter" marks style.

I absolutely can't find any entry point to start debugging. Whatever I try it works fine here on both, Windows and Linux.

stdedos commented 5 years ago

The only thing I can see from your logs is an unsaved view and a "test.log" to be open, which is not within the repository.

I know! In GitGutter's debug, there is ABSOLUTELY no mentioning of me opening a git-tracked file:

reloading plugin GitGutter.plugin
GitGutter: disabled for "untitled" because file not in a working tree
GitGutter: disabled for "test.log" because file not in a working tree
GitGutter: disabled for "untitled" because file not in a working tree

In the mockup I created with the debug messages, I would expect, instead of this:

// here I closed and reopened a file under a repo

It would have much more entries, like:

GitGutter: opened "x": file is tracked in git, processing ...
GitGutter: [...]
GitGutter: [...]
GitGutter: [...]
GitGutter: [...]
GitGutter: processing done for "x"

or something! However, greping the console output (with grep -i gitgutter), gives a very small amount of lines == the aforementioned ones


GitGutter itself does not create a message which matches the git diff != GitGutter "gutter" marks style.

I know! I am trying to explain what the issue is, in some way! GitGutter gives no messages, about "nothing" related on processing git-tracked files, so, I am trying to describe it to the best of my English and understanding, what is happening: The file state that GitGutter is advertising the file to be, is not consistent with whatever git diff would say.

I absolutely can't find any entry point to start debugging. Whatever I try it works fine here on both, Windows and Linux.

I know! I would search the source code myself for the error messages (or even try to debug / put breakpoints in it myself), but I have no idea "where" GitGutter gets stucked, if it throws exceptions ... nothing. And neither do I know how the development/debugging process of Sublime extensions, so I cannot do what I would normally do to debug source code (like pudb git_gutter.py or something).