Jump to content

Pending changes does not ignore EOLs


lukeb

Recommended Posts

Using plastic 5.4.16.651 with these options set in preferences:

 

  • Diff and merge -> Comparison method : Ignore EOLs
  • Other options -> Behavior when trying to switch / update the workspace with changed items: Do not allow, show an error
  • Other options -> Compare file contents instead of timestamps when determining "Changed" status : ticked

 

The intent here is that we don't want anyone accidentally switching the workspace with pending changes but we don't consider differences simply in end-of-line characters to be actual changes.  This is because the environment we work in can modify EOL characters at random and we have no control over this.

 

However, it appears that the 'Ignore EOLs' option only affects Diffing, not Pending changes.  This means that we are frequently prevented from switching workspace because of pending changes that are simply down to EOL differences.

 

Going to the pending changes view shows a list of files with 'changed' in the status column but when the the 'show diffs' panel is enabled it says 'Files are identical'.  We then have to 'undo' all these changes before being allowed to switch workspace.  This slows down our development process and is likely to lead to someone accidentally 'undo'ing a genuine change amongst the noise caused by the false EOL changes.

 

Is this expected behaviour and, if so,  is there some way of getting the Pending changes view to ignore EOLs when deciding whether or not a file has changed?

Link to comment
Share on other sites

Hi!

 

well, that is the desired behavior but I understand your problem.

 

The "Behavior when trying to switch / update the workspace with changed items: Do not allow, show an error" preference and the status command (the one behind the pending changes view) is only aware of:

1) If the file has the same timestamp.

2) If the file has the same hash.

 

So we are missing the one you desire:

3) If the file has the same content ignoring EOLs.

 

It's doable although the performance would be affected since you need to run a diff operation for each item that seems to be changed.

 

I invite you to to add this idea inside our public user voice page: https://plasticscm.uservoice.com/forums/15467-general so other users can help you to vote it and get it implemented.

 

If you don't mind scripting a little bit you can create your own undounchanged command that can do the following:

1) Run an "status" command and get the items changed.

2) for each of the changed items run a command line diff operation to check in the file is really changed or not.

3) For those items that are not changed run a "cm unco" command to reset them.

 

Doing that you will automatically reset all the "unchanged" items in your workspace.

Link to comment
Share on other sites

I've tried writing a script but  I was assuming that there would be a way of getting mergetool to do the diff with the '--ignore eol' option and return a result indicating whether or not any diffs were found without displaying the UI.  However, I can't seem to get this working as the '--silent'  and '--automatic' options appear to do nothing (and the help suggests they are only available for merging).

 

When you talked about running a command line diff operation were you thinking of mergetool and if so is there some way of getting it to run without the UI?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...