darcs

Issue 1373 darcs manual wrongly promises that [^ ] is a valid token spec

Title darcs manual wrongly promises that [^ ] is a valid token spec
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, gwern, kowey, mornfall, thorkilnaur, twb
Assigned To twb
Topics Core, Documentation

Created on 2009-02-28.15:33:56 by gwern, last changed 2009-08-29.03:32:34 by twb.

Messages
msg7364 (view) Author: gwern Date: 2009-02-28.15:33:52
http://darcs.net/manual/node8.html#SECTION00854000000000000000 :

"If you prefer to choose a different set of characters to define your token
(perhaps because you are programming in some other language), you may do so with
the --token-chars option. You may prefer to define tokens in terms of delimiting
characters instead of allowed characters using a flag such as --token-chars '[^
\n\t]', which would define a token as being white-space delimited."

10:30 AM] 1.2Mb$ darcs replace --token-chars '[^\ \n\t]' foo bar *

darcs failed:  Bad token spec: '[^\ \n\t]' (Space is not allowed in the spec)
[10:30 AM] 1.2Mb$ darcs --version
2.2.0pre2 (+ 88 patches)

---

On a side note, does anyone know why this fails? I've read the manual but it
doesn't help much:

[10:31 AM] 1.2Mb$ darcs replace
"https://secure.wikimedia.org/wikipedia/en/wiki/" "Wikipedia" Threats.page 
darcs failed:  'https://secure.wikimedia.org/wikipedia/en/wiki/' is not a valid
token!
msg7543 (view) Author: twb Date: 2009-03-28.16:13:49
The following patch updated the status of issue1373 to be resolved:

* Resolve issue1373: make --token-chars [^ \t\n] work as advertised. 
Ignore-this: 2588b1d862a2d5e20ede58c8b56f6168
msg7584 (view) Author: twb Date: 2009-04-06.10:00:18
# Rollback issue1373 fix, which causes a regression.
msg8128 (view) Author: kowey Date: 2009-08-14.08:03:17
I get the impression that the core implementation for darcs replace is actually
quite simple and straightforward (see the RegChars module and forceTokReplace)

I need somebody to study the code more closely.

1. Is there any reason in the core that spaces should NOT be token characters? 
I don't get that impression by looking at forceTokReplace, but I could be mistaken.

2. Is there any reason they should not be explicit delimiter characters?  (It
sounds like this is very likely NOT, otherwise how would darcs replace even work
with the default token spec?)

3. (this requires studying the history and mailing list), what regression did
Trent's patch cause, exactly and why?

4. Notice the discrepency between Gwern's command and the code in Trent's patch.
 Is there any reason one would need to backslash the space? "\ "?  Or was that
just a flub?

If I we can get answers to these three questions, it sounds like we can move
forward on this, either by updating some documentation
msg8152 (view) Author: mornfall Date: 2009-08-15.09:14:13
That's easy Eric, the patch format uses spaces as separators. That's why we
have the in-house whitespace escaping in filepaths. Of course, no escaping is
done on tokenspec, so it can't contain spaces, and the format is set in stone,
so it cannot be changed. I'd argue for a wontfix. (You need a new patch type to
implement this in existing repoformat.)
msg8154 (view) Author: kowey Date: 2009-08-15.09:19:41
Excellent!  We now have clarity on this.  Thanks, Petr!

Trent, may I assign this to you to clarify in the user manual why we can't have
spaces at all?
History
Date User Action Args
2009-02-28 15:33:56gwerncreate
2009-03-28 16:13:51twbsetstatus: unread -> resolved
nosy: + twb
messages: + msg7543
2009-04-06 10:00:20twbsetstatus: resolved -> unknown
nosy: kowey, simon, twb, thorkilnaur, gwern, dmitry.kurochkin
messages: + msg7584
2009-04-07 08:18:17twbsetnosy: kowey, simon, twb, thorkilnaur, gwern, dmitry.kurochkin
2009-08-14 08:03:25koweysetstatus: unknown -> needs-reproduction
nosy: kowey, simon, twb, thorkilnaur, gwern, dmitry.kurochkin
topic: + Core
messages: + msg8128
title: Manual for darcs replace is erroneous? -> darcs replace does not accept spaces in token spec
2009-08-15 09:14:15mornfallsetnosy: + mornfall
messages: + msg8152
2009-08-15 09:19:46koweysetstatus: needs-reproduction -> needs-implementation
title: darcs replace does not accept spaces in token spec -> darcs manual wrongly promises that [^ ] is a valid token spec
nosy: kowey, simon, twb, thorkilnaur, gwern, dmitry.kurochkin, mornfall
messages: + msg8154
topic: + Documentation
assignedto: twb
2009-08-25 17:41:26adminsetnosy: + darcs-devel, - simon
2009-08-27 14:24:30adminsetnosy: kowey, darcs-devel, twb, thorkilnaur, gwern, dmitry.kurochkin, mornfall
2009-08-29 03:32:34twbsetstatus: needs-implementation -> resolved
nosy: kowey, darcs-devel, twb, thorkilnaur, gwern, dmitry.kurochkin, mornfall