Description
Distinguish leading ignore-pattern negation from escaped exclamation.
Git and diff tokens encode references, object metadata and patch coordinates. Parsing a local token does not resolve repository objects, establish identity or prove that a patch is complete or applicable.
Distinguish leading ignore-pattern negation from escaped exclamation.
When to use this tool
Use Git Ignore Negation Escape Pair when inspecting the stated bounded Git or patch token.
How to use the tool and how it works
- Enter line. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read negated, literalLeadingBang, pattern. Inspect negated, literalLeadingBang before interpreting the associated values.
Distinguish leading ignore-pattern negation from escaped exclamation. Return negated for initial !, literalLeadingBang for initial backslash-exclamation, and remove one leading character in either case.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| line | Line | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| negated | Negated | Required. Boolean. |
| literalLeadingBang | Literal Leading Bang | Required. Boolean. |
| pattern | Pattern | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"line": "!file"
},
"output": {
"negated": true,
"literalLeadingBang": false,
"pattern": "file"
}
} Limitations and assumptions
- The parser handles only this prefix distinction, not complete gitignore escaping, matching or precedence.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use Git itself against the intended repository for object resolution, complete validation, history interpretation or patch application.
References
Similar or alternative tools
- Git Log Record Field Delimiter Token
Count delimiter-looking substitutions in a Git log format string.
- Development: Git Mode Permission Label
Map a supported Git mode string to an object-kind label.