]> arthur.barton.de Git - bup.git/commitdiff
Add a trivial hjoin, the reverse of hsplit.
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 4 Oct 2009 00:38:43 +0000 (20:38 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 4 Oct 2009 00:39:05 +0000 (20:39 -0400)
Makefile
hjoin.sh [new file with mode: 0755]

index 0e36d1d1cc5dc98a6685d6be0cb0c4b28f1e3ab6..72733b39a0f208cde53b8f575faef1f876b094e4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,16 @@ hsplit: hsplit.o
 
 hjoin: hjoin.sh
 
-test: hsplit
+test: hsplit hjoin
        ./hsplit <testfile1 >tags1
        ./hsplit <testfile2 >tags2
-       diff -u -U50 tags1 tags2
+       diff -u -U50 tags1 tags2 || true
+       wc -c testfile1 testfile2
+       wc -l tags1 tags2
+       ./hjoin <tags1 >out1
+       ./hjoin <tags2 >out2
+       diff -u testfile1 out1
+       diff -u testfile2 out2
 
 %: %.o
        gcc -o $@ $< $(LDFLAGS) $(LIBS)
diff --git a/hjoin.sh b/hjoin.sh
new file mode 100755 (executable)
index 0000000..b04ad43
--- /dev/null
+++ b/hjoin.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+while read x junk; do
+    git cat-file -p "$x"
+done