Description
Split a long-form pathspec magic prefix from its pattern.
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.
Split a long-form pathspec magic prefix from its pattern.
When to use this tool
Use Git Pathspec Magic Prefix Token when inspecting the stated bounded Git or patch token.
How to use the tool and how it works
- Enter pathspec. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read magic, pattern. Use the output convention below.
Split a long-form pathspec magic prefix from its pattern. Require an initial colon-parenthesized prefix; split nonempty magic text by commas, otherwise return an empty list, and preserve the remaining pattern.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| pathspec | Pathspec | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| magic | Magic | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| pattern | Pattern | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"pathspec": ":(top,literal)a*b"
},
"output": {
"magic": [
"top",
"literal"
],
"pattern": "a*b"
}
} Limitations and assumptions
- Magic names and pattern semantics are not validated, matched or applied to files.
- 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
- Development: Git Ref Short Name Prefix Split
Split a supported full Git ref into kind and short name.
- Git Path Spec Attribute State Token
Compare one pathspec attribute requirement with supplied attribute state.