darcs

Patch 25 Rewrite $DARCS_EMAIL documentation.

Title Rewrite $DARCS_EMAIL documentation.
Superseder Nosy List darcs-users, kowey, twb
Related Issues
Status accepted Assigned To kowey
Milestone

Created on 2009-10-31.12:30:41 by twb, last changed 2009-10-31.20:54:33 by kowey.

Files
File name Status Uploaded Type Edit Remove
rewrite-_darcs_email-documentation_.dpatch twb, 2009-10-31.12:30:40 text/x-darcs-patch
unnamed twb, 2009-10-31.12:30:40 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg9109 (view) Author: twb Date: 2009-10-31.12:30:40
IIRC someone asked if adding comments to _darcs/prefs/email will break
it.  I thought I checked this back when I wrote this patch, but the
reviewer should double-check this.

Sun Sep 20 23:14:02 EST 2009  Trent W. Buck <trentbuck@gmail.com>
  * Rewrite $DARCS_EMAIL documentation.
Attachments
msg9143 (view) Author: kowey Date: 2009-10-31.20:54:30
On Sat, Oct 31, 2009 at 12:30:41 +0000, Trent W. Buck wrote:
> IIRC someone asked if adding comments to _darcs/prefs/email will break
> it.  I thought I checked this back when I wrote this patch, but the
> reviewer should double-check this.
> 
> Sun Sep 20 23:14:02 EST 2009  Trent W. Buck <trentbuck@gmail.com>
>   * Rewrite $DARCS_EMAIL documentation.

Looks good.  In my first review, I was worrying that the "#" in the
prefs file would not work, but that was a silly worry.  Sorry for the
wasted time!

I'll be sending a stupid little patch to add some extra whitespace to
the author file between the long '#' comments and the author name.
I guess that's trivial, but I had a moment of doubt since I needed all
this explanation :-)

Rewrite $DARCS_EMAIL documentation.
-----------------------------------
> +fileHelpAuthor :: [String]
> +fileHelpAuthor = [
> + "Each patch is attributed to its author, usually by email address (for",
> + "example, `Fred Bloggs <fred@example.net>').  Darcs looks in several",
> + "places for this author string: the --author option, the files",
> + "_darcs/prefs/author (in the repository) and ~/.darcs/author (in your",
> + "home directory), and the environment variables $DARCS_EMAIL and",
> + "$EMAIL.  If none of those exist, Darcs will prompt you for an author",
> + "string and write it to _darcs/prefs/author."]

>            add <- askUser "What is your email address? "
> -          writeFile (darcsdir++"/prefs/author") add
> +          writeFile (darcsdir ++ "/prefs/author") $
> +                    unlines ["# " ++ line | line <- fileHelpAuthor] ++ add

This tacks on the help text as a comment below the author pref file.
I guess that's useful enough.

I've checked the implementation of get_preffile and indeed, we do ignore
the comment lines (it's the same code for dealing the boring file).

I've also done a quick little test on an example repo to make sure it
works.

> hunk ./src/Darcs/Commands/Help.lhs 109
>  -- | Help on each environment variable in which Darcs is interested.
>  environmentHelp :: [([String], [String])]
>  environmentHelp = [
> hunk ./src/Darcs/Commands/Help.lhs 121
>   environmentHelpPager,
>   environmentHelpTmpdir,
>   environmentHelpKeepTmpdir,
> + environmentHelpEmail,

Also added to darcs help environment. 

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
History
Date User Action Args
2009-10-31 12:30:41twbcreate
2009-10-31 19:08:06koweysetassignedto: kowey
nosy: + kowey
2009-10-31 20:54:33koweysetstatus: needs-review -> accepted
nosy: + darcs-users
messages: + msg9143