Dyalog / link

Source code for Link – the built-in component that enables the use of text files as the primary storage mechanism for APL source code
https://dyalog.github.io/link
MIT License
19 stars 12 forks source link

Git operations like branch switch or reverts can cause mismatch between folder and file contents #677

Open aplteam opened 1 month ago

aplteam commented 1 month ago

When I delete a file on disk I expect Link to delete the associated APL object from the workspace, but that is not the case.

For example, if somebody believes the Link documentation, then she might think that switching git branches (while having a folder Linked) might be a safe thing to do, because Link would reflect all changes, then she be wrong because of this bug.

Dyalog  19.0.50061 64-bit Unicode, BuildID 87528164 
 OS      Windows 11 (10.0.22631) 64-bit              
 Link    4.0.17                                      
 SALT    2.915                                       
 UCMD    2.6                                         
 .NET    .NET Framework 4.8.9261.0                   
 WS      19.0                                        

(This my <02215>)

mkromberg commented 1 month ago

In general, I don't think the first statement is true: If you delete a file, that typically does remove the object from the workspace. If you have an example of that failing, please log a separate issue.

However, Git (or other tool) operations which both delete and create the same file name in quick succession can cause problems.

PR #650 contains code which is close to fixing this, I need to find the time to integrate it with Link 4.0.

aplteam commented 1 month ago

I deleted a file in the Windows File Explorer, and Link did not reflect that.

But it happened only once: when I tried to reproduce it, it always worked. Feel free to close this.

The branch switch occurred to me as an example of why one might run into this because deleting is something I would do in APL anyway.