Description
Recognize a no-newline marker and classify its previous diff line.
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.
Recognize a no-newline marker and classify its previous diff line.
When to use this tool
Use Development: Unified Diff No Newline Marker when inspecting the stated bounded Git or patch token.
How to use the tool and how it works
- Enter marker, previousLine. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Recognize a no-newline marker and classify its previous diff line. Require a previous line beginning space, + or - and no CR/LF in either input; exact marker equality sets recognized; previous prefix selects old/new/both.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| marker | Marker | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| previousLine | Previous Line | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.recognized | Recognized | Calculated result member: boolean. |
| result.qualifiedSide | Qualified Side | Calculated result member: string. |
{
"input": {
"marker": "\\ No newline at end of file",
"previousLine": "-abc"
},
"output": {
"result": {
"recognized": true,
"qualifiedSide": "old"
}
}
} Limitations and assumptions
- qualifiedSide is still returned for an unrecognized marker; no patch is applied.
- 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
Similar or alternative tools
- Git Patch No Newline Marker
Recognize the exact Git no-newline marker line.
- Development: Unified Diff Range Field Split
Parse one unified-diff range field.