This file documents the 'svnpatch' format that's used with both diff and patch subcommands. I HISTORY ------- [remind the reasons behind the design of such a new format] II DIFF SUBCOMMAND FORMATS ----------------------- 'svn diff' subcommand is provided with 3 formats: * default: useful for code reviewing * unidiff: fits better towards patch(1) use * svnpatch: supports any change III SVNPATCH FORMAT --------------- First off, let's define it. svnpatch format is made of two ordered parts: * (a) human-readable: made of unidiff bytes * (b) computer-readable: made of svn protocol bytes, gzip'ed, base64-encoded But, as we're not in a client/server configuration: - (b) only uses svn protocol's Editor Command Set, there's no need for the Main Command Set nor the Report Command Set - a client reads Editor Commands from the patch, i.e. the patch silently drives the client's editor - the only direction the information takes is from the patch to the client - svndiff1 is solely used instead of being able to choose between svndiff1 and svndiff0 Such a format can be seen as a subset of svn protocol which: - Capabilities and Edit Pipelining have nothing to do with as we can't adjust once the patch is rock-hard written in the file nor negotiate anything - commands are restricted to the Editor Command Set For more about Command Sets, consult libsvn_ra_svn/protocol. IV FORMATS DIFFERENCES ------------------- In similar use-cases, svnpatch's (a) may vary from the two other formats although they all three use unidiff. For instance, a file add is represented as a difference from /dev/null for the 'default' and 'unidiff' formats, while it's stored within (b) when using 'svnpatch' hence missing from (a). There are more, the following table compares what each format outputs against each operation: | default | unidiff | svnpatch -------------+---------+-----------+------------------------------------- file add | +++ | +++ | add-file file del | --- | --- | delete-entry file move | --- | +++ & --- | add-file w/ copy-path + delete-entry file copy | | +++ | add-file w/ copy-path | | | dir add | | | add-dir dir del | | | delete-entry dir move | | | delete-entry + add-dir w/ copy-path dir copy | | | add-dir w/ copy-path | | | file propset | +++ | | change-file-prop dir propset | --- | | change-dir-prop +++: unidiff '+' lines ---: unidiff '-' lines To keep things clear, the svnpatch column is free from opening and closing commands as well as a few others even though svnpatch uses the whole set of Editor Commands. X PATCHING -------- X FUZZING a.k.a. DYSTOPIA --------