Skip to content

Commit 3880c18

Browse files
committed
Sync with 1.6.5.5
Signed-off-by: Junio C Hamano <[email protected]>
2 parents 1a56be1 + aa03131 commit 3880c18

File tree

10 files changed

+80
-22
lines changed

10 files changed

+80
-22
lines changed

Documentation/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ gitman.info
88
howto-index.txt
99
doc.dep
1010
cmds-*.txt
11+
manpage-base-url.xsl

Documentation/Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,15 @@ XMLTO_EXTRA += -m manpage-suppress-sp.xsl
105105
endif
106106

107107
# Newer DocBook stylesheet emits warning cruft in the output when
108-
# this is not set, and if set it shows an absolute link. We can
109-
# use MAN_BASE_URL=http://www.kernel.org/pub/software/scm/git/docs/
110-
# but distros may want to set it to /usr/share/doc/git-core/docs/ or
111-
# something like that.
108+
# this is not set, and if set it shows an absolute link. Older
109+
# stylesheets simply ignore this parameter.
112110
#
113-
# As older stylesheets simply ignore this parameter, it ought to be
114-
# safe to set it to empty string when the base URL is not specified,
115-
# but unfortunately we cannot do so unconditionally because at least
116-
# xmlto 0.0.18 is reported to lack --stringparam option.
117-
ifdef MAN_BASE_URL
118-
XMLTO_EXTRA += --stringparam man.base.url.for.relative.links=$(MAN_BASE_URL)
111+
# Distros may want to use MAN_BASE_URL=file:///path/to/git/docs/
112+
# or similar.
113+
ifndef MAN_BASE_URL
114+
MAN_BASE_URL = file://$(htmldir)/
119115
endif
116+
XMLTO_EXTRA += -m manpage-base-url.xsl
120117

121118
# If your target system uses GNU groff, it may try to render
122119
# apostrophes as a "pretty" apostrophe using unicode. This breaks
@@ -245,14 +242,18 @@ clean:
245242
$(RM) howto-index.txt howto/*.html doc.dep
246243
$(RM) technical/api-*.html technical/api-index.txt
247244
$(RM) $(cmds_txt) *.made
245+
$(RM) manpage-base-url.xsl
248246

249247
$(MAN_HTML): %.html : %.txt
250248
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
251249
$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
252250
$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
253251
mv $@+ $@
254252

255-
%.1 %.5 %.7 : %.xml
253+
manpage-base-url.xsl: manpage-base-url.xsl.in
254+
sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
255+
256+
%.1 %.5 %.7 : %.xml manpage-base-url.xsl
256257
$(QUIET_XMLTO)$(RM) $@ && \
257258
xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
258259

Documentation/RelNotes-1.6.5.5.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Fixes since v1.6.5.4
1818
twice, and held onto memory after it has used the data in it
1919
unnecessarily before it freed.
2020

21+
* "git diff -B" and "git diff --dirstat" was not counting newly added
22+
contents correctly.
23+
2124
* "git format-patch revisions... -- path" issued an incorrect error
2225
message that suggested to use "--" on the command line when path
2326
does not exist in the current work tree (it is a separate matter if
@@ -39,6 +42,8 @@ Fixes since v1.6.5.4
3942
* "git rebase" got confused when the log message began with certain
4043
strings that looked like Subject:, Date: or From: header.
4144

42-
Other minor documentation updates are included.
45+
* "git reset" accidentally run in .git/ directory checked out the
46+
work tree contents in there.
4347

44-
v1.6.5.4-47-gdda8f4b
48+
49+
Other minor documentation updates are included.

Documentation/git-archive.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ OPTIONS
7474
The tree or commit to produce an archive for.
7575

7676
path::
77-
If one or more paths are specified, include only these in the
78-
archive, otherwise include all files and subdirectories.
77+
Without an optional path parameter, all files and subdirectories
78+
of the current working directory are included in the archive.
79+
If one or more paths are specified, only these are included.
7980

8081
BACKEND EXTRA OPTIONS
8182
---------------------

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
4343
branch of the `git.git` repository.
4444
Documentation for older releases are available here:
4545

46-
* link:v1.6.5.4/git.html[documentation for release 1.6.5.4]
46+
* link:v1.6.5.5/git.html[documentation for release 1.6.5.5]
4747

4848
* release notes for
49+
link:RelNotes-1.6.5.5.txt[1.6.5.5],
4950
link:RelNotes-1.6.5.4.txt[1.6.5.4],
5051
link:RelNotes-1.6.5.3.txt[1.6.5.3],
5152
link:RelNotes-1.6.5.2.txt[1.6.5.2],

Documentation/manpage-base-url.xsl.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- manpage-base-url.xsl:
2+
special settings for manpages rendered from newer docbook -->
3+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4+
version="1.0">
5+
6+
<!-- set a base URL for relative links -->
7+
<xsl:param name="man.base.url.for.relative.links"
8+
>@@MAN_BASE_URL@@</xsl:param>
9+
10+
</xsl:stylesheet>

builtin-rerere.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ static void garbage_collect(struct string_list *rr)
4848

4949
git_config(git_rerere_gc_config, NULL);
5050
dir = opendir(git_path("rr-cache"));
51+
if (!dir)
52+
die_errno("unable to open rr-cache directory");
5153
while ((e = readdir(dir))) {
5254
if (is_dot_or_dotdot(e->d_name))
5355
continue;

builtin-reset.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
286286
if (reset_type == NONE)
287287
reset_type = MIXED; /* by default */
288288

289-
if (reset_type == HARD && is_bare_repository())
290-
die("hard reset makes no sense in a bare repository");
289+
if ((reset_type == HARD || reset_type == MERGE)
290+
&& !is_inside_work_tree())
291+
die("%s reset requires a work tree",
292+
reset_type_names[reset_type]);
291293

292294
/* Soft reset does not touch the index file nor the working tree
293295
* at all, but requires them in a good order. Other resets reset

diffcore-delta.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,15 @@ int diffcore_count_changes(struct diff_filespec *src,
201201
while (d->cnt) {
202202
if (d->hashval >= s->hashval)
203203
break;
204+
la += d->cnt;
204205
d++;
205206
}
206207
src_cnt = s->cnt;
207-
dst_cnt = d->hashval == s->hashval ? d->cnt : 0;
208+
dst_cnt = 0;
209+
if (d->cnt && d->hashval == s->hashval) {
210+
dst_cnt = d->cnt;
211+
d++;
212+
}
208213
if (src_cnt < dst_cnt) {
209214
la += dst_cnt - src_cnt;
210215
sc += src_cnt;
@@ -213,6 +218,10 @@ int diffcore_count_changes(struct diff_filespec *src,
213218
sc += dst_cnt;
214219
s++;
215220
}
221+
while (d->cnt) {
222+
la += d->cnt;
223+
d++;
224+
}
216225

217226
if (!src_count_p)
218227
free(src_count);

t/t7103-reset-bare.sh

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,42 @@ test_expect_success 'setup non-bare' '
1111
git commit -a -m two
1212
'
1313

14+
test_expect_success 'hard reset requires a worktree' '
15+
(cd .git &&
16+
test_must_fail git reset --hard)
17+
'
18+
19+
test_expect_success 'merge reset requires a worktree' '
20+
(cd .git &&
21+
test_must_fail git reset --merge)
22+
'
23+
24+
test_expect_success 'mixed reset is ok' '
25+
(cd .git && git reset)
26+
'
27+
28+
test_expect_success 'soft reset is ok' '
29+
(cd .git && git reset --soft)
30+
'
31+
1432
test_expect_success 'setup bare' '
1533
git clone --bare . bare.git &&
1634
cd bare.git
1735
'
1836

19-
test_expect_success 'hard reset is not allowed' '
20-
test_must_fail git reset --hard HEAD^
37+
test_expect_success 'hard reset is not allowed in bare' '
38+
test_must_fail git reset --hard HEAD^
39+
'
40+
41+
test_expect_success 'merge reset is not allowed in bare' '
42+
test_must_fail git reset --merge HEAD^
43+
'
44+
45+
test_expect_success 'mixed reset is not allowed in bare' '
46+
test_must_fail git reset --mixed HEAD^
2147
'
2248

23-
test_expect_success 'soft reset is allowed' '
49+
test_expect_success 'soft reset is allowed in bare' '
2450
git reset --soft HEAD^ &&
2551
test "`git show --pretty=format:%s | head -n 1`" = "one"
2652
'

0 commit comments

Comments
 (0)