Is there a way to get more specific information about "Updates Found" / external changes notice?



  • I use a few methods of backup while I design type, including Git, Dropbox, and an external hard drive. Sometimes, changes in these systems result in an "Updates Found" message. In the past, this also came from using separate tools like Prepolator and Metrics Machine (this might be different now that these are extensions – I haven't used them yet).

    Often, it's pretty obvious what change has been found – usually, it's because I've reverted a commit in Git. Sometimes, however, it's not very clear, and I'm just trying to better understand what changes I'm about to accept or reject.

    It appears that at least some of the glif files are marked as myUserName.local's conflicted copy 2018-03-28, and I think this name is probably coming from Robofont. Its timestamp is newer than the other similar glif file. I'm guessing this is the new file that Robofont sees the update in but is that correct?

    If there's any documentation or info around this, I'd be curious to read it. 🙂 If there's not yet, are there any tips you would give when assessing this message when it's unclear? I may try to make a visual versioning tool at some point, so this would be a handy thing to better understand. Thanks!

    0_1522230872880_d2c63c36-cc03-4532-a009-97d961857bd1-image.png



  • I've realized that the most likely issue giving files myUserName.local's conflicted copy 2018-03-28 is dropbox syncing different time-stamped versions on my computer. This doesn't usually happen, but I had to revert to a backup on a disk, and this must have clashed with certain files on the Dropbox servers.

    I don't think that syncing is what caused this unexpected update, however, so I still wonder if there's a good way to get more information above these types of clashes.


  • admin

    you can try using difflib to compare two versions of a .glif (or any other text file):

    0_1522347605310_Screen Shot 2018-03-28 at 11.14.22.png

    import difflib
    
    glif1 = 'test1.ufo/glyphs/a.glif'
    glif2 = 'test2.ufo/glyphs/a.glif'
    
    with open(glif1, 'r') as f:
        str1 = f.readlines()
    
    with open(glif2, 'r') as f:
        str2 = f.readlines()
    
    # plain-text diff
    
    diff = difflib.ndiff(str1, str2) # difflib.unified_diff(str1, str2, lineterm='')
    print(''.join(list(diff)))
    
    # html diff
    
    import os
    htmlPath = os.path.join(os.getcwd(), 'glifdiff.html')
    
    D = difflib.HtmlDiff()
    html = D.make_file(str1, str2)
    
    with open(htmlPath, 'w') as f:
        f.write(html)
    
    from mojo.UI import HelpWindow
    HelpWindow(htmlPath)
    

    hope this helps!



  • Wow, thank you for this in-depth and helpful reply, @gferreira! I'll give it a try next time this notice pops up for me, then try to post the results here.


  • admin

    there is even a notification for this fontDidChangeExternally. Subscribe and combine with @gferreira's example and you have a killer extension!

    see Custom observers: fontDidChangeExternally


Log in to reply
 

Looks like your connection to RoboFont ● Forum was lost, please wait while we try to reconnect.