Begin forwarded message:
From: textmate-request@lists.macromates.com Subject: textmate Digest, Vol 99, Issue 26 Date: August 22, 2016 at 2:33:55 AM PDT To: textmate@lists.macromates.com Reply-To: textmate@lists.macromates.com
From: "Allan Odgaard" mailinglist@textmate.org Subject: [TxMt] Re: textmate Digest, Vol 99, Issue 24 Date: August 21, 2016 at 11:16:00 PM PDT To: "TextMate users" textmate@lists.macromates.com Reply-To: TextMate users textmate@lists.macromates.com
On 22 Aug 2016, at 4:52, Jack Royal-Gordon wrote:
Just discovered another similar occurrence that may add some more data. It appears that when I switch GIT branches, which causes some files in my folder to be changed, TextMate is not reloading the changed files (as it did in Version 1). What I used to get in V1 was that if there were no changes pending on the file when I switched branches, TM would quietly load the new version of the file; if there were changes pending, it would ask if I want to save the current TM copy or overwrite it from the copy on disk. But it seems like it might not be doing this (or at least not doing this consistently) on V2.
Right, so your issue is limited to files with local changes which you then change on disk, correct?
In this case TextMate will actually try to merge your local changes with the new version on disk, and if it can do this without merge conflicts, it updates the file.
But if the merge has conflicts, TM currently does nothing (it logs an error to console). Prior to beta 12 it would update the file with the merge conflict markers, but I found this behavior undesirable because we effectively “mangle” the local changes.
I do however plan to introduce a visual warning for this edge case, but unfortunately there was not enough time to get this done for beta 12.
I now understand why it’s not behaving as I expected, and I think that explains all of my strange behavior, as I switch branches quite often and just assumed TM2 had the same behavior as TM1.
FWIW, when you get around to handling the merge conflict, I liked what TM1 did, where it presented you a dialog and let you select between the on-disk version and the in-memory version. I think it would be even better if it gave you the third option of providing the merged version with the merge conflict markers.
At any rate, thanks for supporting TM; it’s miles better than any other text editor I’ve used.
On 22 Aug 2016, at 18:50, Jack Royal-Gordon wrote:
Right, so your issue is limited to files with local changes which you then change on disk, correct?
In this case TextMate will actually try to merge your local changes with the new version on disk, and if it can do this without merge conflicts, it updates the file.
But if the merge has conflicts, TM currently does nothing (it logs an error to console). Prior to beta 12 it would update the file with the merge conflict markers, but I found this behavior undesirable because we effectively “mangle” the local changes.
Turns out I was wrong here, I thought I had disabled this, but I did not.
So if the file is changed on disk, TextMate should **always** do something about it.
For unmodified document: Reload changes.
For modified document: Merge changes, potentially inserting markers for merge conflicts.