Title: "Old" filename in patch files generated for testing does not exist and can cause failures · Issue #223 · uutils/diffutils · GitHub
Open Graph Title: "Old" filename in patch files generated for testing does not exist and can cause failures · Issue #223 · uutils/diffutils
X Title: "Old" filename in patch files generated for testing does not exist and can cause failures · Issue #223 · uutils/diffutils
Description: Most patch files generated for testing start like this: --- a/alef 2026-05-05 17:02:25.388687288 -0400 +++ target/unified-diff//alef 2026-05-05 17:02:25.388687288 -0400 ... Note patch does not use TWO filenames; it uses only one name bec...
Open Graph Description: Most patch files generated for testing start like this: --- a/alef 2026-05-05 17:02:25.388687288 -0400 +++ target/unified-diff//alef 2026-05-05 17:02:25.388687288 -0400 ... Note patch does not use ...
X Description: Most patch files generated for testing start like this: --- a/alef 2026-05-05 17:02:25.388687288 -0400 +++ target/unified-diff//alef 2026-05-05 17:02:25.388687288 -0400 ... Note patch does not use ...
Opengraph URL: https://github.com/uutils/diffutils/issues/223
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Old\" filename in patch files generated for testing does not exist and can cause failures","articleBody":"Most patch files generated for testing start like this:\n\n```diff\n--- a/alef\t2026-05-05 17:02:25.388687288 -0400\n+++ target/unified-diff//alef\t2026-05-05 17:02:25.388687288 -0400\n...\n```\n\nNote `patch` does not use TWO filenames; it uses only one name because it patches files \"in place\". But `patch` input == `diff` output and it makes sense for `diff` output to have \"old\" _and_ \"new\" filenames.\n\n`a/alef` does not normally not exist and tests normally pass because GNU patch silently falls back on the \"new\" filename. Except when `a/alef` exists, and then the corresponding test(s) to fail.\n\nhttps://www.gnu.org/software/diffutils/manual/html_node/Multiple-Patches.html documents GNU precedence and that the \"old\" file name has precedence over the \"new\" filename.\n\nTrivial reproduction:\n\n```\ncd diffutils\nmkdir a\ntouch a/alef a/alefn a/alef_ a/alefx a/alefr a/fuzz.file\ncargo test\n\n\n---- context_diff::tests::test_permutations stdout ----\n\nthread 'context_diff::tests::test_permutations' (98977) panicked at src/context_diff.rs:458:33:\nOutput { status: ExitStatus(unix_wait_status(256)), stdout: \"patching file a/alef\\nHunk #1 FAILED at 1.\\n1 out of 1 hunk FAILED -- saving rejects to file a/alef.rej\\n\", stderr: \"\" }\n```\n\nI hit this problem because some other (and unfortunately unknown) test issue left bogus `a/alef*` file(s) behind in my workspace. I didn't bother cleaning them up because I assumed some test would keep recreating them - and that cost me a lot of time.\n\n","author":{"url":"https://github.com/marc-hb","@type":"Person","name":"marc-hb"},"datePublished":"2026-05-05T21:28:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/223/diffutils/issues/223"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6c6a1422-c41b-2c10-7a87-e4f1fbead61d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E010:391A54:83F167:B4DB58:6A4DB666 |
| html-safe-nonce | 34ef89b54fad150dbcc4e1021b1681c193f8497f77419592e2f327bd16ae3a6c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDEwOjM5MUE1NDo4M0YxNjc6QjREQjU4OjZBNERCNjY2IiwidmlzaXRvcl9pZCI6IjE3NzExMjYxMDY3MDA0OTQ0MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4a9433cef53dd417389b6cf289e20d054fae65dfcff9505cc0fe9695ff36652e |
| hovercard-subject-tag | issue:4387216254 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/uutils/diffutils/223/issue_layout |
| twitter:image | https://opengraph.githubassets.com/282779d0c7f77d5562776c894c6de0644c235a18d9ee4c49779f381ddc507ab6/uutils/diffutils/issues/223 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/282779d0c7f77d5562776c894c6de0644c235a18d9ee4c49779f381ddc507ab6/uutils/diffutils/issues/223 |
| og:image:alt | Most patch files generated for testing start like this: --- a/alef 2026-05-05 17:02:25.388687288 -0400 +++ target/unified-diff//alef 2026-05-05 17:02:25.388687288 -0400 ... Note patch does not use ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | marc-hb |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/uutils/diffutils git https://github.com/uutils/diffutils.git |
| octolytics-dimension-user_id | 5148717 |
| octolytics-dimension-user_login | uutils |
| octolytics-dimension-repository_id | 341787720 |
| octolytics-dimension-repository_nwo | uutils/diffutils |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 341787720 |
| octolytics-dimension-repository_network_root_nwo | uutils/diffutils |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32f7b614aca06e6bbd89842b1370df1328264f68 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width