Subject: bug#37189: 25.4.1: vc-hg-ignore implementation is missing

From: Wolfgang Scherer <[email-masked]>
Date: Sun, 9 Feb 2020 00:59:19 +0100

Maybe this helps.

My partial current test tree of mainly glob anomalies (this is also how I discovered Git built-in pathspecs #39452):

  VC backend : SRC
  Working dir: /srv/install/linux/emacs/check-src/

                           ./
      edited               data
      unregistered         sub-file
  *   unregistered         test-?.xx
      unregistered         test-x.xx
  *   unregistered         test2*.xx
      unregistered         test2.xx
      unregistered         test5.xx
      unregistered         test6.xx
      unregistered         test9.xx
  *   unregistered         test9\.xx
  *   unregistered         test[56].xx
      unregistered         with $pe~ial
      unregistered         with spa ces
                           sub/
      edited               sub/data
      unregistered         sub/sub-file
  *   unregistered         sub/test-?.xx
      unregistered         sub/test-x.xx
  *   unregistered         sub/test2*.xx
      unregistered         sub/test2.xx
      unregistered         sub/test5.xx
      unregistered         sub/test6.xx
      unregistered         sub/test9.xx
  *   unregistered         sub/test9\.xx
  *   unregistered         sub/test[56].xx
      unregistered         sub/with $pe~ial
      unregistered         sub/with spa ces

When press "F" with my new implementation, the marked files are ignored, the `vc-dir-mode` display updates itself correctly to:

  VC backend : SRC
  Working dir: /srv/install/linux/emacs/check-src/

                           ./
      unregistered         .srcignore
      edited               data
      unregistered         sub-file
  *   ignored              test-?.xx
      unregistered         test-x.xx
  *   ignored              test2*.xx
      unregistered         test2.xx
      unregistered         test5.xx
      unregistered         test6.xx
      unregistered         test9.xx
  *   ignored              test9\.xx
  *   ignored              test[56].xx
      unregistered         with $pe~ial
      unregistered         with spa ces
                           sub/
      unregistered         sub/.srcignore
      edited               sub/data
      unregistered         sub/sub-file
  *   ignored              sub/test-?.xx
      unregistered         sub/test-x.xx
  *   ignored              sub/test2*.xx
      unregistered         sub/test2.xx
      unregistered         sub/test5.xx
      unregistered         sub/test6.xx
      unregistered         sub/test9.xx
  *   ignored              sub/test9\.xx
  *   ignored              sub/test[56].xx
      unregistered         sub/with $pe~ial
      unregistered         sub/with spa ces

The new .srcignore files' contents are (SRC has a strange escape syntax, which does not follow glob(7)):

  .srcignore: echo
    test-[?].xx
    test2[*].xx
    test9\.xx
    test[[]56].xx

  sub/.srcignore: echo
    test-[?].xx
    test2[*].xx
    test9\.xx
    test[[]56].xx

Refreshing the display and removing the ignored files shows, that the ignore patterns are actually working:

  VC backend : SRC
  Working dir: /srv/install/linux/emacs/check-src/

                           ./
      unregistered         .srcignore
      edited               data
      unregistered         sub-file
      unregistered         test-x.xx
      unregistered         test2.xx
      unregistered         test5.xx
      unregistered         test6.xx
      unregistered         test9.xx
      unregistered         with $pe~ial
      unregistered         with spa ces
                           sub/
      unregistered         sub/.srcignore
      edited               sub/data
      unregistered         sub/sub-file
      unregistered         sub/test-x.xx
      unregistered         sub/test2.xx
      unregistered         sub/test5.xx
      unregistered         sub/test6.xx
      unregistered         sub/test9.xx
      unregistered         sub/with $pe~ial
      unregistered         sub/with spa ces