Issue 2662 --ignore-times not supported by all commands

Title --ignore-times not supported by all commands
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List bfrk
Assigned To

Created on 2020-10-25.07:16:58 by bfrk, last changed 2022-04-12.13:26:07 by bfrk.

msg22501 (view) Author: bfrk Date: 2020-10-25.07:16:53
This is problematic when using darcs in scripts, as we do in our test 
suite. For instance, a test i wanted to write for the rollback command gave 
me strange warnings like

Warning: replace patch to f couldn't apply.
Warning: ### Error applying:
hunk ./f 2
### to file f:
### Reason: Hunk wants to remove content that isn't there

but when I tested the command manually I got a warning about conflicts with 
unrecorded changes.

Investigating revealed that considerMergeToWorking failed to report a 
conflict because it uses the index and thought that there are no unrecorded 
changes. It then returned prims that cannot be applied to the actual 
working state.

The short-term solution is be to make useIndex a standard option i.e. one 
that is automatically supported for all commands. This solves the problem 
for our test suite.

This doesn't solve the problem when using darcs in third-party scripts 
unless they remember to pass --ignore-times to all commands. It works for 
us only because we also set HOME, so we can freely change the defaults. So 
I think we should also add a new environment variable DARCS_IGNORE_TIMES 
which can be used to change the default behavior.

The long-term solution is to use high resolution timestamps for the index 
and also change the index API to not require write access when we only need 
the index for reading. This would eliminate the need for the --ignore-times 
option, at least on file systems that support high resolution timestamps.
msg22969 (view) Author: bfrk Date: 2022-04-12.13:26:07
resolved by

patch 973faa6b3113dbcd87fbff6a43d4814a965d61a2
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Oct 25 07:36:26 CET 2020
  * make --ignore-times a standard option supported by all commands
  This also fixes all places where we still passed the UseIndex 
  directly without considering the option value.
Date User Action Args
2020-10-25 07:16:58bfrkcreate
2022-04-12 13:26:07bfrksetstatus: unknown -> resolved
priority: bug
messages: + msg22969