DEADSOFTWARE

added integration with git diff
[bbdiff.git] / README
diff --git a/README b/README
index 24217a5f6875293bee9d3550aa505bfd0fdae46a..a2a699ccbfc132613ea9ca8d25c9ac73858a2442 100644 (file)
--- a/README
+++ b/README
@@ -1,22 +1,74 @@
 BlackBox diffutils
 --------------------
 
-Clone of diff and patch 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
+--------------------
+
+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 <oldfile> <newfile> [">" <outfile>]
+
+       Compare two files and produce patch in unified diff format.
+
+
+^Q DiffUtils.MergeThis <my> <old> <your> [">" <outfile>]
+
+       Read three files and do three-way merge like diff3.
+
+
+Dedicated tool
 --------------------
 
-Just compile module DevDiff.
+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.
 
-Usage
+
+Integration with Git
 --------------------
 
-See sources. Documentation not writed yet.
-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.
+1. Compile odctool.
+
+2. Create script odctool-gitdiff:
+
+       #! /bin/sh
+       odctool diff -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.
+
 
 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.