Skip to content

Main content

Git Revision Parent Suffix Count Tool

Compute git revision parent suffix count from explicit bounded inputs.

Loading tool…

Description

Parse one parent or generation suffix on a revision token.

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.

Parse one parent or generation suffix on a revision token.

When to use this tool

Use Git Revision Parent Suffix Count when inspecting the stated bounded Git or patch token.

How to use the tool and how it works

  1. Enter token. 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 revision, parent, generation. Use the output convention below.

Parse one parent or generation suffix on a revision token. Accept one ~ or ^ with up to eight digits, defaulting omitted count to one; return revision plus explicit parent/generation fields under that suffix rule.1

Git distinguishes parent selection with a caret from first-parent traversal with a tilde; the helper parses a suffix without resolving repository objects.2

Input fieldMeaning and unitsAccepted input
tokenTokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
revisionRevisionRequired. Text; maximum UTF-16 length 8192.
parentParsed parent selector; ^0 yields zero, while ~0 retains the local parent value 1.Required. Safe integer.
generationParsed tilde count, or zero for a caret selector; no revision is resolved.Required. Safe integer.
json
{
  "input": {
    "token": "HEAD~3"
  },
  "output": {
    "revision": "HEAD",
    "parent": 1,
    "generation": 3
  }
}

Limitations and assumptions

  • Zero counts select the revision itself; this does not resolve commits or parse chained suffixes.
  • 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-revision-parent-suffix-count — tool.io

  2. Git revisions — Git

Similar or alternative tools