Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@altsem
Copy link
Owner

@altsem altsem commented Feb 25, 2025

This aims to start the over-haul of the
diffing/highlighting/patch-generation of Gitu.

  • Remove hard dependency of Ratatui in this layer.
  • Reduce cloning/joining strings together, might mess something up.
  • Simplify inline-diffing (use the original line-diff output instead of redundantly diffing files again).
  • Simplify merging of styles.

Also, Gitu being able to parse diffs/patches
opens up possibilities for some better CLI use-cases:

git diff | gitu

@altsem altsem force-pushed the refactor/better-diffing branch 2 times, most recently from 01c50f8 to 744f60b Compare February 27, 2025 16:51
@codecov
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 91.85668% with 75 lines in your changes missing coverage. Please review.

Project coverage is 87.57%. Comparing base (c772624) to head (e49a37d).
Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
gitu-diff/src/lib.rs 91.88% 25 Missing ⚠️
src/highlight.rs 91.76% 20 Missing ⚠️
src/ops/show.rs 0.00% 11 Missing ⚠️
src/git/diff.rs 85.93% 9 Missing ⚠️
src/ops/unstage.rs 50.00% 6 Missing ⚠️
src/git/mod.rs 94.44% 2 Missing ⚠️
src/ops/stage.rs 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
- Coverage   87.71%   87.57%   -0.15%     
==========================================
  Files          63       65       +2     
  Lines        5627     5965     +338     
==========================================
+ Hits         4936     5224     +288     
- Misses        691      741      +50     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

altsem added 24 commits March 27, 2025 20:43
 This aims to start the over-haul of the
diffing/highlighting/patch-generation of Gitu.

- Remove hard dependency of Ratatui in this layer.
- Reduce cloning/joining strings together, might mess something up.
- Simplify inline-diffing (use the original line-diff
output instead of redundantly diffing files again).
- Simplify merging of styles.

Also, Gitu being able to parse diffs/patches
opens up possibilities for some better CLI use-cases:
```sh
git diff | gitu
```
apparently git scans for zeroes in the first few bytes of the file
@altsem altsem force-pushed the refactor/better-diffing branch from 8fefa1b to e49a37d Compare March 27, 2025 19:46
@altsem altsem changed the title wip: more efficient/sane diff repr refactor: more efficient/sane diff repr Mar 27, 2025
@altsem altsem requested a review from Copilot March 27, 2025 19:47

This comment was marked as spam.

@altsem altsem marked this pull request as ready for review March 27, 2025 19:54
@altsem altsem enabled auto-merge (rebase) March 27, 2025 20:00
@altsem altsem disabled auto-merge March 27, 2025 20:00
@altsem altsem merged commit 6c14511 into master Mar 27, 2025
5 checks passed
@altsem altsem deleted the refactor/better-diffing branch March 27, 2025 20:00
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