Skip to content

Commit ba02e47

Browse files
chrisbrabrammool
authored andcommitted
patch 8.2.3390: included xdiff code is outdated
Problem: Included xdiff code is outdated. Solution: Sync with xdiff in git 2.33. (Christian Brabandt, closes #8431)
1 parent dca29d9 commit ba02e47

16 files changed

Lines changed: 239 additions & 144 deletions

src/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ diff_file_internal(diffio_T *diffio)
10951095

10961096
emit_cfg.ctxlen = 0; // don't need any diff_context here
10971097
emit_cb.priv = &diffio->dio_diff;
1098-
emit_cb.outf = xdiff_out;
1098+
emit_cb.out_line = xdiff_out;
10991099
if (xdl_diff(&diffio->dio_orig.din_mmfile,
11001100
&diffio->dio_new.din_mmfile,
11011101
&param, &emit_cfg, &emit_cb) < 0)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3390,
758760
/**/
759761
3389,
760762
/**/

src/xdiff/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The files in this directory come from the xdiff implementation in git.
22
You can find it here: https://github.com/git/git/tree/master/xdiff
3-
The files were last updated 2018 September 10.
3+
The files were last updated August 31, 2021 from git release v.2.33.0
44

55
This is originally based on libxdiff, which can be found here:
66
http://www.xmailserver.org/xdiff-lib.html

src/xdiff/xdiff.h

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
#ifdef __cplusplus
2727
extern "C" {
28-
#endif // #ifdef __cplusplus
28+
#endif /* #ifdef __cplusplus */
2929

30-
// xpparm_t.flags
30+
/* xpparm_t.flags */
3131
#define XDF_NEED_MINIMAL (1 << 0)
3232

3333
#define XDF_IGNORE_WHITESPACE (1 << 1)
@@ -48,22 +48,23 @@ extern "C" {
4848

4949
#define XDF_INDENT_HEURISTIC (1 << 23)
5050

51-
// xdemitconf_t.flags
51+
/* xdemitconf_t.flags */
5252
#define XDL_EMIT_FUNCNAMES (1 << 0)
53+
#define XDL_EMIT_NO_HUNK_HDR (1 << 1)
5354
#define XDL_EMIT_FUNCCONTEXT (1 << 2)
5455

55-
// merge simplification levels
56+
/* merge simplification levels */
5657
#define XDL_MERGE_MINIMAL 0
5758
#define XDL_MERGE_EAGER 1
5859
#define XDL_MERGE_ZEALOUS 2
5960
#define XDL_MERGE_ZEALOUS_ALNUM 3
6061

61-
// merge favor modes
62+
/* merge favor modes */
6263
#define XDL_MERGE_FAVOR_OURS 1
6364
#define XDL_MERGE_FAVOR_THEIRS 2
6465
#define XDL_MERGE_FAVOR_UNION 3
6566

66-
// merge output styles
67+
/* merge output styles */
6768
#define XDL_MERGE_DIFF3 1
6869

6970
typedef struct s_mmfile {
@@ -79,14 +80,24 @@ typedef struct s_mmbuffer {
7980
typedef struct s_xpparam {
8081
unsigned long flags;
8182

82-
// See Documentation/diff-options.txt.
83+
/* -I<regex> */
84+
#if 0 // unused by Vim
85+
regex_t **ignore_regex;
86+
size_t ignore_regex_nr;
87+
#endif
88+
89+
/* See Documentation/diff-options.txt. */
8390
char **anchors;
8491
size_t anchors_nr;
8592
} xpparam_t;
8693

8794
typedef struct s_xdemitcb {
8895
void *priv;
89-
int (*outf)(void *, mmbuffer_t *, int);
96+
int (*out_hunk)(void *,
97+
long old_begin, long old_nr,
98+
long new_begin, long new_nr,
99+
const char *func, long funclen);
100+
int (*out_line)(void *, mmbuffer_t *, int);
90101
} xdemitcb_t;
91102

92103
typedef long (*find_func_t)(const char *line, long line_len, char *buffer, long buffer_size, void *priv);
@@ -130,9 +141,9 @@ typedef struct s_xmparam {
130141
int level;
131142
int favor;
132143
int style;
133-
const char *ancestor; // label for orig
134-
const char *file1; // label for mf1
135-
const char *file2; // label for mf2
144+
const char *ancestor; /* label for orig */
145+
const char *file1; /* label for mf1 */
146+
const char *file2; /* label for mf2 */
136147
} xmparam_t;
137148

138149
#define DEFAULT_CONFLICT_MARKER_SIZE 7
@@ -142,6 +153,6 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, mmfile_t *mf2,
142153

143154
#ifdef __cplusplus
144155
}
145-
#endif // #ifdef __cplusplus
156+
#endif /* #ifdef __cplusplus */
146157

147-
#endif // #if !defined(XDIFF_H)
158+
#endif /* #if !defined(XDIFF_H) */

0 commit comments

Comments
 (0)