Page MenuHomePhabricator

Add trailing tabs when generating synthetic Git diffs for files with spaces
ClosedPublic

Authored by epriestley on Jan 16 2018, 4:26 PM.
Tags
None
Referenced Files
F15432762: D18869.id45261.diff
Mon, Mar 24, 7:36 PM
F15416606: D18869.id.diff
Thu, Mar 20, 12:25 PM
F15409527: D18869.id45261.diff
Wed, Mar 19, 4:39 AM
F15378866: D18869.id45261.diff
Thu, Mar 13, 5:26 PM
F15333604: D18869.id45261.diff
Sat, Mar 8, 3:28 AM
F15310277: D18869.diff
Thu, Mar 6, 8:19 AM
Unknown Object (File)
Feb 24 2025, 8:11 PM
Unknown Object (File)
Feb 22 2025, 2:54 AM
Subscribers
None

Details

Summary

Fixes T8768. See PHI294. See that task for more details.

Git, Mercurial, diff, and patch have conspired to make things weird. To correctly handle files with spaces in the way everything else does and expects, we need to emit semantic trailing whitespace literals.

Test Plan
  • Created a file with spaces in it in a Mercurial repositroy, committed it, diffed it into a revision.
  • Used arc patch to apply the change to a clean copy of the repository.
  • Before patch: Mercurial incorrectly creates a file named X, not a file named X Y.txt.
  • After patch: arc patch commit is identical to genuine commit.
  • Also added test coverage. The other general behaviors here are fairly well covered already.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable