Sublime Forum

Sublime Text/Sublime Merge Diff Marker Question

#1

Hello,
Thank you for helping me with my question.

I noticed after a I commit a file that the green diff marker stays green, but if I close the file and re-open it, that diff marker goes away.
I changed "git_diff_target" to "head" to see if that makes a difference, but the behavior stays the same.

I would think that after a commit that the green diff marker would go away since there is now parity between the file in Sublime Text and the newly committed file.

I am quite new to GIT, so I may not be understanding how diff is working. But as I understand ‘head’, it is the latest file in the commit history.

Thanks again for your help in understanding this issue.

0 Likes

#3

Here is the state after I close the file and re-open it.

0 Likes

#4

Here is the change I made to the settings file in Sublime Text.

0 Likes

#5

It should indeed go away after you commit, yes.

If you check the console (View > Show Console) do you see any errors or messages that might be related?

As a sanity check, are you sure that the file that you’re editing is definitely from the repo that’s open in Merge? (because the mini diff applies to non-git files as well, and in those cases it tracks changes until you close and re-open the file).

0 Likes

#6

OdatNurd,
Thanks for your help! Your videos are one of the reasons I am using Sublime Text/Merge. It is so cool that I am getting to dialog with you. I love what a small place the internet can be sometimes.

Below in the console output you can see that git is tracking my Ansible_Class dir.
As far as errors go, Sublime Text is unable to open Preferences.sublime-settings. That is the only error I see. When I go to /Users/sl/Library/Application Support/Sublime Text/Packages, there is not a Default dir, thus no Preferences.sublime-settings. Could this be the source of the issue?

By way of a sanity check I did the following and I got the same result as before with the green diff check not going away:

  1. Create diff_test.yml in Ansible_Class repo.

  2. Green diff marker appears for all lines of code: yes

  3. Save diff_test.yml

  4. Moved to Sublime Merge and found that diff_test.yml is unstaged.

  5. Staged, committed, & pushed diff_test.yml

  6. Green diff marker appears for all lines of code: yes

  7. Moved to github.com to verify that diff_test.yml is in ryan-mart1nez /Ansible_Class: yes

What are your thoughts for troubleshooting next steps?

startup, version: 4126 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/sublime_text
application: /Applications/Sublime Text.app
working dir: /
packages path: /Users/sl/Library/Application Support/Sublime Text/Packages
state path: /Users/sl/Library/Application Support/Sublime Text/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/sl/Library/Application Support/Sublime Text/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.367402
OpenGL Context Information:
  GL API Version: 4.1 INTEL-18.7.4
  GLSL Version: 4.10
  Vendor: Intel Inc.
  Renderer: Intel(R) HD Graphics 630
startup time: 0.562749
first paint time: 0.693177
environment variables loaded using: /bin/bash -l
git: located Sublime Merge installed at /Applications/Sublime Merge.app
git: using configuration from system git install
git: tracking working dir /Users/sl/Desktop/Ansible_Class
<**TRUNCATED RELOADING PLUGINS OUTPUT**>
plugins loaded
Package Control: No updated packages
Unable to open /Users/sl/Library/Application Support/Sublime Text/Packages/Default/Preferences.sublime-settings
reloading /Users/sl/Desktop/Ansible_Class/l2_5a.1.yml
Unable to open /Users/sl/Library/Application Support/Sublime Text/Packages/Default/Preferences.sublime-settings
0 Likes

#7

Diff markers not being removed after commit is a long standing bug. I was pretty sure a related bug report exists on https://github.com/sublimehq/sublime_text/issues but I can’t find it.

0 Likes

#8

No, that’s not an issue. The file is present, just not in that location. The actual file it’s loading is inside of Default.sublime-package (which is stored elsehwere) but it looks in Packages first, and the failure to find it there triggers it’s load from the appropriate location.

I’m curious if the issue mentioned by @deathaxe is MacOS specific; I use Text and Merge on Windows and Linux and I’ve never had a problem with Text noticing when something is committed (even when not using Merge) except in the case of a lack of inotify instances that stop it from being able to detect that files are changing.

1 Like

#9

I am on Windows only. This bug is one reason for me to still use GitGutter as it resets state of minidiff corretly after a commit. Minidiff stops updating occationally only. I guess it’s trieggered by “heavy” rebase operations running in the background or something like that.

0 Likes

#10

Ok. So it looks like for the time being, after a commit, I just need to close and re-open the file. After that the diff tracking looks to be working just fine.

I used Package Control to install GitGutter, but for some reason it does not see my install of Python Markdown or Pygments.

Pygments is in /usr/local/lib/python3.9/site-packages (2.12.0)
and
markdown is in /usr/local/lib/python3.9/site-packages (3.4.1)

Do you know how I can point GitGutter to these packages?
I found this, but it is for trouble-shooting path issues for linters. Would this work for GitGutter?
{
“paths”: {
“linux”: [],
“osx”: [
“~/.rbenv/shims”
],
“windows”: []
}
}

0 Likes

#11

Sublime Text plugins don’t use libraries from “other” python installations. Package Control should automatically install required libraries/dependencies once GitGutter has been installed. It may require a restart for them to be available.

If they are not automatically installed you can try to run Package Control: Satisfy Dependencies .

0 Likes

#12

I ranPackage Control: Satisfy Dependencies and got: Package Control: All dependencies have been satisfied

I then restarted Sublime Text and still:
When I go to GitGutter --> Support Info I see this:

0 Likes

#13

I, see! That’s ok. They are required and vendored by mdpopups only. Support info is out of date.

0 Likes

#14

Thanks for your help.
I know all I have to do is close and reopen the file for Sublime Merge’s GIT tracking to work after a commit. Not ideal, but not a big deal.

GitGutter is installed and having issues of its own tracking changes too, so I am going to uninstall it and just go with Sublime Merge.

I can come back to GitGutter in the future if I find I need some function it performs that I am lacking running stock.

0 Likes