"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Evan Silberman <evan@jklol.net>
Subject:
leading separators in ignore patterns
To:
gameoftrees@openbsd.org
Date:
Sat, 10 May 2025 15:39:00 -0700

Download raw body.

Thread
got(1) status says it "gives no special significance to the location of
path component separators in a pattern", i.e. it doesn't implement the
rule from gitignore(7) that "if there is a separator at the beginning or
middle of the pattern, then the pattern is relative to the directory
level of the particular .gitignore file itself. otherwise the pattern
may also match at any level below the .gitignore level".

An infelicity of this is that it means that .gitignore patterns like
'/build' will never be ignored by got. From what I can tell, I think got
could reasonably treat any '/pattern' identically to 'pattern'. In so
doing, got should ignore strictly more paths than it did before, without
ignoring any paths that git does *not* ignore using the same pattern.

I don't have a patch; I tried doing `if (line[0] == "/") line++;` in
read_ignores but apparently that's the wrong answer.

Evan Silberman