Seems obvious in retrospect.
Description
Revisions and Commits
rARC Arcanist | |||
D19081 | rARCbe1dd7e2ba23 Robustly fuse files together with `arc weld` |
Related Objects
Event Timeline
This will further familiarize you with arc. This may make sense to hold until some time after T5055, when arc workflows may change a bit. See also T11429.
My best idea for the behavior of arc weld is to work like cat, except overlap the characters of the leading and trailing lines of each file randomly (for each <line, character> position, randomly select the character from either the first or second file, creating an alloyed region where both files are equally represented). This makes sense with the weld command thematically, and has the distinct benefit of being utterly useless.
For example, if you have this file:
XXXXX XXXXX XXXXX XXXXX XXXXX
...and this file:
YYYYY YYYYY YYYYY YYYYY YYYYY
...and you ran cat x.txt y.txt, you'd get this output:
XXXXX XXXXX XXXXX XXXXX XXXXX YYYYY YYYYY YYYYY YYYYY YYYYY
But if you ran arc weld x.txt y.txt, imagine getting this output!
XXXXX XXXXX XXXXX XYYXY YXYYX YYYYY YYYYY YYYYY
The files have been welded together! Amazing!
(You are free to choose any other behavior -- even a useful one -- the requirement is only that arc weld do something.)
This should clearly be priority: Unbreak now!
Such useful.
Also, arc weld should support a few cli arguments:
--mig - merge the result into your git repository
--tig - diff against the repository and pipe the output through tig