darcs

Patch 1075 resolve issue2320: save prompted author name in ~/.dar...

Title resolve issue2320: save prompted author name in ~/.dar...
Superseder Nosy List jlneder
Related Issues
Status accepted Assigned To
Milestone

Created on 2013-06-15.05:13:08 by jlneder, last changed 2013-06-16.16:49:12 by gh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt jlneder, 2013-06-15.05:13:07 text/x-darcs-patch
patch-preview.txt jlneder, 2013-06-15.20:26:20 text/x-darcs-patch
patch-preview.txt jlneder, 2013-06-16.02:41:15 text/x-darcs-patch
patch-preview.txt gh, 2013-06-16.16:48:06 text/x-darcs-patch
remove-word-repetition-in-filehelpauthor-string.dpatch gh, 2013-06-16.16:48:06 application/x-darcs-patch
resolve-issue2320_-save-prompted-author-name-in-___darcs_author-instead-of-___darcs_prefs_author.dpatch jlneder, 2013-06-15.05:13:07 application/x-darcs-patch
resolve-issue2320_-save-prompted-author-name-in-___darcs_author-instead-of-___darcs_prefs_author.dpatch jlneder, 2013-06-15.20:26:20 application/x-darcs-patch
resolve-issue2320_-save-prompted-author-name-in-___darcs_author-instead-of-___darcs_prefs_author.dpatch jlneder, 2013-06-16.02:41:16 application/x-darcs-patch
unnamed jlneder, 2013-06-15.05:13:07
unnamed jlneder, 2013-06-15.20:26:20
unnamed jlneder, 2013-06-16.02:41:16
unnamed gh, 2013-06-16.16:48:06
See mailing list archives for discussion on individual patches.
Messages
msg16853 (view) Author: jlneder Date: 2013-06-15.05:13:07
1 patch for repository http://darcs.net/screened:

Sat Jun 15 02:02:56 ART 2013  Jose Luis Neder <jlneder@gmail.com>
  * resolve issue2320: save prompted author name in ~/.darcs/author instead of ./_darcs/prefs/author
  It seems unclear to me what to do when "~" isn't found. Perhaps it should
  fail but i'm not sure what to do.
Attachments
msg16854 (view) Author: gh Date: 2013-06-15.18:18:42
Your patch makes sense, I have comments about some changes:

-import Control.Applicative( (<$>) )
+import Control.Applicative ( (<$>) )

which you can remove from the patch using "darcs amend --unrecord". And:

hunk ./src/Darcs/UI/Arguments.hs 946
-          writeLocaleFile (darcsdir ++ "/prefs/author") $
+          prefsdir <- globalPrefsDir
+          writeLocaleFile (fromMaybe "~" prefsdir </> "author") $

in which the use 'fromMaybe "~"' is incorrect since it would create the
file "~/author" in the case when globalPrefsDir returns Nothing.

As for what to do when globalPrefsDir returns Nothing (an unlikely
situation but we should foresee it in the code), I'm thinking of two
alternatives:

a) make darcs fail
b) make darcs save author in _darcs/prefs/author (as before).

I think b) would be the best, with a warning message when it happens
(look for WARNING: in the source code).
msg16856 (view) Author: jlneder Date: 2013-06-15.20:26:20
1 patch for repository http://darcs.net/screened:

Sat Jun 15 17:21:39 ART 2013  Jose Luis Neder <jlneder@gmail.com>
  * resolve issue2320: save prompted author name in ~/.darcs/author instead of ./_darcs/prefs/author
  I made the changes you suggested. I think is much better now. Thanks.
Attachments
msg16857 (view) Author: gh Date: 2013-06-15.20:59:48
Good. Last suggestions:

+                    putStrLn $ "WARNING: $HOME environment variable not
set."

Under Windows this message would not make sense. Following the
vocabulary used in the comment of the globalPrefsDir function, this
would rather be: "WARNING: Global preference directory could not be
found." Also the $ is unnecessary.

And there is a double "if" there:

+ "string and write it to `" ++ globalPrefsDirDoc ++ "author`.  Note
that if if you have more",
msg16859 (view) Author: jlneder Date: 2013-06-16.02:41:16
1 patch for repository http://darcs.net/screened:

Sat Jun 15 23:39:04 ART 2013  Jose Luis Neder <jlneder@gmail.com>
  * resolve issue2320: save prompted author name in ~/.darcs/author instead of ./_darcs/prefs/author
  fixed.
Attachments
msg16860 (view) Author: gh Date: 2013-06-16.16:44:49
Good to go. I'm sending a patch that fixes a weird repetition in the
help string written to ~/.darcs/author.
msg16861 (view) Author: gh Date: 2013-06-16.16:48:06
Will self-accept as trivial patch (http://darcs.net/Development/PatchReview).

1 patch for repository http://darcs.net:

Sun Jun 16 13:41:12 ART 2013  Guillaume Hoffmann <guillaumh@gmail.com>
  * remove word repetition in fileHelpAuthor string
Attachments
History
Date User Action Args
2013-06-15 05:13:08jlnedercreate
2013-06-15 18:18:42ghsetmessages: + msg16854
2013-06-15 20:26:20jlnedersetfiles: + patch-preview.txt, resolve-issue2320_-save-prompted-author-name-in-___darcs_author-instead-of-___darcs_prefs_author.dpatch, unnamed
messages: + msg16856
2013-06-15 20:59:48ghsetmessages: + msg16857
2013-06-16 02:41:16jlnedersetfiles: + patch-preview.txt, resolve-issue2320_-save-prompted-author-name-in-___darcs_author-instead-of-___darcs_prefs_author.dpatch, unnamed
messages: + msg16859
2013-06-16 16:44:49ghsetstatus: needs-screening -> needs-review
messages: + msg16860
2013-06-16 16:48:07ghsetfiles: + patch-preview.txt, remove-word-repetition-in-filehelpauthor-string.dpatch, unnamed
messages: + msg16861
2013-06-16 16:49:12ghsetstatus: needs-review -> accepted