DEADSOFTWARE

bbee7baaa06e76f9ac553f47241e2d4e1568829f
[bbdiff.git] / README
1 BlackBox diffutils
2 --------------------
4 Clone of diff and diff3 utilites from *nix for BlackBox and its binary Compound Document format.
7 Commands
8 --------------------
10 To use tools within Blackbox just compile DiffBase and DiffUtils.
12 DiffUtils.Compare (guard TextCmds.FocusGuard)
14 Compare texts from two windows.
15 You can directly replace DevSearch.Compare with DiffUtils.Compare in Dev/Rsrc/Menus.odc.
18 ^Q DiffUtils.CompareThis <old> <new> [">" <outfile>]
20 Compare two files and produce patch in unified diff format.
23 ^Q DiffUtils.MergeThis <my> <old> <your> [">" <outfile>]
25 Read three files and do three-way merge like diff3.
28 Dedicated tool
29 --------------------
31 You can read, create diffs and merge documents from command line using odctool.
32 To build it, open DiffMain and execute commanders at the end of document.
33 Call `odctool help` to learn how to use it.
36 Integration with git
37 --------------------
39 1. Compile odctool.
41 2. Create script odctool-gitdiff:
43 #! /bin/sh
44 odctool diff -C -p "$1" "$2" "$5"
46 3. Add to .git/config:
48 [merge "odctool"]
49 name = BlackBox Compound Document merge driver
50 driver = odctool merge -p %P -o %A %A %O %B
51 [diff "odctool"]
52 name = BlackBox Compound Document diff driver
53 command = odctool-gitdiff
55 4. Add to .git/info/attributes:
57 *.odc merge=odctool diff=odctool
60 5. Optionally you can ignore some BlackBox related files if add to .git/info/exclude:
62 *.ocf
63 *.osf
64 odc[0-9][0-9][0-9][0-9][0-9]
67 Now you can see diffs using `git diff' and resolve conflicts without converting odc to text.
70 Integration with ranger
71 -----------------------
73 1. To preview documents add to $HOME/.config/ranger/scope.sh:
75 handle_extension() {
76 case "${FILE_EXTENSION_LOWER}" in
78 ...
80 # BlackBox Compound Document
81 odc)
82 odctool -C cat "${FILE_PATH}" && exit 5
83 exit 1;;
84 esac
85 }
87 2. To open/read documents add to $HOME/.config/ranger/rifle.conf:
89 ext odc, has odctool, terminal, file = odctool -C cat "$1" | less --tabs=2 -S
92 Current state
93 --------------------
95 This is NOT final version of subsustem Diff and odctool. It is NOT well tested, you are warned!
96 Also, program and user interfaces are not stable yet, so it can be changed in future.