darcs

Patch 259 make --no-test a default

Title make --no-test a default
Superseder Nosy List kowey, mornfall
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-06-02.19:12:22 by kowey, last changed 2011-05-10.19:38:05 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
make-test-default-more-explicit_.dpatch kowey, 2010-06-02.19:12:22 text/x-darcs-patch
unnamed kowey, 2010-06-02.19:12:22
See mailing list archives for discussion on individual patches.
Messages
msg11197 (view) Author: kowey Date: 2010-06-02.19:12:22
I was going to send one bundle to fix all of 
  http://wiki.darcs.net/DefaultSwitches
in time for Darcs 2.5 alpha 1, but maybe I should check first if the general
approach is sane

2 patches for repository http://darcs.net:

Wed Jun  2 18:09:12 BST 2010  Eric Kow <kowey@darcs.net>
  * Make test default more explicit.
  In the context of this patch, the following defaults apply
  
   record : test
   amend-record : test
   check : test
   otherwise : no-test
  
  The aim of this patch is to make the last default (otherwise : no-test)
  more explicit, by making it a forced choice from the Darcs.Repository level
  down by making it a forced choice.  The bigger picture is to move away from
  testing opts membership, which seems fragile.

Wed Jun  2 18:11:00 BST 2010  Eric Kow <kowey@darcs.net>
  * Make --no-test default for record, amend and check.
Attachments
msg11205 (view) Author: kowey Date: 2010-06-02.20:40:34
Make test default more explicit.
--------------------------------
> +data WantTest = WantTest | WantNoTest

It occurred to me on the walk home that here actually, it probably
doesn't make any sense to re-invent Bool.  It was a good idea in lots of
other cases because it avoided passing around a lot of meaningless
looking identical Bools, but since there's little risk of this
happening, it seems like the wantTest function should just return Bool.

> + case wantTest opts of
> +   WantNoTest -> return ()
> +   WantTest   -> withCurrentDirectory dir $

In any case, my more general point was that the default values of flags
should not be buried deep down in the Darcs.Repository level, but should
be closer to the surface so that (A) we can just flip a default without
worrying about breaking some obscure part of the code and (B) we always
know what the defaults are without having to dig through the code.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
msg11662 (view) Author: kowey Date: 2010-07-01.16:18:02
Reviewer: please cherry pick "make --no-test default for record, amend 
and check." and ignore the other patch in this bundle
msg11675 (view) Author: mornfall Date: 2010-07-02.14:20:51
Hi,

Eric Kow <bugs@darcs.net> writes:
> Reviewer: please cherry pick "make --no-test default for record, amend 
> and check." and ignore the other patch in this bundle
OK, applied, thanks. (Just the latter patch. I guess accepted is
reasonable in this case.)

Yours,
   Petr.
History
Date User Action Args
2010-06-02 19:12:22koweycreate
2010-06-02 19:13:06darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3704251f9d92baa3957fe04e5ed8088c279f8b50
2010-06-02 20:40:34koweysetmessages: + msg11205
2010-06-11 10:33:32koweysetstatus: needs-review -> followup-in-progress
2010-06-24 12:50:51koweysettitle: Make test default more explicit. (and 1 more) -> implement darcs 2.5 default switches
2010-07-01 13:57:40koweysetassignedto: kowey
2010-07-01 16:15:30koweysetstatus: followup-in-progress -> obsoleted
superseder: + default switches for Darcs 2.5
2010-07-01 16:18:02koweysetstatus: obsoleted -> needs-review
assignedto: kowey ->
superseder: - default switches for Darcs 2.5
messages: + msg11662
title: implement darcs 2.5 default switches -> make --no-test a default
2010-07-02 14:20:52mornfallsetstatus: needs-review -> accepted
nosy: + mornfall
messages: + msg11675
2011-05-10 19:38:05darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3704251f9d92baa3957fe04e5ed8088c279f8b50 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3704251f9d92baa3957fe04e5ed8088c279f8b50