2

In my Plastic SCM repository, how can I make use of existing well-crafted .gitignore files (such as the ones on GitHub)? I'm looking for an automated conversion from .gitignore to the ignore.conf format that Plastic SCM understands.

There's an old request for such a conversion tool, or even for Plastic SCM to read .gitignore files directly. I don't see either having been implemented yet.

Also, the format of ignore.conf is not systematically documented like .gitignore is. The best documentation I found is this blog post. Apparently comments, exception rules, and wildcards work in the same way as in .gitignore.

Differences I have noticed between ignore.conf and .gitignore:

  1. Plastic doesn't seem to understand Git's range syntax [abc].
  2. Trailing slash in Git matches only folders, not files or symbolic links. Without a trailing slash the name can match file and folder alike. In Plastic there seems to be no way to tell a file from a folder.
  3. In Git, folder/ with a trailing slash ignores the folder and all files under it. In Plastic, it will only ignore the files under it.
  4. There's a peculiarity with folders that begin with a dot. In Git, .vs/ ignores the folder and its contents (and you could alternatively use .vs which would also match a regular file by that name). In Plastic, you need both .vs to ignore the folder and .vs/ to ignore its contents.
vvnurmi
  • 448
  • 6
  • 10

1 Answers1

2

What I'm doing for now is converting gitignore lines manually by applying these rules. I'm using Plastic SCM 7.0.16.2346.

  1. For exception rules that want to match only folders, decide whether to remove the rule completely or to expand the exception to both files or folders. The only case I've seen so far is this
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
  1. For each line with a trailing slash, add a duplicate line without the trailing slash. This way both the folder and its contents get ignored, like Git does it. (For folders that don't begin with a dot, it's enough to have the line without trailing slash.)
  2. For ranges whose purpose is to express a case-insensitive match, such as [Rr]elease, replace the range by the explicit correct case, e.g. Release. In simple cases like this it's also possible to add both case alternatives. Plastic SCM's rules are case sensitive.
vvnurmi
  • 448
  • 6
  • 10