darcs

Patch 2127 append slashes to dirs before matching against boring regexps

Title append slashes to dirs before matching against boring regexps
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To
Milestone

Created on 2020-12-18.15:16:15 by bfrk, last changed 2021-03-22.06:23:33 by ganesh.

Files
File name Status Uploaded Type Edit Remove
default-boring_-replace-_____-with-_.dpatch bfrk, 2020-12-19.22:29:44 application/x-darcs-patch
patch-preview.txt bfrk, 2020-12-18.15:16:14 text/x-darcs-patch
patch-preview.txt bfrk, 2020-12-19.22:29:44 text/x-darcs-patch
refactor_-use-isboring-and-realpath-in-d_r_state.dpatch bfrk, 2020-12-18.15:16:14 application/x-darcs-patch
unnamed bfrk, 2020-12-18.15:16:14 text/plain
unnamed bfrk, 2020-12-19.22:29:44 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg22550 (view) Author: bfrk Date: 2020-12-18.15:16:14
2 patches for repository http://darcs.net/screened:

patch 701dd989e818b9977ccb96baa9e55db51079df9a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Dec 17 12:19:33 CET 2020
  * refactor: use isBoring and realPath in D.R.State

patch ed1c0c56336d7aef4bce7b952cb6d02315101923
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Dec 17 17:49:03 CET 2020
  * append slashes to dirs before matching against boring regexps
  
  This resolves the first (minor) part of issue2669 where adding directories
  named 'core' and 'tags' fails due to the default boring file. It also
  requires a small change in one of the test scripts, where we want to ignore
  a particular directory.
Attachments
msg22554 (view) Author: bfrk Date: 2020-12-19.17:23:54
The justification for this move is that we cannot otherwise express, 
in the boringfile, that we want to ignore a specific directory.
msg22555 (view) Author: bfrk Date: 2020-12-19.17:25:52
...while a file of the same name is okay. Similarly, if we want to 
ignore a name, but only if it is a file, we can do so now by 
specifying ...filename$
msg22566 (view) Author: ganesh Date: 2020-12-19.21:59:28
What does this mean for backwards compatibility?
msg22570 (view) Author: bfrk Date: 2020-12-19.22:29:44
Here are two follow-up patches.

2 patches for repository http://darcs.net/screened:

patch 8e2a4f15ecc700d7156dfdf5807ef4ed26a7f0f8
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Dec 19 23:32:45 CET 2020
  * default boring: replace ($|/) with /
  
  This pattern was used to match a directory or any of its entries
  (recursively) and can now be simplified.

patch cd867c052cde7d227bbc70e0300e12e46424f2ac
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Dec 19 09:26:46 CET 2020
  * adapt regex to ignore build directory in our boringfile
Attachments
msg22573 (view) Author: bfrk Date: 2020-12-20.07:08:07
> What does this mean for backwards compatibility?

It's not 100% compatible, of course. If your regex is

  somename$

then this no longer matches a directory called somename, just a file.

I expect the impact to be small because the standard pattern to match a
directory has always been

  somename(/|$)

which retains its meaning as "match a file or a directory and anything
under it". This is how our default boring file did it (e.g. for CVS and
.git directories) and I guess most users have borrowed that pattern. If
instead you don't want to match a file you can now say

  somename/

to match only a directory (and anything under it), which previously did
not work because it didn't match the directory itself.

Our own .boring broke due to that change: the pattern "dist[^/]*$" no
longer matches the dist or dist-newstyle directories. Replacing the '$'
with a '/' fixes that, see one of the follow-up patches I sent. The
other follow-up patch changes the default boring file to more
specifically match only directories when that was the intention.
msg22591 (view) Author: ganesh Date: 2020-12-21.21:13:23
OK - given that our own boring file broke I'm not sure I agree the impact
will be small, but I think it's a good change. We should try to remember
to telegraph it well with appropriate prominence in the release notes.
msg22593 (view) Author: bfrk Date: 2020-12-21.22:50:10
> OK - given that our own boring file broke I'm not sure I agree the impact
> will be small

You may be right there. In any case I guess fixing such breakage should
be simple if you know what to look out for.

> but I think it's a good change. We should try to remember
> to telegraph it well with appropriate prominence in the release notes.

Agreed.
msg22614 (view) Author: falsifian Date: 2020-12-29.11:02:30
On Mon, Dec 21, 2020 at 10:50:11PM +0000, Ben Franksen wrote:
> 
> Ben Franksen <ben.franksen@online.de> added the comment:
> 
> > OK - given that our own boring file broke I'm not sure I agree the impact
> > will be small
> 
> You may be right there. In any case I guess fixing such breakage should
> be simple if you know what to look out for.
> 
> > but I think it's a good change. We should try to remember
> > to telegraph it well with appropriate prominence in the release notes.
> 
> Agreed.

Anecdotally, I have the following line in one of my boring files:

  ^programming/kaggle_sounds/dist-newstyle$

which of course refers to a directory. But I do agree it will be easy
for me to fix, now that I know about it.

-- 
James
History
Date User Action Args
2020-12-18 15:16:15bfrkcreate
2020-12-18 15:16:58bfrksetstatus: needs-screening -> needs-review
2020-12-19 17:22:28bfrksettitle: refactor: use isBoring and realPath in D... (and 1 more) -> append slashes to dirs before matching against boring regexps
2020-12-19 17:23:56bfrksetmessages: + msg22554
2020-12-19 17:25:52bfrksetmessages: + msg22555
2020-12-19 21:59:29ganeshsetstatus: needs-review -> review-in-progress
messages: + msg22566
2020-12-19 22:29:45bfrksetfiles: + patch-preview.txt, default-boring_-replace-_____-with-_.dpatch, unnamed
messages: + msg22570
2020-12-20 07:08:08bfrksetmessages: + msg22573
2020-12-21 21:13:24ganeshsetmessages: + msg22591
2020-12-21 21:13:29ganeshsetstatus: review-in-progress -> accepted-pending-tests
2020-12-21 22:50:11bfrksetmessages: + msg22593
2020-12-29 11:02:32falsifiansetmessages: + msg22614
title: append slashes to dirs before matching against boring regexps -> append slashes to dirs before matching against boring regexps
2021-03-22 06:23:33ganeshsetstatus: accepted-pending-tests -> accepted