// Sort keys longest-to-shortest so that we always replace the
// largest part of the path if there are nested workspace folders.
..sort((a, b) => b.length.compareTo(a.length)))I did this assuming what's written in the commit message is correct (and we're trying to remove all workspace folder paths). However if this isn't the case (and we're really just trying to replace things like usernames that are above the root-most path), then another option would be to not add paths to the replacements if there is already a _parent_ path in the collection.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Sort keys longest-to-shortest so that we always replace the
// largest part of the path if there are nested workspace folders.
..sort((a, b) => b.length.compareTo(a.length)))I did this assuming what's written in the commit message is correct (and we're trying to remove all workspace folder paths). However if this isn't the case (and we're really just trying to replace things like usernames that are above the root-most path), then another option would be to not add paths to the replacements if there is already a _parent_ path in the collection.
IIRC, the goal has more to do with being able to play back a session on a different machine where the paths to the roots might be different.
If that's true, then either solution would solve the problem, but replacing only the root-most path might preserve more information in the log for human readers.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Sort keys longest-to-shortest so that we always replace the
// largest part of the path if there are nested workspace folders.
..sort((a, b) => b.length.compareTo(a.length)))Brian WilkersonI did this assuming what's written in the commit message is correct (and we're trying to remove all workspace folder paths). However if this isn't the case (and we're really just trying to replace things like usernames that are above the root-most path), then another option would be to not add paths to the replacements if there is already a _parent_ path in the collection.
IIRC, the goal has more to do with being able to play back a session on a different machine where the paths to the roots might be different.
If that's true, then either solution would solve the problem, but replacing only the root-most path might preserve more information in the log for human readers.
If that's true, then either solution would solve the problem, but replacing only the root-most path might preserve more information in the log for human readers.
It would also be slightly faster because the regex would have fewer paths in it.
Shall I change this, or wait for Keerti's input? (it's not clear to me how certain you are/aren't 😄)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Sort keys longest-to-shortest so that we always replace the
// largest part of the path if there are nested workspace folders.
..sort((a, b) => b.length.compareTo(a.length)))Brian WilkersonI did this assuming what's written in the commit message is correct (and we're trying to remove all workspace folder paths). However if this isn't the case (and we're really just trying to replace things like usernames that are above the root-most path), then another option would be to not add paths to the replacements if there is already a _parent_ path in the collection.
Danny TuppenyIIRC, the goal has more to do with being able to play back a session on a different machine where the paths to the roots might be different.
If that's true, then either solution would solve the problem, but replacing only the root-most path might preserve more information in the log for human readers.
If that's true, then either solution would solve the problem, but replacing only the root-most path might preserve more information in the log for human readers.
It would also be slightly faster because the regex would have fewer paths in it.
Shall I change this, or wait for Keerti's input? (it's not clear to me how certain you are/aren't 😄)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |