Git branches and spurious "has changes" prompt


#1

When I want to close Atom (system reboot, stop working on a certain project, etc.) I’m often prompted several times about files that “have changes”.

Now: the weird thing is that the file doesn’t have any blue dot to notify of changes, and in fact I haven’t done any change to it, compared to what WAS on disk. The problem is that I simply switched over to another feature branch in which this file doesn’t exist, and thus there’s indeed a change, a difference compare to disk: the whole file

Since I always want to check if this message is spurious (that is: the file belongs to another branch, has been committed and thus I can disregard it) or instead if the file truly needs to be saved, this takes me quite a while. Also: often Atom restores these non-existing files when I reopen the editor, and to avoid being prompted again, I manually go over every file for which Atom complains, and I close their tab before closing the whole window again.

So: an obvious solution might be to remember to always close all tabs (or “Close other tabs” except the last one I’m working on) every time that I wan to switch branches.

But is there something more user friendly? a package that take care of this? a github Issue that is keeping track of this defect (a resolution might be to just close the tabs on behalf of the user when Atom knows that there was no change in the previous branch, and now the file disappeared… after all, it already closes the tab when a file is moved/deleted )?

Thanks


#2

I believe that you’re running into this Issue:

I haven’t made the time to fully investigate this yet though. I’m not convinced that this isn’t just a case of Atom being careful to not throw away work you may have done.


#3

Uhm, yes it’s similar… I don’t get the problem that he describes at the end:

when I come back to “branch_a” saw that “file_a” content lost!

But surely someone else has also noticed this issue? It’s not new, and it should affect EVERY single Atom users that uses git.


#4

I use Git for all my work and have yet to run into this issue. Though it sounds like I don’t switch branches as much as some people. Most of the time I create branches, work on them for some period of time and then merge them back into master or submit them for Pull Requests.