René's URL Explorer Experiment


Title: Create the side-by-side option (-y) feature for the diff command (Incomplete) by sami-daniel · Pull Request #117 · uutils/diffutils · GitHub

Open Graph Title: Create the side-by-side option (-y) feature for the diff command (Incomplete) by sami-daniel · Pull Request #117 · uutils/diffutils

X Title: Create the side-by-side option (-y) feature for the diff command (Incomplete) by sami-daniel · Pull Request #117 · uutils/diffutils

Description: Create the function, in the utils package, limited_string that allows you to truncate a string based on a delimiter (May break the encoding of the character where it was cut) Create tests for limited_string function Add support for -y and --side-by-side flags that enables diff output for side-by-side mode Create implementation of the diff -y (SideBySide) command, base command for sdiff, using the crate diff as engine. Currently it does not fully represent GNU diff -y, some flags (|, (, ), , /) could not be developed due to the limitation of the engine we currently use (crate diff), which did not allow perform logic around it. Only the use of '<' and '>' were enabled. TL;DR A new limited_string function was added to the utils package, allowing strings to be truncated based on a delimiter (note: this may break character encoding at the cut point). Unit tests were created to ensure correct behavior of the function. Support for the -y and --side-by-side flags was added to enable side-by-side diff output. The SideBySide implementation, serving as the base for the sdiff command, was developed using the diff crate as the comparison engine. Due to limitations of the crate, only the < and > markers are currently supported—other markers like |, (, ),\ and / could not be implemented. Clarification The main goal of the limited_string function is to simplify and standardize the process of truncating strings for everyone working on the project. The idea was to provide a utility that anyone could use without having to reimplement or worry too much about string manipulation logic. However, a known limitation of the current implementation is that it can break character encoding, especially when the cut happens mid-way through a multi-byte character (e.g., in UTF-8). I am open to suggestions on how to improve or safely handle encoding, whether by detecting boundaries or using a safer string-splitting strategy that respects character integrity. Regarding the SideBySide implementation: I recognize that the output and edit script provided by the diff crate is limited. These limitations currently prevent us from supporting additional characters such as |, (, ), , or / that are used in GNU diff -y to more accurately reflect changes in lines. For this initial version, I think the use of < and >, are sufficient for a first pass of side-by-side comparison. Moving forward, I did like to open a follow-up issue where we can evaluate better strategies (possibly even considering another diff engine) to handle richer diff representations and support for the missing symbols. Suggestions and ideas are very welcome!

Open Graph Description: Create the function, in the utils package, limited_string that allows you to truncate a string based on a delimiter (May break the encoding of the character where it was cut) Create tests for lim...

X Description: Create the function, in the utils package, limited_string that allows you to truncate a string based on a delimiter (May break the encoding of the character where it was cut) Create tests for lim...

Opengraph URL: https://github.com/uutils/diffutils/pull/117

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0c8c39d1-dc2d-2c88-c3e8-bf1f223dbd90
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8BA8:34DB2:871F52:C63516:6A4E123C
html-safe-nonce49913917e48a7f87d61e6a36e08df21fe06a5744d53ef75bb27d242930fbeac5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkE4OjM0REIyOjg3MUY1MjpDNjM1MTY6NkE0RTEyM0MiLCJ2aXNpdG9yX2lkIjoiOTE3ODI0Njc4NDM1NDIyNjc0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace0353c9d69b0a4eadd7b9aac56d88ea80ca35c60cef6051ac72132227337bc77
hovercard-subject-tagpull_request:2474041943
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/uutils/diffutils/pull/117/files
twitter:imagehttps://avatars.githubusercontent.com/u/130937402?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/130937402?s=400&v=4
og:image:altCreate the function, in the utils package, limited_string that allows you to truncate a string based on a delimiter (May break the encoding of the character where it was cut) Create tests for lim...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/uutils/diffutils git https://github.com/uutils/diffutils.git
octolytics-dimension-user_id5148717
octolytics-dimension-user_loginuutils
octolytics-dimension-repository_id341787720
octolytics-dimension-repository_nwouutils/diffutils
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id341787720
octolytics-dimension-repository_network_root_nwouutils/diffutils
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseea9187571e3edc5f2780f750631138669441ca50
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/uutils/diffutils/pull/117/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fuutils%2Fdiffutils%2Fpull%2F117%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fuutils%2Fdiffutils%2Fpull%2F117%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=uutils%2Fdiffutils
Reloadhttps://github.com/uutils/diffutils/pull/117/files
Reloadhttps://github.com/uutils/diffutils/pull/117/files
Reloadhttps://github.com/uutils/diffutils/pull/117/files
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
uutils https://github.com/uutils
diffutilshttps://github.com/uutils/diffutils
Notifications https://github.com/login?return_to=%2Fuutils%2Fdiffutils
Fork 35 https://github.com/login?return_to=%2Fuutils%2Fdiffutils
Star 270 https://github.com/login?return_to=%2Fuutils%2Fdiffutils
Code https://github.com/uutils/diffutils
Issues 20 https://github.com/uutils/diffutils/issues
Pull requests 12 https://github.com/uutils/diffutils/pulls
Actions https://github.com/uutils/diffutils/actions
Projects https://github.com/uutils/diffutils/projects
Security and quality 0 https://github.com/uutils/diffutils/security
Insights https://github.com/uutils/diffutils/pulse
Code https://github.com/uutils/diffutils
Issues https://github.com/uutils/diffutils/issues
Pull requests https://github.com/uutils/diffutils/pulls
Actions https://github.com/uutils/diffutils/actions
Projects https://github.com/uutils/diffutils/projects
Security and quality https://github.com/uutils/diffutils/security
Insights https://github.com/uutils/diffutils/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fuutils%2Fdiffutils%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fuutils%2Fdiffutils%2Fissues%2Fnew%2Fchoose
sylvestrehttps://github.com/sylvestre
uutils:mainhttps://github.com/uutils/diffutils/tree/main
sami-daniel:mainhttps://github.com/sami-daniel/diffutils/tree/main
Conversation 14 https://github.com/uutils/diffutils/pull/117
Commits 6 https://github.com/uutils/diffutils/pull/117/commits
Checks 28 https://github.com/uutils/diffutils/pull/117/checks
Files changed https://github.com/uutils/diffutils/pull/117/files
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
Create the side-by-side option (-y) feature for the diff command (Incomplete) https://github.com/uutils/diffutils/pull/117/files#top
Show all changes 6 commits https://github.com/uutils/diffutils/pull/117/files
8105420 Create the side-by-side option (-y) feature for the diff command (Inc… sami-daniel Apr 19, 2025 https://github.com/uutils/diffutils/pull/117/commits/8105420bb4b665763cca72ec0b9851906fc85ad1
dff98a2 fix(deps): update rust crate chrono to v0.4.41 renovate[bot] Apr 29, 2025 https://github.com/uutils/diffutils/pull/117/commits/dff98a29695ddab3ff7e010e16484c0356bf8021
1ef6923 Add side by side diff (partial) sami-daniel May 26, 2025 https://github.com/uutils/diffutils/pull/117/commits/1ef6923b7dac69edb3b6044d5842d21ccc78bed0
a3e57c9 chore(deps): update rust crate tempfile to v3.20.0 renovate[bot] May 11, 2025 https://github.com/uutils/diffutils/pull/117/commits/a3e57c950ef149e7cec1bd08e93b27f8ea013859
45b3072 Configure CI fuzzer for fuzz_side sami-daniel May 26, 2025 https://github.com/uutils/diffutils/pull/117/commits/45b3072534bbe7e48042986a2af964917edf26a2
fce0881 Merge branch 'main' into main sami-daniel Jun 3, 2025 https://github.com/uutils/diffutils/pull/117/commits/fce0881e276b7cbcc5a197ac91d45688ffda6fbe
Clear filters https://github.com/uutils/diffutils/pull/117/files
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
fuzzing.yml https://github.com/uutils/diffutils/pull/117/files#diff-0d1818478ed3978a08c330da0345293a51e13da847c4f41d494b346c3615b94c
Cargo.toml https://github.com/uutils/diffutils/pull/117/files#diff-adb6b77ef7d25080f602acb615fefc7d47e8e1321ee09759aae8a4eba6c4ae4b
fuzz_side.rs https://github.com/uutils/diffutils/pull/117/files#diff-db8e2bd75f5e1c888b7a3e4e6dab665dc64d4892880c10bbb4d42a466fc49ef1
diff.rs https://github.com/uutils/diffutils/pull/117/files#diff-25b61929ffc58aa6b4baa8b06a41448eb83835e05c325863e58df00ed841b2d4
lib.rs https://github.com/uutils/diffutils/pull/117/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759
main.rs https://github.com/uutils/diffutils/pull/117/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fc
params.rs https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
side_diff.rs https://github.com/uutils/diffutils/pull/117/files#diff-eb16715bf96f80035d1c61cf6ad9e7df58655179fd69ffaa66f3c6e50e8f08f2
utils.rs https://github.com/uutils/diffutils/pull/117/files#diff-23af5356f6001cd3993cd3c801fb7716ea02d1e504081b9fb569332db6107e80
.github/workflows/fuzzing.ymlhttps://github.com/uutils/diffutils/pull/117/files#diff-0d1818478ed3978a08c330da0345293a51e13da847c4f41d494b346c3615b94c
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/.github/workflows/fuzzing.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
https://github.com/uutils/diffutils/pull/117/files#diff-0d1818478ed3978a08c330da0345293a51e13da847c4f41d494b346c3615b94c
https://github.com/uutils/diffutils/pull/117/files#diff-0d1818478ed3978a08c330da0345293a51e13da847c4f41d494b346c3615b94c
fuzz/Cargo.tomlhttps://github.com/uutils/diffutils/pull/117/files#diff-adb6b77ef7d25080f602acb615fefc7d47e8e1321ee09759aae8a4eba6c4ae4b
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/fuzz/Cargo.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
https://github.com/uutils/diffutils/pull/117/files#diff-adb6b77ef7d25080f602acb615fefc7d47e8e1321ee09759aae8a4eba6c4ae4b
fuzz/fuzz_targets/fuzz_side.rshttps://github.com/uutils/diffutils/pull/117/files#diff-db8e2bd75f5e1c888b7a3e4e6dab665dc64d4892880c10bbb4d42a466fc49ef1
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/fuzz/fuzz_targets/fuzz_side.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
Copilothttps://github.com/apps/copilot-pull-request-reviewer
May 27, 2025https://github.com/uutils/diffutils/pull/117/files#r2109552631
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
Copilothttps://docs.github.com/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-code-review
sami-danielhttps://github.com/sami-daniel
May 27, 2025https://github.com/uutils/diffutils/pull/117/files#r2109775853
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
src/diff.rshttps://github.com/uutils/diffutils/pull/117/files#diff-25b61929ffc58aa6b4baa8b06a41448eb83835e05c325863e58df00ed841b2d4
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/src/diff.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
https://github.com/uutils/diffutils/pull/117/files#diff-25b61929ffc58aa6b4baa8b06a41448eb83835e05c325863e58df00ed841b2d4
https://github.com/uutils/diffutils/pull/117/files#diff-25b61929ffc58aa6b4baa8b06a41448eb83835e05c325863e58df00ed841b2d4
https://github.com/uutils/diffutils/pull/117/files#diff-25b61929ffc58aa6b4baa8b06a41448eb83835e05c325863e58df00ed841b2d4
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/files#diff-25b61929ffc58aa6b4baa8b06a41448eb83835e05c325863e58df00ed841b2d4
src/lib.rshttps://github.com/uutils/diffutils/pull/117/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/src/lib.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
https://github.com/uutils/diffutils/pull/117/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759
src/main.rshttps://github.com/uutils/diffutils/pull/117/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fc
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/src/main.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
https://github.com/uutils/diffutils/pull/117/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fc
https://github.com/uutils/diffutils/pull/117/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fc
src/params.rshttps://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
View file https://github.com/sami-daniel/diffutils/blob/fce0881e276b7cbcc5a197ac91d45688ffda6fbe/src/params.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/uutils/diffutils/pull/117/{{ revealButtonHref }}
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/checks?check_run_id=43379831615
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
https://github.com/uutils/diffutils/pull/117/files#diff-96db4c2e87979d88bcea716895d0d011b21c2243b7c1e2175e73a25259e43578
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
Please reload this pagehttps://github.com/uutils/diffutils/pull/117/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.