X-Git-Url: https://deadsoftware.ru/gitweb?p=bbdiff.git;a=blobdiff_plain;f=README;h=a7ec05ec822cc20d7fc6edb89766f9029714f1a8;hp=e1a4e4f1f68f1a4c1f688f9f02f4fe6eb553335b;hb=4dcb80cd11534f62778c713df546406329385aaf;hpb=2f235fa54dcaea28273924a08137cb8a70facfd2 diff --git a/README b/README index e1a4e4f..a7ec05e 100644 --- a/README +++ b/README @@ -1,24 +1,95 @@ BlackBox diffutils -------------------- -Clone of diff, patch and diff3 utilites from *nix for BlackBox and its binary document format. +Clone of diff and diff3 utilites from *nix for BlackBox and its binary Compound Document format. -Building + +Commands -------------------- -Just compile module DevDiff. +To use tools within Blackbox just compile DiffBase and DiffUtils. + +DiffUtils.Compare (guard TextCmds.FocusGuard) + + Compare texts from two windows. + You can directly replace DevSearch.Compare with DiffUtils.Compare in Dev/Rsrc/Menus.odc. + + +^Q DiffUtils.CompareThis [">" ] + + Compare two files and produce patch in unified diff format. + + +^Q DiffUtils.MergeThis [">" ] + + Read three files and do three-way merge like diff3. -Usage + +Dedicated tool +-------------------- + +You can read, create diffs and merge documents from command line using odctool. +To build it, open DiffMain and execute commanders at the end of document. +Call `odctool help` to learn how to use it. + + +Integration with Git -------------------- -See sources. Documentation not writed yet. -Coomand DevDiff.Compare compare texts from two windows (link DevSearchCompare). -Command DevDiff.CompareThis compare two files and produce patch in unified diff format. -Command DevDiff.PatchThis read patch in unified diff format and apply changes from it. -Command DevDiff.MergeThis read three files and do thee-way merge. +1. Compile odctool. + +2. Create script odctool-gitdiff: + + #! /bin/sh + odctool diff -C -p "$1" "$2" "$5" + +3. Add to .git/config: + + [merge "odctool"] + name = BlackBox Compound Document merge driver + driver = /path/to/odctool merge -p %P -o %A %A %O %B + [diff "odctool"] + name = BlackBox Compound Document diff driver + command = /path/to/odctool-gitdiff + +4. Add to .git/info/attributes: + + *.odc merge=odctool diff=odctool + + +5. Optionally you can ignore some BlackBox related files if add to .git/info/exclude: + + *.ocf + *.osf + odc[0-9][0-9][0-9][0-9][0-9] + +Now you can see diffs using `git diff' and resolve conflicts from BlackBox. + + +Integration with ranger +----------------------- + +1. To preview documents add to $HOME/.config/ranger/scope.sh: + + handle_extension() { + case "${FILE_EXTENSION_LOWER}" in + + ... + + # BlackBox Compound Document + odc) + odctool -C cat "${FILE_PATH}" && exit 5 + exit 1;; + esac + } + +2. To open/read documents add to $HOME/.config/ranger/rifle.conf: + + ext odc, has odctool, terminal, file = odctool -C cat "$1" | less --tabs=2 -S + Current state -------------------- -This is NOT final version of module DevDiff. It is NOT well tested, but it works. You are warned! -Todo list see at the and of sources. +This is NOT final version of subsustem Diff and odctool. It is NOT well tested, you are warned! +Also, program and user interfaces are not stable yet, so it can be changed in future.