You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a case for adding syntax to annotate content lines, hunks, file comparisons and diff files.
First, there is the use case of diff tools that need to communicate more semantic information than what is possible using just content and snippet lines. This might be necessary in order to make a generic merge tool that takes hintful diffs as input, for example to override the default indentation handling. It would probably be necessary to allow annotations for individual content lines.
Second, it would be good if the format could be made useful for next-generation version control software. Even if we don't expect it will be common to produce patches that work in more than one version control system, at least some consumers such as visualizers and highlighters would not care about the version control system.
Since we don't necessarily know what features might be needed for this, we might want to aim for extensibility. Unified diff format is already extensible, since comments can be inserted at least between file comparisons - this is what the compat format uses. Taking pijul as an example, it seems that it would be necessary to annotate the diff file, as well as hunks.
Proposal:
Before the first file comparison, lines beginning with anything else than diff are considered annotations for the diff file. Check how this agrees with unified diff format.
After a comparison header and before the first hunk, any line not beginning with @ or one of the standard extended header words is considered an annotation for that file comparison.
Before a hunk header, lines beginning with @ but not @@ are considered annotations for that hunk.
Before a content or snippet line, lines beginning with @ but not @@ are considered annotations for that line.
The three latter types of annotations must have matching prefix.
The text was updated successfully, but these errors were encountered:
Perhaps an annotation @=<snippet-name> for more succinct tagging of individual content lines as equal to a named snippet.
This could make it efficient to e.g. tag all changed uses and the definition for an identifier, at least in order to create merge conflicts where otherwise automatic merges produce the wrong result, and perhaps even produce correct merges. Example: One change renames a variable, another change adds a use of that variable.
There is a case for adding syntax to annotate content lines, hunks, file comparisons and diff files.
First, there is the use case of diff tools that need to communicate more semantic information than what is possible using just content and snippet lines. This might be necessary in order to make a generic merge tool that takes hintful diffs as input, for example to override the default indentation handling. It would probably be necessary to allow annotations for individual content lines.
Second, it would be good if the format could be made useful for next-generation version control software. Even if we don't expect it will be common to produce patches that work in more than one version control system, at least some consumers such as visualizers and highlighters would not care about the version control system.
Since we don't necessarily know what features might be needed for this, we might want to aim for extensibility. Unified diff format is already extensible, since comments can be inserted at least between file comparisons - this is what the compat format uses. Taking pijul as an example, it seems that it would be necessary to annotate the diff file, as well as hunks.
Proposal:
diff
are considered annotations for the diff file. Check how this agrees with unified diff format.@
or one of the standard extended header words is considered an annotation for that file comparison.@
but not@@
are considered annotations for that hunk.@
but not@@
are considered annotations for that line.The text was updated successfully, but these errors were encountered: