Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
c99fec6e
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,发现更多精彩内容 >>
提交
c99fec6e
编写于
5月 11, 2015
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Sync with 2.3.8
Signed-off-by:
N
Junio C Hamano
<
gitster@pobox.com
>
上级
3d4a3ffe
9a3d6375
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
149 addition
and
25 deletion
+149
-25
Documentation/RelNotes/2.3.8.txt
Documentation/RelNotes/2.3.8.txt
+22
-0
Documentation/blame-options.txt
Documentation/blame-options.txt
+1
-1
Documentation/git-log.txt
Documentation/git-log.txt
+2
-2
Documentation/git.txt
Documentation/git.txt
+2
-1
Documentation/gitk.txt
Documentation/gitk.txt
+2
-2
Documentation/line-range-format.txt
Documentation/line-range-format.txt
+6
-5
builtin/config.c
builtin/config.c
+2
-2
date.c
date.c
+9
-5
diff-no-index.c
diff-no-index.c
+64
-2
line-log.c
line-log.c
+1
-1
t/t4053-diff-no-index.sh
t/t4053-diff-no-index.sh
+34
-0
t/t4211-line-log.sh
t/t4211-line-log.sh
+4
-4
未找到文件。
Documentation/RelNotes/2.3.8.txt
0 → 100644
浏览文件 @
c99fec6e
Git v2.3.8 Release Notes
========================
Fixes since v2.3.7
------------------
* The usual "git diff" when seeing a file turning into a directory
showed a patchset to remove the file and create all files in the
directory, but "git diff --no-index" simply refused to work. Also,
when asked to compare a file and a directory, imitate POSIX "diff"
and compare the file with the file with the same name in the
directory, instead of refusing to run.
* The default $HOME/.gitconfig file created upon "git config --global"
that edits it had incorrectly spelled user.name and user.email
entries in it.
* "git commit --date=now" or anything that relies on approxidate lost
the daylight-saving-time offset.
Also contains typofixes, documentation updates and trivial code
clean-ups.
Documentation/blame-options.txt
浏览文件 @
c99fec6e
...
...
@@ -10,7 +10,7 @@
Include additional statistics at the end of blame output.
-L <start>,<end>::
-L :<
regex
>::
-L :<
funcname
>::
Annotate only the given line range. May be specified multiple times.
Overlapping ranges are allowed.
+
...
...
Documentation/git-log.txt
浏览文件 @
c99fec6e
...
...
@@ -62,9 +62,9 @@ produced by `--stat`, etc.
output by allowing them to allocate space in advance.
-L <start>,<end>:<file>::
-L :<
regex
>:<file>::
-L :<
funcname
>:<file>::
Trace the evolution of the line range given by "<start>,<end>"
(or the func
name regex <regex
>) within the <file>. You may
(or the func
tion name regex <funcname
>) within the <file>. You may
not give any pathspec limiters. This is currently limited to
a walk starting from a single revision, i.e., you may only
give zero or one positive revision arguments.
...
...
Documentation/git.txt
浏览文件 @
c99fec6e
...
...
@@ -48,9 +48,10 @@ Documentation for older releases are available here:
* release notes for
link:RelNotes/2.4.0.txt[2.4].
* link:v2.3.
7/git.html[documentation for release 2.3.7
]
* link:v2.3.
8/git.html[documentation for release 2.3.8
]
* release notes for
link:RelNotes/2.3.8.txt[2.3.8],
link:RelNotes/2.3.7.txt[2.3.7],
link:RelNotes/2.3.6.txt[2.3.6],
link:RelNotes/2.3.5.txt[2.3.5],
...
...
Documentation/gitk.txt
浏览文件 @
c99fec6e
...
...
@@ -99,10 +99,10 @@ linkgit:git-rev-list[1] for a complete list.
detailed explanation.)
-L<start>,<end>:<file>::
-L:<
regex
>:<file>::
-L:<
funcname
>:<file>::
Trace the evolution of the line range given by "<start>,<end>"
(or the func
name regex <regex
>) within the <file>. You may
(or the func
tion name regex <funcname
>) within the <file>. You may
not give any pathspec limiters. This is currently limited to
a walk starting from a single revision, i.e., you may only
give zero or one positive revision arguments.
...
...
Documentation/line-range-format.txt
浏览文件 @
c99fec6e
...
...
@@ -22,8 +22,9 @@ This is only valid for <end> and will specify a number
of lines before or after the line given by <start>.
+
If ``:<regex>'' is given in place of <start> and <end>, it denotes the range
from the first funcname line that matches <regex>, up to the next
funcname line. ``:<regex>'' searches from the end of the previous `-L` range,
if any, otherwise from the start of file.
``^:<regex>'' searches from the start of file.
If ``:<funcname>'' is given in place of <start> and <end>, it is a
regular expression that denotes the range from the first funcname line
that matches <funcname>, up to the next funcname line. ``:<funcname>''
searches from the end of the previous `-L` range, if any, otherwise
from the start of file. ``^:<funcname>'' searches from the start of
file.
builtin/config.c
浏览文件 @
c99fec6e
...
...
@@ -455,9 +455,9 @@ static char *default_user_config(void)
struct
strbuf
buf
=
STRBUF_INIT
;
strbuf_addf
(
&
buf
,
_
(
"# This is Git's per-user configuration file.
\n
"
"[
core
]
\n
"
"[
user
]
\n
"
"# Please adapt and uncomment the following lines:
\n
"
"#
user
= %s
\n
"
"#
name
= %s
\n
"
"# email = %s
\n
"
),
ident_default_name
(),
ident_default_email
());
...
...
date.c
浏览文件 @
c99fec6e
...
...
@@ -704,10 +704,17 @@ int parse_date_basic(const char *date, unsigned long *timestamp, int *offset)
date
+=
match
;
}
/*
mktime uses local timezon
e */
/*
do not use mktime(), which uses local timezone, her
e */
*
timestamp
=
tm_to_time_t
(
&
tm
);
if
(
*
timestamp
==
-
1
)
return
-
1
;
if
(
*
offset
==
-
1
)
{
time_t
temp_time
=
mktime
(
&
tm
);
time_t
temp_time
;
/* gmtime_r() in match_digit() may have clobbered it */
tm
.
tm_isdst
=
-
1
;
temp_time
=
mktime
(
&
tm
);
if
((
time_t
)
*
timestamp
>
temp_time
)
{
*
offset
=
((
time_t
)
*
timestamp
-
temp_time
)
/
60
;
}
else
{
...
...
@@ -715,9 +722,6 @@ int parse_date_basic(const char *date, unsigned long *timestamp, int *offset)
}
}
if
(
*
timestamp
==
-
1
)
return
-
1
;
if
(
!
tm_gmt
)
*
timestamp
-=
*
offset
*
60
;
return
0
;
/* success */
...
...
diff-no-index.c
浏览文件 @
c99fec6e
...
...
@@ -97,8 +97,27 @@ static int queue_diff(struct diff_options *o,
if
(
get_mode
(
name1
,
&
mode1
)
||
get_mode
(
name2
,
&
mode2
))
return
-
1
;
if
(
mode1
&&
mode2
&&
S_ISDIR
(
mode1
)
!=
S_ISDIR
(
mode2
))
return
error
(
"file/directory conflict: %s, %s"
,
name1
,
name2
);
if
(
mode1
&&
mode2
&&
S_ISDIR
(
mode1
)
!=
S_ISDIR
(
mode2
))
{
struct
diff_filespec
*
d1
,
*
d2
;
if
(
S_ISDIR
(
mode1
))
{
/* 2 is file that is created */
d1
=
noindex_filespec
(
NULL
,
0
);
d2
=
noindex_filespec
(
name2
,
mode2
);
name2
=
NULL
;
mode2
=
0
;
}
else
{
/* 1 is file that is deleted */
d1
=
noindex_filespec
(
name1
,
mode1
);
d2
=
noindex_filespec
(
NULL
,
0
);
name1
=
NULL
;
mode1
=
0
;
}
/* emit that file */
diff_queue
(
&
diff_queued_diff
,
d1
,
d2
);
/* and then let the entire directory be created or deleted */
}
if
(
S_ISDIR
(
mode1
)
||
S_ISDIR
(
mode2
))
{
struct
strbuf
buffer1
=
STRBUF_INIT
;
...
...
@@ -182,12 +201,50 @@ static int queue_diff(struct diff_options *o,
}
}
/* append basename of F to D */
static
void
append_basename
(
struct
strbuf
*
path
,
const
char
*
dir
,
const
char
*
file
)
{
const
char
*
tail
=
strrchr
(
file
,
'/'
);
strbuf_addstr
(
path
,
dir
);
while
(
path
->
len
&&
path
->
buf
[
path
->
len
-
1
]
==
'/'
)
path
->
len
--
;
strbuf_addch
(
path
,
'/'
);
strbuf_addstr
(
path
,
tail
?
tail
+
1
:
file
);
}
/*
* DWIM "diff D F" into "diff D/F F" and "diff F D" into "diff F D/F"
* Note that we append the basename of F to D/, so "diff a/b/file D"
* becomes "diff a/b/file D/file", not "diff a/b/file D/a/b/file".
*/
static
void
fixup_paths
(
const
char
**
path
,
struct
strbuf
*
replacement
)
{
unsigned
int
isdir0
,
isdir1
;
if
(
path
[
0
]
==
file_from_standard_input
||
path
[
1
]
==
file_from_standard_input
)
return
;
isdir0
=
is_directory
(
path
[
0
]);
isdir1
=
is_directory
(
path
[
1
]);
if
(
isdir0
==
isdir1
)
return
;
if
(
isdir0
)
{
append_basename
(
replacement
,
path
[
0
],
path
[
1
]);
path
[
0
]
=
replacement
->
buf
;
}
else
{
append_basename
(
replacement
,
path
[
1
],
path
[
0
]);
path
[
1
]
=
replacement
->
buf
;
}
}
void
diff_no_index
(
struct
rev_info
*
revs
,
int
argc
,
const
char
**
argv
,
const
char
*
prefix
)
{
int
i
,
prefixlen
;
const
char
*
paths
[
2
];
struct
strbuf
replacement
=
STRBUF_INIT
;
diff_setup
(
&
revs
->
diffopt
);
for
(
i
=
1
;
i
<
argc
-
2
;
)
{
...
...
@@ -217,6 +274,9 @@ void diff_no_index(struct rev_info *revs,
p
=
xstrdup
(
prefix_filename
(
prefix
,
prefixlen
,
p
));
paths
[
i
]
=
p
;
}
fixup_paths
(
paths
,
&
replacement
);
revs
->
diffopt
.
skip_stat_unmatch
=
1
;
if
(
!
revs
->
diffopt
.
output_format
)
revs
->
diffopt
.
output_format
=
DIFF_FORMAT_PATCH
;
...
...
@@ -235,6 +295,8 @@ void diff_no_index(struct rev_info *revs,
diffcore_std
(
&
revs
->
diffopt
);
diff_flush
(
&
revs
->
diffopt
);
strbuf_release
(
&
replacement
);
/*
* The return code for --no-index imitates diff(1):
* 0 = no changes, 1 = changes, else error
...
...
line-log.c
浏览文件 @
c99fec6e
...
...
@@ -575,7 +575,7 @@ parse_lines(struct commit *commit, const char *prefix, struct string_list *args)
name_part
=
skip_range_arg
(
item
->
string
);
if
(
!
name_part
||
*
name_part
!=
':'
||
!
name_part
[
1
])
die
(
"-L argument
'%s' not of the form start,end:file
"
,
die
(
"-L argument
not 'start,end:file' or ':funcname:file': %s
"
,
item
->
string
);
range_part
=
xstrndup
(
item
->
string
,
name_part
-
item
->
string
);
name_part
++
;
...
...
t/t4053-diff-no-index.sh
浏览文件 @
c99fec6e
...
...
@@ -55,4 +55,38 @@ test_expect_success 'git diff --no-index executed outside repo gives correct err
)
'
test_expect_success
'diff D F and diff F D'
'
(
cd repo &&
echo in-repo >a &&
echo non-repo >../non/git/a &&
mkdir sub &&
echo sub-repo >sub/a &&
test_must_fail git diff --no-index sub/a ../non/git/a >expect &&
test_must_fail git diff --no-index sub/a ../non/git/ >actual &&
test_cmp expect actual &&
test_must_fail git diff --no-index a ../non/git/a >expect &&
test_must_fail git diff --no-index a ../non/git/ >actual &&
test_cmp expect actual &&
test_must_fail git diff --no-index ../non/git/a a >expect &&
test_must_fail git diff --no-index ../non/git a >actual &&
test_cmp expect actual
)
'
test_expect_success
'turning a file into a directory'
'
(
cd non/git &&
mkdir d e e/sub &&
echo 1 >d/sub &&
echo 2 >e/sub/file &&
printf "D\td/sub\nA\te/sub/file\n" >expect &&
test_must_fail git diff --no-index --name-status d e >actual &&
test_cmp expect actual
)
'
test_done
t/t4211-line-log.sh
浏览文件 @
c99fec6e
...
...
@@ -54,14 +54,14 @@ canned_test "-L 4:a.c -L 8,12:a.c simple" multiple-superset
canned_test
"-L 8,12:a.c -L 4:a.c simple"
multiple-superset
test_bad_opts
"-L"
"switch.*requires a value"
test_bad_opts
"-L b.c"
"argument
.*not of the form
"
test_bad_opts
"-L 1:"
"argument
.*not of the form
"
test_bad_opts
"-L b.c"
"argument
not .start,end:file
"
test_bad_opts
"-L 1:"
"argument
not .start,end:file
"
test_bad_opts
"-L 1:nonexistent"
"There is no path"
test_bad_opts
"-L 1:simple"
"There is no path"
test_bad_opts
"-L '/foo:b.c'"
"argument
.*not of the form
"
test_bad_opts
"-L '/foo:b.c'"
"argument
not .start,end:file
"
test_bad_opts
"-L 1000:b.c"
"has only.*lines"
test_bad_opts
"-L 1,1000:b.c"
"has only.*lines"
test_bad_opts
"-L :b.c"
"argument
.*not of the form
"
test_bad_opts
"-L :b.c"
"argument
not .start,end:file
"
test_bad_opts
"-L :foo:b.c"
"no match"
test_expect_success
'-L X (X == nlines)'
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录