-
Notifications
You must be signed in to change notification settings - Fork 49
Comparing changes
Open a pull request
base repository: banga/git-split-diffs
base: main
head repository: banga/git-split-diffs
compare: handle-combined-diffs
- 9 commits
- 9 files changed
- 1 contributor
Commits on Jul 1, 2024
-
Checkpoint generalizing to hunks with more than two "parts"
The parts here refer essentially to commits. In a combined diff, there are at least 3 commits in consideration.
Configuration menu - View commit details
-
Copy full SHA for c2a17dc - Browse repository at this point
Copy the full SHA c2a17dcView commit details -
Checkpoint working combined diffs implementation
Took a while to come up with something that looks correct. Essentially we show the final state as the last "part" i.e. vertical section and the rest of the parts show changes made in the corresponding parent commit. The line width is currently incorrect, will fix later.
Configuration menu - View commit details
-
Copy full SHA for 57dc242 - Browse repository at this point
Copy the full SHA 57dc242View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ce04f9 - Browse repository at this point
Copy the full SHA 8ce04f9View commit details -
Implement unified diff rendering for combined diffs
The naming is getting confusing here, but the approach we had for rendering a unified diff for "unified diffs" wasn't great for "combined diffs" because it would end up repeating additions/deletions. So, I added a separate implementation which essentially renders what you would see in the last column of the split diff. This required showing deletions in the split diff as well, which I had previously skipped. I think that still looks fine, so will let it be.
Configuration menu - View commit details
-
Copy full SHA for 4f38cb9 - Browse repository at this point
Copy the full SHA 4f38cb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for de57f10 - Browse repository at this point
Copy the full SHA de57f10View commit details -
Handle more than 2 parents in combined diffs
The "@"s in the header vary by number of parents, so we need to handle that.
Configuration menu - View commit details
-
Copy full SHA for 0c62e0f - Browse repository at this point
Copy the full SHA 0c62e0fView commit details -
Switch how we show deleted lines in combined diffs
On re-reading "A - character in the column N means that the line appears in fileN but it does not appear in the result.", we should be showing the line in the files where it has a '-' prefix and not showing it in other files.
Configuration menu - View commit details
-
Copy full SHA for 93cd259 - Browse repository at this point
Copy the full SHA 93cd259View commit details -
Add test cases for merge commits
Found some commits in the TypeScript repo that have non-empty combined diffs using: ``` git rev-list --merges --all --min-parents=2 | while read commit; do if [ -n "$(git show --format='' $commit)" ]; then echo $commit; fi; done ```
Configuration menu - View commit details
-
Copy full SHA for 787ea90 - Browse repository at this point
Copy the full SHA 787ea90View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e342c4 - Browse repository at this point
Copy the full SHA 4e342c4View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...handle-combined-diffs