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
F19000850: D18869.diff
Fri, Nov 21, 12:55 AM
F18926346: D18869.id45257.diff
Sun, Nov 9, 7:36 PM
F18912150: D18869.id45261.diff
Sun, Nov 9, 4:43 AM
F18871757: D18869.diff
Wed, Nov 5, 12:28 AM
F18830483: D18869.diff
Sat, Oct 25, 7:01 AM
F18825602: D18869.id45257.diff
Oct 23 2025, 10:58 PM
F18819992: D18869.id.diff
Oct 22 2025, 11:40 AM
F18817531: D18869.id.diff
Oct 21 2025, 4:19 PM
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