D5493: match: support rooted globs in hgignore

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Wed Jan 16 13:24:58 UTC 2019


yuja added a comment.


  > I haven't handled your other remark,
  
  I think `rootglob:` can be easily added. As we already have cwd-relative
  `glob:`, we'll just need some "if"s to not rewrite a repo.root-relative path
  to cwd-relative path.
  
  This patch works, but it's technically incorrect since `glob:` isn't a
  repo.root-relative pattern. That's my concern.
  
  > however I noticed that globs in .gitignore can be rooted [1]. I had looked for a precedent for syntax for rooting a glob last week without success. Now that I see this, their choice looks sensible enough to me, so I think I'll try that, as I think that'd be nicer overall, and easier to implement (and side-step your remark about abusing the glob syntax).
  > 
  >   
  >   [1] From https://git-scm.com/docs/gitignore: A leading slash matches the beginning of the pathname. For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
  
  Do you mean you're planning to copy the git's syntax? I'm -1 on it because
  it would look quite different from the other hg's pattern syntax.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5493

To: valentin.gatienbaron, #hg-reviewers
Cc: yuja, foozy, mercurial-devel


More information about the Mercurial-devel mailing list