diff
A fundamental concept in version control that presents differences between two versions in a unified format, using `-` for deleted lines, `+` for added lines and `@@` to mark change locations. It can compress context and focus review.
Core Facts
Timeline (last 90 days)
The changes delivered by the Agent are presented as a diff: green lines represent additions, red lines represent deletions, and unmarked lines are context lines.
Writing the acceptance criteria into the prompt is equivalent to defining the expected shape of the diff in advance, so during review you only need to compare against the expectation to judge whether the changes are reasonable.
diff originally came from the Unix diff command, and today it is built into Git, GitHub Pull Request, and various IDEs.
To obtain a meaningful view of changes, it is usually necessary to first parse legal text into a structured format (such as XML or JSON) and then compare differences at the structural level, rather than directly running diff on plain text.
Traditional code review tools only show the diff, hiding a great deal of context (such as the behavior of called functions, module dependencies, and historical conventions) when facing an unfamiliar repository, which is insufficient to support reading through an entire codebase.
A diff is a standardized format in version control systems for representing changes between two versions, typically marking additions (+), deletions (-), and context on a line-by-line basis.
To avoid unexpected sweeping changes by AI, explicitly constrain the scope of changes in the prompt (such as "only change this function, don't touch other files") and review the diff line by line before committing.
Sphinx generates targeted questions around the diff content of the current commit.
If a commit mixes formatting, renaming, and logic changes, the noise in the diff increases, and the targeting of question generation is affected.
For Sphinx, the diff is the most critical input for generating quiz questions, defining the scope of the current change.
17 more timeline events
All Facts (20)
A pull request (PR) is a core mechanism of modern software collaboration, in which a developer completes work on an independent branch and then submits a merge request to the main codebase, which is merged after code review.
75%UnverifiedUnix系统中的diff工具由Douglas McIlroy在1974年开发,其核心算法是最长公共子序列(LCS)
85%UnverifiedWriting the acceptance criteria into the prompt is equivalent to defining the expected shape of the diff in advance, so during review you only need to compare against the expectation to judge whether the changes are reasonable.
50%UnverifiedThe changes delivered by the Agent are presented as a diff: green lines represent additions, red lines represent deletions, and unmarked lines are context lines.
50%Unverifieddiff originally came from the Unix diff command, and today it is built into Git, GitHub Pull Request, and various IDEs.
50%UnverifiedTo obtain a meaningful view of changes, it is usually necessary to first parse legal text into a structured format (such as XML or JSON) and then compare differences at the structural level, rather than directly running diff on plain text.
50%UnverifiedTraditional code review tools only show the diff, hiding a great deal of context (such as the behavior of called functions, module dependencies, and historical conventions) when facing an unfamiliar repository, which is insufficient to support reading through an entire codebase.
50%UnverifiedA diff is a standardized format in version control systems for representing changes between two versions, typically marking additions (+), deletions (-), and context on a line-by-line basis.
50%UnverifiedTo avoid unexpected sweeping changes by AI, explicitly constrain the scope of changes in the prompt (such as "only change this function, don't touch other files") and review the diff line by line before committing.
50%UnverifiedIf a commit mixes formatting, renaming, and logic changes, the noise in the diff increases, and the targeting of question generation is affected.
50%UnverifiedSphinx generates targeted questions around the diff content of the current commit.
50%UnverifiedFor Sphinx, the diff is the most critical input for generating quiz questions, defining the scope of the current change.
50%UnverifiedThe Skill does not treat the diff as the scope of activity, but instead asks the reviewer to start from the changes and look for improvement opportunities across the entire codebase.
50%UnverifiedBy stripping outputs and metadata, passing only code-cell diffs, and replacing overly long lines with length+hash, the token consumption per notebook review can be cut from about 30k to 1k–1.6k, a reduction of over 95%.
50%UnverifiedIn the notebook scenario, diff granularity typically falls at the cell level (since cells can be arbitrarily added, deleted, reordered, and modified), and then line-level diff is performed on the source lines within a cell.
50%UnverifiedFor an LLM, a diff not only saves tokens but also constrains the model's attention to the current changes, avoiding the large amount of unchanged logic in the full code diluting the review focus.
50%UnverifiedThe diff strategy applies only to iterative review workflows; when first getting a model to understand the entire project structure, a certain amount of full context is still required, and diff does not apply.
50%UnverifiedA diff refers to the set of added and removed lines in a commit or a PR relative to the baseline version; reviewers actually read the diff rather than the complete files.
50%UnverifiedDiff comparison is a core function of version control tools, comparing two text files line by line and highlighting added, deleted, or modified parts.
50%UnverifiedBinary or rich-format files such as PDF, Word, and Excel are opaque byte streams, and diff tools cannot perform meaningful line-by-line comparisons on them.
50%