fix(builtins): change diff default output to normal format#1022
Merged
Conversation
The diff builtin was defaulting to unified format, but real /usr/bin/diff defaults to normal (ed-style) format. Scripts parsing diff output expecting the default format got wrong results. Closes #966
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/usr/bin/diffformat_normal()implementation for ed-style output (change/add/delete commands)-uflag still produces unified formatWhy
Scripts that parse diff output expecting the default format got wrong results because bashkit defaulted to unified format while real bash/diff defaults to normal format.
Tests
test_diff_normal_format_default— verifies ed-style output and absence of unified markerstest_diff_unified_with_flag— verifies-ustill produces unified formatdiff_default_normal_formatanddiff_unified_with_flagCloses #966