Skip to content

Commit f0bc854

Browse files
committed
Sync with 2.5.2
2 parents 7a2c4af + 27ea6f8 commit f0bc854

File tree

9 files changed

+125
-28
lines changed

9 files changed

+125
-28
lines changed

Documentation/RelNotes/2.2.3.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Git v2.2.3 Release Notes
2+
========================
3+
4+
Fixes since v2.2.2
5+
------------------
6+
7+
* A handful of codepaths that used to use fixed-sized arrays to hold
8+
pathnames have been corrected to use strbuf and other mechanisms to
9+
allow longer pathnames without fearing overflows.

Documentation/RelNotes/2.3.9.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Git v2.3.9 Release Notes
2+
========================
3+
4+
Fixes since v2.3.8
5+
------------------
6+
7+
* A handful of codepaths that used to use fixed-sized arrays to hold
8+
pathnames have been corrected to use strbuf and other mechanisms to
9+
allow longer pathnames without fearing overflows.

Documentation/RelNotes/2.4.9.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Git v2.4.9 Release Notes
2+
========================
3+
4+
Fixes since v2.4.9
5+
------------------
6+
7+
* A handful of codepaths that used to use fixed-sized arrays to hold
8+
pathnames have been corrected to use strbuf and other mechanisms to
9+
allow longer pathnames without fearing overflows.

Documentation/RelNotes/2.5.2.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Git v2.5.2 Release Notes
2+
========================
3+
4+
Fixes since v2.5.1
5+
------------------
6+
7+
* "git init empty && git -C empty log" said "bad default revision 'HEAD'",
8+
which was found to be a bit confusing to new users.
9+
10+
* The "interpret-trailers" helper mistook a multi-paragraph title of
11+
a commit log message with a colon in it as the end of the trailer
12+
block.
13+
14+
* When re-priming the cache-tree opportunistically while committing
15+
the in-core index as-is, we mistakenly invalidated the in-core
16+
index too aggressively, causing the experimental split-index code
17+
to unnecessarily rewrite the on-disk index file(s).
18+
19+
* "git archive" did not use zip64 extension when creating an archive
20+
with more than 64k entries, which nobody should need, right ;-)?
21+
22+
* The code in "multiple-worktree" support that attempted to recover
23+
from an inconsistent state updated an incorrect file.
24+
25+
* "git rev-list" does not take "--notes" option, but did not complain
26+
when one is given.
27+
28+
* Because the configuration system does not allow "alias.0foo" and
29+
"pager.0foo" as the configuration key, the user cannot use '0foo'
30+
as a custom command name anyway, but "git 0foo" tried to look these
31+
keys up and emitted useless warnings before saying '0foo is not a
32+
git command'. These warning messages have been squelched.
33+
34+
* We recently rewrote one of the build scripts in Perl, which made it
35+
necessary to have Perl to build Git. Reduced Perl dependency by
36+
rewriting it again using sed.
37+
38+
* t1509 test that requires a dedicated VM environment had some
39+
bitrot, which has been corrected.
40+
41+
* strbuf_read() used to have one extra iteration (and an unnecessary
42+
strbuf_grow() of 8kB), which was eliminated.
43+
44+
* The codepath to produce error messages had a hard-coded limit to
45+
the size of the message, primarily to avoid memory allocation while
46+
calling die().
47+
48+
* When trying to see that an object does not exist, a state errno
49+
leaked from our "first try to open a packfile with O_NOATIME and
50+
then if it fails retry without it" logic on a system that refuses
51+
O_NOATIME. This confused us and caused us to die, saying that the
52+
packfile is unreadable, when we should have just reported that the
53+
object does not exist in that packfile to the caller.
54+
55+
* An off-by-one error made "git remote" to mishandle a remote with a
56+
single letter nickname.
57+
58+
* A handful of codepaths that used to use fixed-sized arrays to hold
59+
pathnames have been corrected to use strbuf and other mechanisms to
60+
allow longer pathnames without fearing overflows.
61+
62+
Also contains typofixes, documentation updates and trivial code
63+
clean-ups.

Documentation/git.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@ unreleased) version of Git, that is available from the 'master'
4343
branch of the `git.git` repository.
4444
Documentation for older releases are available here:
4545

46-
* link:v2.5.1/git.html[documentation for release 2.5.1]
46+
* link:v2.5.2/git.html[documentation for release 2.5.2]
4747

4848
* release notes for
49+
link:RelNotes/2.5.2.txt[2.5.2],
4950
link:RelNotes/2.5.1.txt[2.5.1],
5051
link:RelNotes/2.5.0.txt[2.5].
5152

52-
* link:v2.4.8/git.html[documentation for release 2.4.8]
53+
* link:v2.4.9/git.html[documentation for release 2.4.9]
5354

5455
* release notes for
56+
link:RelNotes/2.4.9.txt[2.4.9],
5557
link:RelNotes/2.4.8.txt[2.4.8],
5658
link:RelNotes/2.4.7.txt[2.4.7],
5759
link:RelNotes/2.4.6.txt[2.4.6],
@@ -62,9 +64,10 @@ Documentation for older releases are available here:
6264
link:RelNotes/2.4.1.txt[2.4.1],
6365
link:RelNotes/2.4.0.txt[2.4].
6466

65-
* link:v2.3.8/git.html[documentation for release 2.3.8]
67+
* link:v2.3.9/git.html[documentation for release 2.3.9]
6668

6769
* release notes for
70+
link:RelNotes/2.3.9.txt[2.3.9],
6871
link:RelNotes/2.3.8.txt[2.3.8],
6972
link:RelNotes/2.3.7.txt[2.3.7],
7073
link:RelNotes/2.3.6.txt[2.3.6],
@@ -75,9 +78,10 @@ Documentation for older releases are available here:
7578
link:RelNotes/2.3.1.txt[2.3.1],
7679
link:RelNotes/2.3.0.txt[2.3].
7780

78-
* link:v2.2.2/git.html[documentation for release 2.2.2]
81+
* link:v2.2.3/git.html[documentation for release 2.2.3]
7982

8083
* release notes for
84+
link:RelNotes/2.2.3.txt[2.2.3],
8185
link:RelNotes/2.2.2.txt[2.2.2],
8286
link:RelNotes/2.2.1.txt[2.2.1],
8387
link:RelNotes/2.2.0.txt[2.2].

builtin/show-branch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
730730

731731
if (reflog) {
732732
struct object_id oid;
733-
char nth_desc[256];
734733
char *ref;
735734
int base = 0;
736735
unsigned int flags = 0;
@@ -769,6 +768,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
769768

770769
for (i = 0; i < reflog; i++) {
771770
char *logmsg;
771+
char *nth_desc;
772772
const char *msg;
773773
unsigned long timestamp;
774774
int tz;
@@ -788,8 +788,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
788788
DATE_MODE(RELATIVE)),
789789
msg);
790790
free(logmsg);
791-
sprintf(nth_desc, "%s@{%d}", *av, base+i);
791+
792+
nth_desc = xstrfmt("%s@{%d}", *av, base+i);
792793
append_ref(nth_desc, &oid, 1);
794+
free(nth_desc);
793795
}
794796
free(ref);
795797
}

notes.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,14 @@ static int non_note_cmp(const struct non_note *a, const struct non_note *b)
362362
return strcmp(a->path, b->path);
363363
}
364364

365-
static void add_non_note(struct notes_tree *t, const char *path,
365+
/* note: takes ownership of path string */
366+
static void add_non_note(struct notes_tree *t, char *path,
366367
unsigned int mode, const unsigned char *sha1)
367368
{
368369
struct non_note *p = t->prev_non_note, *n;
369370
n = (struct non_note *) xmalloc(sizeof(struct non_note));
370371
n->next = NULL;
371-
n->path = xstrdup(path);
372+
n->path = path;
372373
n->mode = mode;
373374
hashcpy(n->sha1, sha1);
374375
t->prev_non_note = n;
@@ -482,17 +483,17 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
482483
* component.
483484
*/
484485
{
485-
char non_note_path[PATH_MAX];
486-
char *p = non_note_path;
486+
struct strbuf non_note_path = STRBUF_INIT;
487487
const char *q = sha1_to_hex(subtree->key_sha1);
488488
int i;
489489
for (i = 0; i < prefix_len; i++) {
490-
*p++ = *q++;
491-
*p++ = *q++;
492-
*p++ = '/';
490+
strbuf_addch(&non_note_path, *q++);
491+
strbuf_addch(&non_note_path, *q++);
492+
strbuf_addch(&non_note_path, '/');
493493
}
494-
strcpy(p, entry.path);
495-
add_non_note(t, non_note_path, entry.mode, entry.sha1);
494+
strbuf_addstr(&non_note_path, entry.path);
495+
add_non_note(t, strbuf_detach(&non_note_path, NULL),
496+
entry.mode, entry.sha1);
496497
}
497498
}
498499
free(buf);

sha1_file.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,12 @@ void read_info_alternates(const char * relative_base, int depth)
377377
char *map;
378378
size_t mapsz;
379379
struct stat st;
380-
const char alt_file_name[] = "info/alternates";
381-
/* Given that relative_base is no longer than PATH_MAX,
382-
ensure that "path" has enough space to append "/", the
383-
file name, "info/alternates", and a trailing NUL. */
384-
char path[PATH_MAX + 1 + sizeof alt_file_name];
380+
char *path;
385381
int fd;
386382

387-
sprintf(path, "%s/%s", relative_base, alt_file_name);
383+
path = xstrfmt("%s/info/alternates", relative_base);
388384
fd = git_open_noatime(path);
385+
free(path);
389386
if (fd < 0)
390387
return;
391388
if (fstat(fd, &st) || (st.st_size == 0)) {

unpack-trees.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,15 +1451,18 @@ static int verify_absent_1(const struct cache_entry *ce,
14511451
if (!len)
14521452
return 0;
14531453
else if (len > 0) {
1454-
char path[PATH_MAX + 1];
1455-
memcpy(path, ce->name, len);
1456-
path[len] = 0;
1454+
char *path;
1455+
int ret;
1456+
1457+
path = xmemdupz(ce->name, len);
14571458
if (lstat(path, &st))
1458-
return error("cannot stat '%s': %s", path,
1459+
ret = error("cannot stat '%s': %s", path,
14591460
strerror(errno));
1460-
1461-
return check_ok_to_remove(path, len, DT_UNKNOWN, NULL, &st,
1462-
error_type, o);
1461+
else
1462+
ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL,
1463+
&st, error_type, o);
1464+
free(path);
1465+
return ret;
14631466
} else if (lstat(ce->name, &st)) {
14641467
if (errno != ENOENT)
14651468
return error("cannot stat '%s': %s", ce->name,

0 commit comments

Comments
 (0)