on ubuntu 12.10 with sublime 2.01, when adding a new file, e.g., new.txt, to a folder that is part of a git repo, i am seeing this error output to my shell after every edit:
fatal: Path 'new.txt' does not exist in 'HEAD'
Right, because we are trying to get the diff for a file that isn't committed yet. GitGutter should still work but yeah it shouldn't blow up your console with errors.
It would be possible to check git for if the file exists first, but I don't want to have to run yet another external command for every operation. I think the best answer would be to just trap that error in a try-catch
gotcha. ok, well let me know if you need me to do any testing for this. i'm guessing i could patch git_gutter_handler.py somewhere?
SO it turns out I already put that inside a try catch see code
I just tried to reproduce your error myself and was unable.
What is the whole stack trace of the error?
sorry, how to i pull a stack trace for this?
fwiw, if i run sublime from within gnome (applications > programming), this error is never output to the sublime console. but if new.txt is already open in a tab when sublime is loading, this error appears in the console:
Traceback (most recent call last):
File "./sublime_plugin.py", line 195, in on_modified
File "./sublime_plugin.py", line 154, in run_timed_function
File "./sublime_plugin.py", line 194, in <lambda>
File "./git_gutter_events.py", line 14, in on_modified
File "./view_collection.py", line 19, in add
File "./git_gutter_handler.py", line 45, in reset
AttributeError: 'NoneType' object has no attribute 'run_command'
the original message:
only shows up in my terminal if i run sublime from that same terminal like:
$ subl &
Same here, Seconds after I ran touch yinwang0/13-03-07.1.md, it prints in my terminal:
➤➤ fatal: Path 'yinwang0/13-03-07.1.md' exists on disk, but not in 'HEAD'.
fatal: Path 'yinwang0/13-03-07.1.md' exists on disk, but not in 'HEAD'.
fatal: Path 'yinwang0/13-03-07.md' exists on disk, but not in 'HEAD'.
And it prints error every time I switching to that buffer by a click.
Seens nothing wrong in Sublime's console:
plugin init time: 3.08837
loading pointer bindings
found 1 files for base name Default.sublime-theme
pre session restore time: 6.68927
using gamma: 1 (err: 0)
startup cache, total files: 118 cache hits: 118
startup time: 6.98839 (package setup was not run)
loaded 1075 snippets
Package Control: Installing 3 upgrades
Package Control: Upgraded CoffeeScript to latest git commit
Reloading plugin /home/chen/.config/sublime-text-2/Packages/GitGutter/git_gutter.py
Reloading plugin /home/chen/.config/sublime-text-2/Packages/GitGutter/git_gutter_events.py
Reloading plugin /home/chen/.config/sublime-text-2/Packages/GitGutter/git_gutter_handler.py
Reloading plugin /home/chen/.config/sublime-text-2/Packages/GitGutter/git_helper.py
Reloading plugin /home/chen/.config/sublime-text-2/Packages/GitGutter/view_collection.py
found 9 files for base name Main.sublime-menu
Package Control: Upgraded GitGutter to v2013.03.06.09.17.02
Package Control: Upgraded PlistJsonConverter to latest git commit
reloading /home/chen/.config/sublime-text-2/Packages/User/Package Control.sublime-settings
Writing file /home/chen/code/page-site/_self/styl/global.styl with encoding UTF-8
Writing file /home/chen/code/backup/yinwang0/13-03-03.3.md with encoding UTF-8