Skip to content

Main content

Development: Git Ref Short Name Prefix Split Tool

Split a restricted full Git heads/tags/remotes reference prefix from its short name; rejects common forbidden ref syntax but does not resolve repository objects.

Loading tool…

Description

Split a supported full Git ref into kind and short name.

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 supported full Git ref into kind and short name.

When to use this tool

Use Development: Git Ref Short Name Prefix Split when inspecting the stated bounded Git or patch token.

How to use the tool and how it works

  1. Enter reference. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Split a supported full Git ref into kind and short name. Require refs/heads, refs/tags or refs/remotes and reject the implemented invalid characters, empty/dot-leading/.lock components, double dots, @{ and terminal dot.1

Git reference names have lexical restrictions. Parsing a plausible name does not establish an existing branch, tag or object.2

Input fieldMeaning and unitsAccepted input
referenceReferenceRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.kindKindCalculated result member: string.
result.shortNameShort NameCalculated result member: string.
json
{
  "input": {
    "reference": "refs/heads/feature/a"
  },
  "output": {
    "result": {
      "kind": "branch",
      "shortName": "feature/a"
    }
  }
}

Limitations and assumptions

  • This is syntax inspection, not ref existence, branch resolution or repository access.
  • Outputs are nested inside result. 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

  1. Calculation and input contract: development/git-ref-short-name-prefix-split — tool.io

  2. Git reference-name rules — Git

Similar or alternative tools