I use both mercurial and git for similar types of work, and maintain parallel global ignore files. Now, the basic syntax for the two systems is sufficiently similar that I can almost use the same ignore file for both systems. But not quite.
gituses (extended) globs to specify ignore patterns.hguses either full regular expressions (the default) or extended globs to specify ignore patterns. There is a way to specify which system to use.
So to use the same list of globs for both systems, my hg ignore file needs to include a line declaring that the glob syntax is in effect:
syntax: glob
# Compilation artifacts
*.o
This syntax declaration is not recognized by git (which doesn't need one, since it only accepts the glob syntax). I have tried it out and confirmed that it's treated as just another filename: if I create a file called syntax: glob (with a space in the name), git ignores it. This seems harmless but ugly. So: Is there a way to construct a file of ignore patterns that is valid for both systems, without this little wart?