Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eas-cli] fix git diff header in fingerprint:compare #2915

Merged

Conversation

quinlanj
Copy link
Member

@quinlanj quinlanj commented Feb 21, 2025

Why

The current git-style diff output in the fingerprint diff utility shows incorrect line numbers in the chunk headers. This affects the readability and accuracy of diff representations when comparing fingerprints.

How

Updated the chunk header calculation in fingerprintDiff.ts to properly account for context lines when determining the line ranges. The fix adjusts both the starting position and total line count by incorporating the context lines in the calculations.

The changes ensure that:

  • Starting positions are offset by the number of prior context lines
  • Total line counts include both context lines and modified lines
  • Default starting position is 1 when undefined

Test Plan

  • Ran EXPO_STAGING=1 ~/Documents/eas-cli/packages/eas-cli/bin/run fingerprint:compare 796b89315aeaa4b466aa3ac6c2dcff5cf9ed4c8e d5de1b929c0346251e400eed13205fda4eaf51bf and ensure diff header is correct

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

github-actions bot commented Feb 21, 2025

Size Change: +2.35 kB (0%)

Total Size: 53.5 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.5 MB +2.35 kB (0%)

compressed-size-action

@quinlanj quinlanj requested a review from szdziedzic February 21, 2025 21:29
@quinlanj quinlanj marked this pull request as ready for review February 21, 2025 21:29
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @sjchmiela, @radoslawkrzemien

Generated by CodeMention

@quinlanj quinlanj force-pushed the 02-21-_eas-cli_fix_git_diff_header_in_fingerprint_compare branch from 6a873d8 to 0d74622 Compare February 24, 2025 20:01
Copy link

✅ Thank you for adding the changelog entry!

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.64%. Comparing base (3ac6472) to head (0d74622).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2915      +/-   ##
==========================================
+ Coverage   52.63%   52.64%   +0.01%     
==========================================
  Files         588      588              
  Lines       23202    23203       +1     
  Branches     4860     4860              
==========================================
+ Hits        12211    12212       +1     
  Misses      10022    10022              
  Partials      969      969              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@quinlanj quinlanj merged commit 1b713af into main Feb 24, 2025
11 checks passed
@quinlanj quinlanj deleted the 02-21-_eas-cli_fix_git_diff_header_in_fingerprint_compare branch February 24, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants