]> khamidou — GitHub mirrors - arcanist.git/commit
Add basic binary file support to 'arc patch'
authorepriestley <git@epriestley.com>
Sat, 21 May 2011 14:52:49 +0000 (07:52 -0700)
committerepriestley <git@epriestley.com>
Sun, 22 May 2011 13:58:16 +0000 (06:58 -0700)
commit13ea6ea5b6595a476441d375089285d961d88960
tree131ad27b2ca8d15fe5e94dfde2da435bcd69ae4b
parentf8c3a5d5555690bb98a88eac5d6096a4349ac535
Add basic binary file support to 'arc patch'

Summary:
I'm probably missing some edge cases but it took me almost 3 hours to get this
far and I think it only makes things work that didn't work before. Some stuff
like SVN binary patches still won't work, although they should be far easier to
implement.

Most of the magic here just comes from reading the git source code. It appears
to work correctly; I sprinkled printf() around git liberally and recompiled it
during development. Took me about 45 minutes to figure out that "Index" vs
"index" causes git to silently fail in a confusing way. :/

Git has a diff mode for binary changes but I don't think we lose much by always
using the full binaries. We can enhance it later if we want.

Test Plan:
Exported and patched binary changes (a picture of a duck) into a working copy.

Reviewed By: aran
Reviewers: tuomaspelkonen, jungejason, aran
CC: simpkins, aran, epriestley
Differential Revision: 327
src/parser/bundle/ArcanistBundle.php
src/parser/diff/change/ArcanistDiffChange.php
src/workflow/base/ArcanistBaseWorkflow.php
src/workflow/export/ArcanistExportWorkflow.php