From 6b906b465b34578f010fee7df9da9bdbd1cc87d7 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Wed, 12 Nov 2025 17:43:23 +0100 Subject: [PATCH 1/8] Fix incorrect function name and description for xdiff_string_rabdiff() --- .../xdiff/functions/xdiff-string-rabdiff.xml | 99 ++++++++++++------- 1 file changed, 64 insertions(+), 35 deletions(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index 56c3ebcf0edd..f714967cb389 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -1,29 +1,33 @@ - + xdiff_string_rabdiff - Make binary diff of two strings using the Rabin's polynomial fingerprinting algorithm + Make a binary diff of two strings using the Rabin's polynomial fingerprinting algorithm - + &reftitle.description; - stringxdiff_string_bdiff + string|falsexdiff_string_rabdiff stringold_data stringnew_data - Makes a binary diff of two strings and returns the result. - The difference between this function and xdiff_string_bdiff is different - algorithm used which should result in faster execution and smaller diff produced. - This function works with both text and binary data. Resulting patch - can be later applied using xdiff_string_bpatch/xdiff_file_bpatch. + Makes a binary diff of two strings using the Rabin's polynomial fingerprinting algorithm implemented by + libxdiff. Compared to + xdiff_string_bdiff, this algorithm generally produces smaller diffs and operates faster, + while remaining fully compatible with xdiff_string_bpatch and + xdiff_file_bpatch for applying patches. + + + This function can be used with both text and binary data. The resulting diff data can later be applied to recreate + the new version from the old one. - For more details about differences between algorithm used please check libxdiff - website. + For further information about the algorithm, see the + libxdiff documentation. @@ -35,7 +39,7 @@ old_data - First string with binary data. It acts as "old" data. + The first string containing the "old" binary data. @@ -43,7 +47,7 @@ new_data - Second string with binary data. It acts as "new" data. + The second string containing the "new" binary data. @@ -54,8 +58,31 @@ &reftitle.returnvalues; - Returns string with binary diff containing differences between "old" and "new" - data or &false; if an internal error occurred. + Returns a binary diff string containing the differences between the old and new data, or + false if an internal error occurred. + + + + + &reftitle.examples; + + + <function>xdiff_string_rabdiff</function> example + + The following example creates a binary diff between two strings and stores it for later patching. + + + +]]> + + @@ -63,30 +90,32 @@ &reftitle.seealso; + xdiff_string_bdiff xdiff_string_bpatch + xdiff_file_bpatch - + From 2244b9edb7d8406fc807e82b80a64d7ca545e967 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud <20201470+lacatoire@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:56:18 +0100 Subject: [PATCH 2/8] Update reference/xdiff/functions/xdiff-string-rabdiff.xml Co-authored-by: Kamil Tekiela --- reference/xdiff/functions/xdiff-string-rabdiff.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index f714967cb389..2f126c6400f4 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -4,7 +4,9 @@ xdiff_string_rabdiff - Make a binary diff of two strings using the Rabin's polynomial fingerprinting algorithm + + Make a binary diff of two strings using the Rabin's polynomial fingerprinting algorithm + From f9e0925495e7affb7dca11a5ab67114f340ad7bb Mon Sep 17 00:00:00 2001 From: Louis-Arnaud <20201470+lacatoire@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:02:20 +0100 Subject: [PATCH 3/8] Apply suggestion from @kamil-tekiela Co-authored-by: Kamil Tekiela --- reference/xdiff/functions/xdiff-string-rabdiff.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index 2f126c6400f4..eace6177d44c 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -60,8 +60,7 @@ &reftitle.returnvalues; - Returns a binary diff string containing the differences between the old and new data, or - false if an internal error occurred. + Returns a binary diff string containing the differences between the old and new data,&return.falseforfailure;. From 0c0c72a128a73ea41f8bb935a2597259432e10ba Mon Sep 17 00:00:00 2001 From: lacatoire Date: Tue, 18 Nov 2025 10:03:50 +0100 Subject: [PATCH 4/8] correct reviews --- .../xdiff/functions/xdiff-string-rabdiff.xml | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index eace6177d44c..5607c465862c 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -1,7 +1,7 @@ - - + xdiff_string_rabdiff @@ -24,8 +24,8 @@ xdiff_file_bpatch for applying patches. - This function can be used with both text and binary data. The resulting diff data can later be applied to recreate - the new version from the old one. + This function can be used with both text and binary data. The resulting diff data can later be + applied to recreate the new version from the old one. For further information about the algorithm, see the @@ -70,7 +70,7 @@ <function>xdiff_string_rabdiff</function> example - The following example creates a binary diff between two strings and stores it for later patching. + Creation of a binary diff between two strings - - + + From 116e0b0b395e5e99d08cdd111ad98dfb88224a9c Mon Sep 17 00:00:00 2001 From: Louis-Arnaud <20201470+lacatoire@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:48:41 +0100 Subject: [PATCH 5/8] Update reference/xdiff/functions/xdiff-string-rabdiff.xml Co-authored-by: Kamil Tekiela --- reference/xdiff/functions/xdiff-string-rabdiff.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index 5607c465862c..34a18c9bcf51 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -68,10 +68,7 @@ &reftitle.examples; - <function>xdiff_string_rabdiff</function> example - - Creation of a binary diff between two strings - + Creation of a binary diff between two strings Date: Tue, 18 Nov 2025 15:00:47 +0100 Subject: [PATCH 6/8] Update reference/xdiff/functions/xdiff-string-rabdiff.xml Co-authored-by: Kamil Tekiela --- reference/xdiff/functions/xdiff-string-rabdiff.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index 34a18c9bcf51..2a8b23c17ce0 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -1,7 +1,6 @@ - + xdiff_string_rabdiff From d442ee08ebed32b534d5e4d21737ec67ac48c146 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud <20201470+lacatoire@users.noreply.github.com> Date: Tue, 18 Nov 2025 15:00:53 +0100 Subject: [PATCH 7/8] Update reference/xdiff/functions/xdiff-string-rabdiff.xml Co-authored-by: Kamil Tekiela --- reference/xdiff/functions/xdiff-string-rabdiff.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index 2a8b23c17ce0..f09561d810a1 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -23,7 +23,7 @@ xdiff_file_bpatch for applying patches. - This function can be used with both text and binary data. The resulting diff data can later be + This function can be used with both text and binary data. The resulting diff data can later be applied to recreate the new version from the old one. From dd05a3f10485bdf58db2b32d95a745058a59618a Mon Sep 17 00:00:00 2001 From: Louis-Arnaud <20201470+lacatoire@users.noreply.github.com> Date: Tue, 18 Nov 2025 15:00:59 +0100 Subject: [PATCH 8/8] Update reference/xdiff/functions/xdiff-string-rabdiff.xml Co-authored-by: Kamil Tekiela --- reference/xdiff/functions/xdiff-string-rabdiff.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/xdiff/functions/xdiff-string-rabdiff.xml b/reference/xdiff/functions/xdiff-string-rabdiff.xml index f09561d810a1..9f5325f42924 100644 --- a/reference/xdiff/functions/xdiff-string-rabdiff.xml +++ b/reference/xdiff/functions/xdiff-string-rabdiff.xml @@ -95,7 +95,6 @@ file_put_contents('patch.rdiff', $diff); -