Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
6b6f5d46
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b6f5d46
编写于
5月 04, 2010
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'maint-1.7.0' into maint
* maint-1.7.0: remove ecb parameter from xdi_diff_outf()
上级
2b873e06
dfea7900
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
19 deletion
+13
-19
combine-diff.c
combine-diff.c
+1
-2
diff.c
diff.c
+5
-10
xdiff-interface.c
xdiff-interface.c
+6
-5
xdiff-interface.h
xdiff-interface.h
+1
-2
未找到文件。
combine-diff.c
浏览文件 @
6b6f5d46
...
@@ -211,7 +211,6 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
...
@@ -211,7 +211,6 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
xpparam_t
xpp
;
xpparam_t
xpp
;
xdemitconf_t
xecfg
;
xdemitconf_t
xecfg
;
mmfile_t
parent_file
;
mmfile_t
parent_file
;
xdemitcb_t
ecb
;
struct
combine_diff_state
state
;
struct
combine_diff_state
state
;
unsigned
long
sz
;
unsigned
long
sz
;
...
@@ -231,7 +230,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
...
@@ -231,7 +230,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode,
state
.
n
=
n
;
state
.
n
=
n
;
xdi_diff_outf
(
&
parent_file
,
result_file
,
consume_line
,
&
state
,
xdi_diff_outf
(
&
parent_file
,
result_file
,
consume_line
,
&
state
,
&
xpp
,
&
xecfg
,
&
ecb
);
&
xpp
,
&
xecfg
);
free
(
parent_file
.
ptr
);
free
(
parent_file
.
ptr
);
/* Assign line numbers for this parent.
/* Assign line numbers for this parent.
...
...
diff.c
浏览文件 @
6b6f5d46
...
@@ -700,7 +700,6 @@ static void diff_words_show(struct diff_words_data *diff_words)
...
@@ -700,7 +700,6 @@ static void diff_words_show(struct diff_words_data *diff_words)
{
{
xpparam_t
xpp
;
xpparam_t
xpp
;
xdemitconf_t
xecfg
;
xdemitconf_t
xecfg
;
xdemitcb_t
ecb
;
mmfile_t
minus
,
plus
;
mmfile_t
minus
,
plus
;
/* special case: only removal */
/* special case: only removal */
...
@@ -722,7 +721,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
...
@@ -722,7 +721,7 @@ static void diff_words_show(struct diff_words_data *diff_words)
/* as only the hunk header will be parsed, we need a 0-context */
/* as only the hunk header will be parsed, we need a 0-context */
xecfg
.
ctxlen
=
0
;
xecfg
.
ctxlen
=
0
;
xdi_diff_outf
(
&
minus
,
&
plus
,
fn_out_diff_words_aux
,
diff_words
,
xdi_diff_outf
(
&
minus
,
&
plus
,
fn_out_diff_words_aux
,
diff_words
,
&
xpp
,
&
xecfg
,
&
ecb
);
&
xpp
,
&
xecfg
);
free
(
minus
.
ptr
);
free
(
minus
.
ptr
);
free
(
plus
.
ptr
);
free
(
plus
.
ptr
);
if
(
diff_words
->
current_plus
!=
diff_words
->
plus
.
text
.
ptr
+
if
(
diff_words
->
current_plus
!=
diff_words
->
plus
.
text
.
ptr
+
...
@@ -1708,7 +1707,6 @@ static void builtin_diff(const char *name_a,
...
@@ -1708,7 +1707,6 @@ static void builtin_diff(const char *name_a,
const
char
*
diffopts
=
getenv
(
"GIT_DIFF_OPTS"
);
const
char
*
diffopts
=
getenv
(
"GIT_DIFF_OPTS"
);
xpparam_t
xpp
;
xpparam_t
xpp
;
xdemitconf_t
xecfg
;
xdemitconf_t
xecfg
;
xdemitcb_t
ecb
;
struct
emit_callback
ecbdata
;
struct
emit_callback
ecbdata
;
const
struct
userdiff_funcname
*
pe
;
const
struct
userdiff_funcname
*
pe
;
...
@@ -1780,7 +1778,7 @@ static void builtin_diff(const char *name_a,
...
@@ -1780,7 +1778,7 @@ static void builtin_diff(const char *name_a,
}
}
}
}
xdi_diff_outf
(
&
mf1
,
&
mf2
,
fn_out_consume
,
&
ecbdata
,
xdi_diff_outf
(
&
mf1
,
&
mf2
,
fn_out_consume
,
&
ecbdata
,
&
xpp
,
&
xecfg
,
&
ecb
);
&
xpp
,
&
xecfg
);
if
(
DIFF_OPT_TST
(
o
,
COLOR_DIFF_WORDS
))
if
(
DIFF_OPT_TST
(
o
,
COLOR_DIFF_WORDS
))
free_diff_words_data
(
&
ecbdata
);
free_diff_words_data
(
&
ecbdata
);
if
(
textconv_one
)
if
(
textconv_one
)
...
@@ -1833,13 +1831,12 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
...
@@ -1833,13 +1831,12 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
/* Crazy xdl interfaces.. */
/* Crazy xdl interfaces.. */
xpparam_t
xpp
;
xpparam_t
xpp
;
xdemitconf_t
xecfg
;
xdemitconf_t
xecfg
;
xdemitcb_t
ecb
;
memset
(
&
xpp
,
0
,
sizeof
(
xpp
));
memset
(
&
xpp
,
0
,
sizeof
(
xpp
));
memset
(
&
xecfg
,
0
,
sizeof
(
xecfg
));
memset
(
&
xecfg
,
0
,
sizeof
(
xecfg
));
xpp
.
flags
=
XDF_NEED_MINIMAL
|
o
->
xdl_opts
;
xpp
.
flags
=
XDF_NEED_MINIMAL
|
o
->
xdl_opts
;
xdi_diff_outf
(
&
mf1
,
&
mf2
,
diffstat_consume
,
diffstat
,
xdi_diff_outf
(
&
mf1
,
&
mf2
,
diffstat_consume
,
diffstat
,
&
xpp
,
&
xecfg
,
&
ecb
);
&
xpp
,
&
xecfg
);
}
}
free_and_return:
free_and_return:
...
@@ -1881,14 +1878,13 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
...
@@ -1881,14 +1878,13 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
/* Crazy xdl interfaces.. */
/* Crazy xdl interfaces.. */
xpparam_t
xpp
;
xpparam_t
xpp
;
xdemitconf_t
xecfg
;
xdemitconf_t
xecfg
;
xdemitcb_t
ecb
;
memset
(
&
xpp
,
0
,
sizeof
(
xpp
));
memset
(
&
xpp
,
0
,
sizeof
(
xpp
));
memset
(
&
xecfg
,
0
,
sizeof
(
xecfg
));
memset
(
&
xecfg
,
0
,
sizeof
(
xecfg
));
xecfg
.
ctxlen
=
1
;
/* at least one context line */
xecfg
.
ctxlen
=
1
;
/* at least one context line */
xpp
.
flags
=
XDF_NEED_MINIMAL
;
xpp
.
flags
=
XDF_NEED_MINIMAL
;
xdi_diff_outf
(
&
mf1
,
&
mf2
,
checkdiff_consume
,
&
data
,
xdi_diff_outf
(
&
mf1
,
&
mf2
,
checkdiff_consume
,
&
data
,
&
xpp
,
&
xecfg
,
&
ecb
);
&
xpp
,
&
xecfg
);
if
(
data
.
ws_rule
&
WS_BLANK_AT_EOF
)
{
if
(
data
.
ws_rule
&
WS_BLANK_AT_EOF
)
{
struct
emit_callback
ecbdata
;
struct
emit_callback
ecbdata
;
...
@@ -3383,7 +3379,6 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
...
@@ -3383,7 +3379,6 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
for
(
i
=
0
;
i
<
q
->
nr
;
i
++
)
{
for
(
i
=
0
;
i
<
q
->
nr
;
i
++
)
{
xpparam_t
xpp
;
xpparam_t
xpp
;
xdemitconf_t
xecfg
;
xdemitconf_t
xecfg
;
xdemitcb_t
ecb
;
mmfile_t
mf1
,
mf2
;
mmfile_t
mf1
,
mf2
;
struct
diff_filepair
*
p
=
q
->
queue
[
i
];
struct
diff_filepair
*
p
=
q
->
queue
[
i
];
int
len1
,
len2
;
int
len1
,
len2
;
...
@@ -3445,7 +3440,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
...
@@ -3445,7 +3440,7 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
xecfg
.
ctxlen
=
3
;
xecfg
.
ctxlen
=
3
;
xecfg
.
flags
=
XDL_EMIT_FUNCNAMES
;
xecfg
.
flags
=
XDL_EMIT_FUNCNAMES
;
xdi_diff_outf
(
&
mf1
,
&
mf2
,
patch_id_consume
,
&
data
,
xdi_diff_outf
(
&
mf1
,
&
mf2
,
patch_id_consume
,
&
data
,
&
xpp
,
&
xecfg
,
&
ecb
);
&
xpp
,
&
xecfg
);
}
}
git_SHA1_Final
(
sha1
,
&
ctx
);
git_SHA1_Final
(
sha1
,
&
ctx
);
...
...
xdiff-interface.c
浏览文件 @
6b6f5d46
...
@@ -138,19 +138,20 @@ int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t co
...
@@ -138,19 +138,20 @@ int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t co
int
xdi_diff_outf
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
int
xdi_diff_outf
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
xdiff_emit_consume_fn
fn
,
void
*
consume_callback_data
,
xdiff_emit_consume_fn
fn
,
void
*
consume_callback_data
,
xpparam_t
const
*
xpp
,
xpparam_t
const
*
xpp
,
xdemitconf_t
const
*
xecfg
)
xdemitconf_t
const
*
xecfg
,
xdemitcb_t
*
xecb
)
{
{
int
ret
;
int
ret
;
struct
xdiff_emit_state
state
;
struct
xdiff_emit_state
state
;
xdemitcb_t
ecb
;
memset
(
&
state
,
0
,
sizeof
(
state
));
memset
(
&
state
,
0
,
sizeof
(
state
));
state
.
consume
=
fn
;
state
.
consume
=
fn
;
state
.
consume_callback_data
=
consume_callback_data
;
state
.
consume_callback_data
=
consume_callback_data
;
xecb
->
outf
=
xdiff_outf
;
memset
(
&
ecb
,
0
,
sizeof
(
ecb
));
xecb
->
priv
=
&
state
;
ecb
.
outf
=
xdiff_outf
;
ecb
.
priv
=
&
state
;
strbuf_init
(
&
state
.
remainder
,
0
);
strbuf_init
(
&
state
.
remainder
,
0
);
ret
=
xdi_diff
(
mf1
,
mf2
,
xpp
,
xecfg
,
x
ecb
);
ret
=
xdi_diff
(
mf1
,
mf2
,
xpp
,
xecfg
,
&
ecb
);
strbuf_release
(
&
state
.
remainder
);
strbuf_release
(
&
state
.
remainder
);
return
ret
;
return
ret
;
}
}
...
...
xdiff-interface.h
浏览文件 @
6b6f5d46
...
@@ -9,8 +9,7 @@ typedef void (*xdiff_emit_hunk_consume_fn)(void *, long, long, long);
...
@@ -9,8 +9,7 @@ typedef void (*xdiff_emit_hunk_consume_fn)(void *, long, long, long);
int
xdi_diff
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
xpparam_t
const
*
xpp
,
xdemitconf_t
const
*
xecfg
,
xdemitcb_t
*
ecb
);
int
xdi_diff
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
xpparam_t
const
*
xpp
,
xdemitconf_t
const
*
xecfg
,
xdemitcb_t
*
ecb
);
int
xdi_diff_outf
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
int
xdi_diff_outf
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
xdiff_emit_consume_fn
fn
,
void
*
consume_callback_data
,
xdiff_emit_consume_fn
fn
,
void
*
consume_callback_data
,
xpparam_t
const
*
xpp
,
xpparam_t
const
*
xpp
,
xdemitconf_t
const
*
xecfg
);
xdemitconf_t
const
*
xecfg
,
xdemitcb_t
*
xecb
);
int
xdi_diff_hunks
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
int
xdi_diff_hunks
(
mmfile_t
*
mf1
,
mmfile_t
*
mf2
,
xdiff_emit_hunk_consume_fn
fn
,
void
*
consume_callback_data
,
xdiff_emit_hunk_consume_fn
fn
,
void
*
consume_callback_data
,
xpparam_t
const
*
xpp
,
xdemitconf_t
*
xecfg
);
xpparam_t
const
*
xpp
,
xdemitconf_t
*
xecfg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录