You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, if file name is "some (other).is txt" the string looks like: (α) some (other).is txt (<non-existent> -> File (d06a9ece2c6a5652a05f29db7f125749de2d4efa))
It is difficult to understand where file name ends when parsing this line automatically.
Solution: use character that is never used in status on the right side so that it can be found by parsing the line from the end (like rfind() in python): (α) some (other).is txt : <non-existent> -> File (d06a9ece2c6a5652a05f29db7f125749de2d4efa)
By the way, in MutagenMon I actually parse it by finding matching parenthesis to the last parenthesis in this string
The text was updated successfully, but these errors were encountered:
I can definitely see why this would be a pain to parse. These formats aren't really stable either. They don't really change at the moment, but there's no guaranteed stability, and given the need to improve various UI commands I'm pretty sure they'll change in the near future.
I think your approach of working backward makes the most sense. There are a limited number of formats that these conflicts can take, e.g. File(<SHA1>), Directory, etc. You could probably build regular expressions for these, but I can't guarantee they won't break. In fact, the conflict format has changed even between the time this issue was opened and now (in 26fc5f4).
The real answer to this is either stabilizing the daemon API (#38) or creating a "porcelain" (in the Git sense of the word) mode for commands (#57). So in that sense, I'll mark this as a duplicate of those issues for now, but it's definitely an important case study and motivating factor for those issues, since it's almost impossible to get this information via parsing.
I'm sorry there's not a better solution than painful parsing or waiting. I don't really have a precise ETA on #38 or #57, but realistically they're still probably months away. In the mean time, I can try to avoid breaking the conflict formatting, though I can't make any promises.
But as it stands, it should be possible to engineer regular expressions for the formatting using the formatEntryKind and printConflicts functions.
For example, if file name is "some (other).is txt" the string looks like:
(α) some (other).is txt (<non-existent> -> File (d06a9ece2c6a5652a05f29db7f125749de2d4efa))
It is difficult to understand where file name ends when parsing this line automatically.
Solution: use character that is never used in status on the right side so that it can be found by parsing the line from the end (like rfind() in python):
(α) some (other).is txt : <non-existent> -> File (d06a9ece2c6a5652a05f29db7f125749de2d4efa)
By the way, in MutagenMon I actually parse it by finding matching parenthesis to the last parenthesis in this string
The text was updated successfully, but these errors were encountered: