Description
Return the new-side half-open span from a restricted diff hunk header.
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.
Return the new-side half-open span from a restricted diff hunk header.
When to use this tool
Use Git Diff Hunk New Line Span when inspecting the stated bounded Git or patch token.
How to use the tool and how it works
- Enter header. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read start, count, endExclusive. Use the output convention below.
Return the new-side half-open span from a restricted diff hunk header. Parse the plus range, default omitted count to one, require nonnegative safe start/count and return endExclusive = start+count.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| header | Header | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| start | Start | Required. Safe integer. |
| count | Count | Required. Safe integer. |
| endExclusive | End Exclusive | Required. Safe integer. |
{
"input": {
"header": "@@ -1,3 +5,4 @@"
},
"output": {
"start": 5,
"count": 4,
"endExclusive": 9
}
} Limitations and assumptions
- Old-side numeric fields are only syntactically matched; no hunk body or patch applicability is verified.
- 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 Diff Status Rename Percentage
Parse a rename or copy status with similarity percent.
- Git Diff Copy Similarity Score Token
Parse a literal similarity index percentage line.