[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-workers] sortm -check (was: sortm's Default of all is Brain-Damaged
From: |
David Levine |
Subject: |
[Nmh-workers] sortm -check (was: sortm's Default of all is Brain-Damaged.) |
Date: |
Sat, 27 Oct 2012 12:18:15 -0500 |
Norm wrote:
> While people are thinking about sortm, here are some thoughts.
>
> Generally, mh avoided doing anything if a command found anything
> wrong anywhere. This is the extreme opposite to the de-facto UNIX
> standard, which is always to do whatever you can. There are some
> exceptions. In particular sortm will try to do its thing even if it
> encounters messages with no date field, or an unparseable date
> field. There are two good reasons for this, both most relevant to
> sorting lots of messages.
>
> First, having to check first would probably impact performance.
> Secondly, consider the plight of a user trying sort 15000 messages,
> who is told he can't sortm them until he deals with three bad
> messages.
>
> BUT, after sortm has done its thing, the errant message numbers it
> reports are no longer valid.
>
> This is what leads me to suggest two more options "-check" and
> "-nocheck", with -nocheck the default. With -check, sortm would do
> nothing if it encountered a problem.
Added. It actually does something with -check: it still
prints its warning for each such message.
I also removed this note under BUGS in the sortm man page:
If sortm encounters a message without a date-field, or if
the message has a date-field that sortm cannot parse,
then sortm attempts to keep the message in the same
relative position. This does not always work. For
instance, if the first message encountered lacks a date
which can be parsed, then it will usually be placed at
the end of the messages being sorted.
because it was incorrect. Since March of 1990, the code has
used the file modification times in those cases.
Here's the man page addition for -check/-nocheck:
sortm always issues a warning for each message that is
missing a "Date:" field, has a "Date:" field that cannot
be parsed, or has a format error in any header field.
With the -check switch, sortm inhibits all modifications
to the folder if there any such messages, and exits with
non-zero status. With the default of -nocheck, sortm
sorts messages with a missing or invalid "Date:" field
using their file modification times.
David
- [Nmh-workers] sortm -check (was: sortm's Default of all is Brain-Damaged.),
David Levine <=