darcs

Patch 1520 resolve issue2512: author name is written to repository after multiple-choice prompt

Title resolve issue2512: author name is written to repository after multiple-choice prompt
Superseder Nosy List sap
Related Issues Multiple authors in global config get overwritten
View: 2512
Status accepted Assigned To
Milestone

Created on 2016-10-10.14:56:08 by sap, last changed 2016-10-20.19:19:05 by ganesh.

Files
File name Status Uploaded Type Edit Remove
resolve-issue2512-author-name-is-written-to-repository-after-multiple-choice-prompt.dpatch sap, 2016-10-18.17:33:22 application/octet-stream
See mailing list archives for discussion on individual patches.
Messages
msg19303 (view) Author: sap Date: 2016-10-10.14:56:08
This is a proposed fix for issue2512. Regarding coding
style, I tried to be faithful to the original code it replaces.
Attachments
msg19306 (view) Author: ganesh Date: 2016-10-17.05:30:26
Sorry for being a bit slow at looking at this - the patch looks nice 
and the current behaviour should definitely be improved.

If I read the new logic correctly, if you have a single author in the 
global prefs file, it'll be overwritten if 'alwaysAsk' is true and you 
choose "Other". But if you have multiple authors the global prefs file 
will never be changed whatever 'alwaysAsk' is set to.

Is that intentional? It feels a bit confusing, but I'm not sure I have  
a better alternative. One option might be to always append a new author 
no matter how many are there already.
msg19307 (view) Author: ganesh Date: 2016-10-17.05:32:08
Minor comments about the patch: if you name it "resolve issue2512: ..." 
then it will automatically close the bug in the bugtracker when accepted.

It could also rename your failing test case to a passing test case.
msg19308 (view) Author: sap Date: 2016-10-17.23:16:19
My reasoning is that users use darcs in one of two ways:

(1) Use the same author name for all repositories. In this case, we
always store the user name in the global settings.

(2) Use different user names across repositories. This is indicated by
adding multiple authors in the global settings. In this case, we want to
store the author locally, and leave the global settings as is, so we get
the author selection prompt again when we create another repository.

If the user chooses "Other" in case 2, it probably makes sense to both
store it locally, but also add it to the global settings. Thus, the
global settings would collect all used author names over time.
msg19312 (view) Author: sap Date: 2016-10-18.17:33:22
Updated patch:
 - prefixed patch name with "resolve issue2512:"
 - removes "failing-" prefix of test from Patch1519
   (as a result, this patch now depends on Patch1519)
 - in the case that there is only one author and alwaysAsk is True, the
   author is written to the repository instead of global settings
   (this hopefully better reflects what users expect)
Attachments
msg19314 (view) Author: ganesh Date: 2016-10-20.19:19:03
Thanks for the tweaks!
History
Date User Action Args
2016-10-10 14:56:08sapcreate
2016-10-17 05:30:27ganeshsetmessages: + msg19306
2016-10-17 05:32:08ganeshsetmessages: + msg19307
2016-10-17 23:16:20sapsetmessages: + msg19308
2016-10-18 17:33:23sapsetfiles: + resolve-issue2512-author-name-is-written-to-repository-after-multiple-choice-prompt.dpatch
messages: + msg19312
2016-10-18 17:33:30sapsetfiles: - author-name-is-written-to-repository-after-multiple_choice-prompt.dpatch
2016-10-20 19:19:05ganeshsetstatus: needs-screening -> accepted
messages: + msg19314