darcs

Patch 1321 1 patch for repository http://darcs.net/screened

Title 1 patch for repository http://darcs.net/screened
Superseder Nosy List gpiero
Related Issues
Status rejected Assigned To
Milestone

Created on 2015-04-06.10:15:27 by gpiero, last changed 2015-06-11.16:50:28 by bfrk.

See mailing list archives for discussion on individual patches.
Messages
msg18348 (view) Author: gpiero Date: 2015-04-06.10:15:24
1 patch for repository http://darcs.net/screened:

patch 92c1b439fe4c3ad8c273eb5f557c93bfeccb21cd
Author: Gian Piero Carrubba <gpiero@rm-rf.it>
Date:   Mon Apr  6 10:46:30 CEST 2015
  * Allow description lines starting with the '#' sign
  
  This is a sort of rollback for 
  
  patch 30fd3af4b8c350dce13b821327164d1910022674
  Author: Guillaume Hoffmann <guillaumh@gmail.com>
  Date:   Fri Jul 26 10:04:12 CEST 2013
    * change format of patch name file when a text editor is invoked
    Use for '#' instead of end-of-description marker, many editors
    will colour these lines as comments.
  
  It should anyway (almost fully) comply with the rationale, but also
  permitting lines starting with a '#' sign if needed.

New patches:

[Allow description lines starting with the '#' sign
Gian Piero Carrubba <gpiero@rm-rf.it>**20150406084630
 Ignore-this: ac4131d1efa40c5e7a1b1754b7a35876
 
 This is a sort of rollback for 
 
 patch 30fd3af4b8c350dce13b821327164d1910022674
 Author: Guillaume Hoffmann <guillaumh@gmail.com>
 Date:   Fri Jul 26 10:04:12 CEST 2013
   * change format of patch name file when a text editor is invoked
   Use for '#' instead of end-of-description marker, many editors
   will colour these lines as comments.
 
 It should anyway (almost fully) comply with the rationale, but also
 permitting lines starting with a '#' sign if needed.
] hunk ./src/Darcs/UI/Commands/Record.hs 502
+  delimitingLine = "#-- Insert patch name and description above this line --#"
+
hunk ./src/Darcs/UI/Commands/Record.hs 507
-         let t = filter (not.("#" `isPrefixOf`)) $ (lines.filter (/='\r')) f'
+         let t = takeWhile (delimitingLine /=) $ (lines.filter (/='\r')) f'
hunk ./src/Darcs/UI/Commands/Record.hs 519
-                     $ text "# Please enter the patch name in the first line, and"
+                     $ text delimitingLine
+                    $$ text "#"
+                    $$ text "# Please enter the patch name in the first line and,"
hunk ./src/Darcs/UI/Commands/Record.hs 523
-                    $$ text "#"
-                    $$ text "# Lines starting with '#' will be ignored."
hunk ./tests/record_editor.sh 18
-echo y | darcs record --edit-long-comment -a -m foo file.t | grep '# Please enter'
+echo y | darcs record --edit-long-comment -a -m foo file.t | grep '[[:space:]]#-- Insert patch name and description above this line --#$'
hunk ./tests/record_editor.sh 28
-echo y | darcs record --edit-long-comment -a -m foo file.t | grep '# Please enter'
+echo y | darcs record --edit-long-comment -a -m foo file.t | grep '[[:space:]]#-- Insert patch name and description above this line --#$'
hunk ./tests/record_editor.sh 54
-export DARCS_EDITOR='grep "# Please enter"'
+export DARCS_EDITOR='grep "^#-- Insert patch name and description above this line --#$"'
hunk ./tests/record_editor.sh 61
-echo y | darcs record --edit-long-comment -a -m foo file.t | grep '# Please enter'
+echo y | darcs record --edit-long-comment -a -m foo file.t | grep '^#-- Insert patch name and description above this line --#$'

Context:

[integrate new options subsystem
Ben Franksen <benjamin.franksen@helmholtz-berlin.de>**20141104223757
 Ignore-this: 9636f6d007ba4241b19b9b964bf886a3
 
 The conversion is complete in the sense that the old Darcs.UI.Arguments is
 now obsolete and can be removed. Command options are specified using the new
 "typed" DarcsOption type from Darcs.UI.Options. All available tests succeed.
 
 However, it is incomplete in the sense that there are still many places
 where the list of DarcsFlag is scanned or manipulated directly. Removing
 these direct accesses will be an on-going effort; when it is complete we can
 replace [DarcsFlag] with an abstract data type.
 
 This patch contains an almost complete re-implementation of
 Darcs.UI.ArgumentDefaults under the new name Darcs.UI.Defaults. This adds a
 new dependency on regex-applicative, see the comments in the code.
 
 I have also made the tentative change of using a command specific
 configuration record for two of the commands, namely "record" and "amend".
 It remains to be seen whether this is the right approach and the other
 commands should follow it.
 
 Rebased by Ganesh Sittampalam <ganesh@earth.li> to integrate with the latest
 darcs code. Originally in two patches that first introduced and then
 switched to the new code; I merged them into one to make the rebasing easier.
 
] 
[Work around haskell-src-exts (and hence hlint) parse errors
Ganesh Sittampalam <ganesh@earth.li>**20141029163818
 Ignore-this: 3e77eceae03d2f001b7a98779b9ea88a
] 
[replaced duplicate DiffAlgorithm in Darcs.Repository.Flags with re-export
Ben Franksen <benjamin.franksen@helmholtz-berlin.de>**20140629235443
 Ignore-this: 8135bf861d054d75f5ee4ce9116ea208
] 
[Darcs.Repository.Flags: added Show instances for all types
Ben Franksen <benjamin.franksen@helmholtz-berlin.de>**20140629112323
 Ignore-this: 27f18b99ebbc4f09f7c2bf8f6953ff2d
] 
[Darcs.Repository.Flags: added Eq instance for UseIndex
Ben Franksen <benjamin.franksen@helmholtz-berlin.de>**20140613093130
 Ignore-this: 925bd846affdc9566fd4de260b296d39
] 
[resolve conflicts
Ganesh Sittampalam <ganesh@earth.li>**20141025160030
 Ignore-this: 7a42ce435cad0afcdad55c8eab3d6599
] 
[initial version of 'rebase changes' command
Ganesh Sittampalam <ganesh@earth.li>**20130311182415
 Ignore-this: dc58615c9d248c61a588ba6e1ab3eab6
] 
[make getChangesInfo take a PatchFilter instead of a Repository
Ganesh Sittampalam <ganesh@earth.li>**20130218234725
 Ignore-this: 96e88fa9f0c4eab1f68080484006c63d
] 
[bundle up checking for patch index and using it
Ganesh Sittampalam <ganesh@earth.li>**20130218233321
 Ignore-this: a253261a2b5eefbf7113af27694d6beb
] 
[resolve issue2409: implement darcs rebase apply
Ganesh Sittampalam <ganesh@earth.li>**20141022073448
 Ignore-this: a1c0c535bc3c0a80208d5c0a66f24a3d
] 
[switch applyCmd to use the PatchApplier abstraction
Ganesh Sittampalam <ganesh@earth.li>**20141022005542
 Ignore-this: e4bd8bf03aaaacaf3ab4d56db652ef02
] 
[reuse the standard pullCmd for rebase
Ganesh Sittampalam <ganesh@earth.li>**20141022002250
 Ignore-this: 9dd91d42805e4641bbcbd4d168d4d8a2
 
 This involves a rather complicated abstraction that would be major overkill
 for the approximately 6 lines of copy and pasted code that it saves.
 
 However it should extend to applyCmd, which is substantially bigger.
 
] 
[generalise applyPatchesForRebase along the same lines as applyPatches
Ganesh Sittampalam <ganesh@earth.li>**20141021195533
 Ignore-this: bb7a08b357fa17aaa68f4535c8d24049
] 
[Share applyPatches code between pull and apply
Ganesh Sittampalam <ganesh@earth.li>**20141021160825
 Ignore-this: e36dbb1dafe019cd55900b5a76561bc0
 
 Abstract the applyPatches function from the apply command, and make pull
 use it.
 
 This means the following changes to apply:
 
  - The outcome is now displayed using 'putInfo', which means it will
    respect options like '-q' where it didn't before. This seems reasonable.
 
 It means the following changes to pull:
 
  - We now call 'setEnvDarcsPatches'. This seems reasonable.
 
  - We now call 'withSignalsBlocked' when applying patches. I think this is
    harmless or an improvement.
 
  - The output messages are a bit more generic, but I don't think any important
    detail is lost.
 
  - We now call 'redirectOutput' around the messages. --reply isn't passed
    to pull so this should make no difference.
 
] 
[clarify naming of applyPatches functions
Ganesh Sittampalam <ganesh@earth.li>**20141021140658
 Ignore-this: 71936b7fbc48182b6c54b106f1603db3
] 
[minimize bundle contexts by default, allow ctrl-c or --no-minimize
Guillaume Hoffmann <guillaumh@gmail.com>**20141017174032
 Ignore-this: 3a75c1ef6dce9d8d72e6187f7b6bf91
] 
[--minimize for obliterate -O
Guillaume Hoffmann <guillaumh@gmail.com>**20141015210534
 Ignore-this: a99c974c6d42d0a27643214b48cb70c9
] 
[resolve issue1514: send --minimize-context flag for send
Guillaume Hoffmann <guillaumh@gmail.com>**20141015210457
 Ignore-this: 486b70607488643e092bb8f46cd046d4
] 
[use now -h and --hash as shortcut flags to match on patch hash
Guillaume Hoffmann <guillaumh@gmail.com>**20141008185829
 Ignore-this: a8caae8a4ef50049fae3954867f2e3a7
] 
[Resolve issue2249: Rename isFile to isValidLocalPath and WorkRepoURL to WorkRepoPossibleURL
mle@mlen.pl**20140928102835
 Ignore-this: 7273172e1131a0a6870f1d203d241b97
] 
[switch from deprecated System.Cmd to System.Process
Ganesh Sittampalam <ganesh@earth.li>**20140926163517
 Ignore-this: 5a05007a7e868cebe16252262337756
] 
[support mtl 2.2
Ganesh Sittampalam <ganesh@earth.li>**20140926155729
 Ignore-this: 868ab98d5f71b026ba87f0053f67c69d
] 
[remove creator-hash flag unused since annotate rewrite
Guillaume Hoffmann <guillaumh@gmail.com>**20140825195932
 Ignore-this: 2a857b399a1815d78ef95b5d18f8ba2a
] 
[print an informative message after rollback
Ganesh Sittampalam <ganesh@earth.li>**20140725204057
 Ignore-this: dc5d37deeb3cc5455ff10920a531dd38
] 
[enable to match on patch hash prefix and ignore case
Guillaume Hoffmann <guillaumh@gmail.com>**20140724132850
 Ignore-this: d0e43fceb3682dff95b51e51d84729e8
] 
[show patch hash in UI and put author and date on separate lines
Guillaume Hoffmann <guillaumh@gmail.com>**20140724131644
 Ignore-this: 225478cb9a7a1c82c73668ed12e27a46
 
 some cleanups:
 * use correctly makePatchname instead of makeFilename in other
   places of the code
 * remove unused RepoPatchInfo
 * remove unused idpatchinfo
 * remove unused makeAltFilename
 * remove unused HTML class instance of PatchInfo 
] 
[New option "--reorder" for the command rebase pull.
Ale Gadea <alex.aegf@gmail.com>**20140709003350
 Ignore-this: cf17849e0ff84b4dd72f3bac47572e2
 The option --reorder moves to the top the uncommon set
 of patches between the current repository and remote
 repository.
] 
[New option "--reorder" for the command pull and apply.
Ale Gadea <alex.aegf@gmail.com>**20140709003342
 Ignore-this: e2b2d705d2d515dc5b54201be4f7c76f
 The option --reorder moves to the top the uncommon
 set of patches between the current repository and remote
 repository.
] 
[resolve issue1624: bucketed cache.
Marcio Diaz <marcio.diaz@gmail.com>**20140716102401
 Ignore-this: 2d077f5c10156e4a00631fbc4f8c3119
] 
[Always use MyersDiff when removing a file - the diff will be identical
Owen Stephens <darcs@owenstephens.co.uk>**20140511150625
 Ignore-this: 5d81f5802cca1fd0f9d9b61f7e3500d3
] 
[Tidy up of Move - refactor out some common code
Owen Stephens <darcs@owenstephens.co.uk>**20140511115159
 Ignore-this: 270727265518e70b6c2849e7b2db3366
] 
[Allow post-hoc moves to known paths
Owen Stephens <darcs@owenstephens.co.uk>**20140430023525
 Ignore-this: f5f0b4d7a90e32b8f4e8a0eed47d2022
 The new behaviour is to record patches that first delete the original contents,
 before adding the move patch 
] 
[Resolve issue2380: allow darcs mv into known, but deleted in working, file
Owen Stephens <darcs@owenstephens.co.uk>**20140424211940
 Ignore-this: 8c4f8d77480dd360d051b944dc22c6d
] 
[Tidy up checkNewAndOldFilenames in the Move command
Owen Stephens <darcs@owenstephens.co.uk>**20140422235835
 Ignore-this: f5c0fb784b1d9a69f7d2641f9111e580
] 
[remove patch index flags from rollback command
Guillaume Hoffmann <guillaumh@gmail.com>**20140612170904
 Ignore-this: 342ccf1ce50dd76b5af334df2298f63
] 
[resolve issue2396: make convert a supercommand and enhance help strings
Guillaume Hoffmann <guillaumh@gmail.com>**20140610210546
 Ignore-this: 41493c28dab5a745b1d2c7107212724e
] 
[marksfile support for convert --export
Guillaume Hoffmann <guillaumh@gmail.com>**20140609190214
 Ignore-this: 154f9a34ec7c65eaa64ab42462c60705
] 
[Resolve Issue2361: optimize --reorder runs forever with one repository
Ale Gadea <alex.aegf@gmail.com>**20140605210012
 Ignore-this: b18bc37e5d6668df62f05679c629e08c
] 
[factorize boilerplate of optimize subcommands
Guillaume Hoffmann <guillaumh@gmail.com>**20140605174035
 Ignore-this: 13cc1ac6f5a70fd96815dca2ab12f76c
] 
[resolve issue2394: make optimize a supercommand
Guillaume Hoffmann <guillaumh@gmail.com>**20140603201207
 Ignore-this: 841fbf0c5e0017eaff8b87b75ad80a37
] 
[make optimize command respect --quiet by using putInfo
benjamin.franksen@helmholtz-berlin.de**20140511105622
 Ignore-this: f4a139619c68470fe821929958a910b
] 
[darcs.cabal: make Haskell2010 the default-language for all stanzas
benjamin.franksen@helmholtz-berlin.de**20140511102244
 Ignore-this: 44afc0f4c5b5de0751edd2f99764dc20
 
 This implied some more changes: we must demand cabal version >= 1.10, and
 change the extensions fields to default-extensions; in the implementation of
 some of the commands, needed to fix the indentation of do blocks.
] 
[implement doFastZip to create zip archive from pristine tree
Guillaume Hoffmann <guillaumh@gmail.com>**20140516190946
 Ignore-this: 483ef7fffc417a4811d2d8cd90885e18
] 
[Accept issue2382: darcs is confused if a dir is moved inplace of a file
Owen Stephens <darcs@owenstephens.co.uk>**20140427225132
 Ignore-this: b4fef46928598bbc44c61325f6dc11b2
] 
[Resolve Issue2244: darcs tag should warn about duplicate tags
Ale Gadea <alex.aegf@gmail.com>**20140507183109
 Ignore-this: 8d25e1130bff79907d3db39d02f40197
 Make darcs tag t, with t already an existing tag, cause a warning message.
] 
[Allow options with path arguments to be specified in defaults file
benjamin.franksen@helmholtz-berlin.de**20140404192946
 Ignore-this: ff2ff9e6d96a06c4a8df29b3c9819b22
] 
[fixed cut-n-paste error in haddock comment
benjamin.franksen@helmholtz-berlin.de**20140403224430
 Ignore-this: 7e5b9fe7bbecbb52d8b639772b0fd208
] 
[resolve issue2314: output-auto-name in defaults file
benjamin.franksen@helmholtz-berlin.de**20140403170012
 Ignore-this: 6dbd187b78bc2b108920cc0eaabfa5af
] 
[resolve issue1268: enable to write darcs init x
Guillaume Hoffmann <guillaumh@gmail.com>**20140425200752
 Ignore-this: 2586d59ba17f94b655c3a48df80b5d66
 Original patch by Radoslav Dorcik 
] 
[rename get to clone
Guillaume Hoffmann <guillaumh@gmail.com>**20140425175210
 Ignore-this: 2c27cb2bc6a9978988386743b241c0b3
] 
[remove Put since Get can clone to ssh destination faster
Guillaume Hoffmann <guillaumh@gmail.com>**20140425063225
 Ignore-this: c0dbc05fc7511977381abba47728810a
] 
[resolve issue1066: clone to ssh URL by locally cloning then copying by scp
Guillaume Hoffmann <guillaumh@gmail.com>**20140425060647
 Ignore-this: 2778bc4774fe8d5c53d0011b2193c1c2
 Introduce an internal flag ForgetParent that enable to clone
 repositories while forgetting about their source (do not copy
 sources nor caches).
] 
[do not tolerate ctrl+c when --complete is passed
Guillaume Hoffmann <guillaumh@gmail.com>**20140425053440
 Ignore-this: 856378499c61de4e4281d1ed966ede76
] 
[do not print message twice when patches pack grabbing fails
Guillaume Hoffmann <guillaumh@gmail.com>**20140424165929
 Ignore-this: 148f8ca132725e81dd52d64f00cbd24b
] 
[create inventories subdir at darcs init
Guillaume Hoffmann <guillaumh@gmail.com>**20140421133938
 Ignore-this: 5ace4beaf6c27c8a5105d74db977f61a
] 
[TAG 2.9.9
Ganesh Sittampalam <ganesh@earth.li>**20140424063828
 Ignore-this: ae3cb4369f15af8cb2f19d6f5603d935
] 
Patch bundle hash:
bed9a6f297e8c894481a136d26bed8e2bb30c34b
msg18351 (view) Author: gh Date: 2015-04-06.20:10:52
Just so you know, Git and fossil also ignore all lines starting with
"#", mercurial, on the other hand, ignores lines starting with "HG:".
SVN uses a single line delimiter, as you propose. (Also, darcs < 2.10.)

I read over there ( https://www.drupal.org/node/52287 ) that # should be
avoided at the beginning of a commit name in git because the interface
of "git rebase" is text-based and interprets these lines as ignored.

Currently "darcs rebase" does not use such a text-based interface, but
what if in the future it does? And more concretely, git repositories
converted from darcs can have this issue.

Is there a use case that you want to share?
msg18355 (view) Author: gpiero Date: 2015-04-06.20:44:12
* [Mon, Apr 06, 2015 at 08:10:53PM +0000] Guillaume Hoffmann:
>Just so you know, Git and fossil also ignore all lines starting with
>"#", mercurial, on the other hand, ignores lines starting with "HG:".
>SVN uses a single line delimiter, as you propose. (Also, darcs < 2.10.)
>
>I read over there ( https://www.drupal.org/node/52287 ) that # should be
>avoided at the beginning of a commit name in git because the interface
>of "git rebase" is text-based and interprets these lines as ignored.
>
>Currently "darcs rebase" does not use such a text-based interface, but
>what if in the future it does? And more concretely, git repositories
>converted from darcs can have this issue.
>
>Is there a use case that you want to share?

Hi Guillaume,

I can report the use case that prompted me to implement it.
I maintain my user files (home directory) in a darcs repo and happened 
to use the patch description for instructions about how to enable a 
feature:

patch c01e86337bb10eb1b400f1fc53e760daaf49fab4
Author: Gian Piero Carrubba <gpiero@rm-rf.it>
Date:   Sun Aug 24 09:56:47 CEST 2014
  * xkb: initial record
  In order to use this snippet on a Debian system, following steps could be used.
  
  $ sudo ln -sf /etc/X11/xkb/gpiero /usr/share/X11/xkb/symbols/gpiero
  $ sudo ln -sf ~/.config/xkb/symbols/gpiero /etc/X11/xkb/gpiero
  $ cat <<EOF | sudo tee /etc/default/keyboard
   # KEYBOARD CONFIGURATION FILE
  
   # Consult the keyboard(5) manual page.
  
  ln -sf /etc/X11/xkb/gpiero /usr/share/X11/xkb/symbols/gpiero
  
  XKBMODEL="pc105"
  XKBLAYOUT="gpiero"
  XKBVARIANT=""
  XKBOPTIONS=""
  
  BACKSPACE="guess"
  EOF

In other words, I've embedded a file snippet inside the patch 
description. The first time I recorded it, I was surprised by seeing 
that the commented lines were missing (and frankly I discovered it by 
chance[0]) so I had to reinsert them with a leading space just for not 
losing infos.

I agree this is a sort of corner case, but I'm also convinced we should 
not impose constraints that we could avoid. Anyway, I don't know the git 
rebase's text-based interface, so I can not judge if, in case darcs 
implemented it, it could be a show-stopper.

As for git repos converted from darcs, I would say that if it is a git 
limitation it should be 'fixed' during the conversion, but I don't see 
why it should be inherited by darcs just for 'compatibility'.

Ciao,
Gian Piero.

[0] Yeah, I'm used not to read EULA notes...
msg18360 (view) Author: gh Date: 2015-04-10.18:42:15
The warning message in the patch description default file (when one runs
`darcs rec`) is quite visible IMO. (I know it's not your point but just
saying.)

I would stick with the current behaviour,even if it seems arbitrary, I
find it aesthetically more pleasant and it makes log messages look less
surprising. Also there is the authority argument of git using the same
format restriction.

*If* we come back to the previous behaviour, then we should rollback
more of the previous patch, as there will be no longer need of prefixing
lines with '#' below the separator.
msg18443 (view) Author: bfrk Date: 2015-06-11.16:50:27
FWIW, I liked the previous behaviour (a separating line) better than the
current one and I also find the OP's use case convincing.
History
Date User Action Args
2015-04-06 10:15:27gpierocreate
2015-04-06 20:10:53ghsetmessages: + msg18351
2015-04-06 20:44:14gpierosetmessages: + msg18355
2015-04-10 18:42:18ghsetmessages: + msg18360
2015-06-09 05:46:25ganeshsetstatus: needs-screening -> rejected
2015-06-11 16:50:28bfrksetmessages: + msg18443