summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes/2.2.3.txt9
-rw-r--r--Documentation/RelNotes/2.3.9.txt9
-rw-r--r--Documentation/RelNotes/2.4.9.txt9
-rw-r--r--Documentation/RelNotes/2.5.2.txt63
-rw-r--r--Documentation/git.txt12
-rw-r--r--builtin/show-branch.c6
-rw-r--r--notes.c19
-rw-r--r--sha1_file.c9
-rw-r--r--unpack-trees.c17
9 files changed, 125 insertions, 28 deletions
diff --git a/Documentation/RelNotes/2.2.3.txt b/Documentation/RelNotes/2.2.3.txt
new file mode 100644
index 0000000..5bfffa4
--- /dev/null
+++ b/Documentation/RelNotes/2.2.3.txt
@@ -0,0 +1,9 @@
+Git v2.2.3 Release Notes
+========================
+
+Fixes since v2.2.2
+------------------
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+ pathnames have been corrected to use strbuf and other mechanisms to
+ allow longer pathnames without fearing overflows.
diff --git a/Documentation/RelNotes/2.3.9.txt b/Documentation/RelNotes/2.3.9.txt
new file mode 100644
index 0000000..1a2ad32
--- /dev/null
+++ b/Documentation/RelNotes/2.3.9.txt
@@ -0,0 +1,9 @@
+Git v2.3.9 Release Notes
+========================
+
+Fixes since v2.3.8
+------------------
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+ pathnames have been corrected to use strbuf and other mechanisms to
+ allow longer pathnames without fearing overflows.
diff --git a/Documentation/RelNotes/2.4.9.txt b/Documentation/RelNotes/2.4.9.txt
new file mode 100644
index 0000000..09af9dd
--- /dev/null
+++ b/Documentation/RelNotes/2.4.9.txt
@@ -0,0 +1,9 @@
+Git v2.4.9 Release Notes
+========================
+
+Fixes since v2.4.9
+------------------
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+ pathnames have been corrected to use strbuf and other mechanisms to
+ allow longer pathnames without fearing overflows.
diff --git a/Documentation/RelNotes/2.5.2.txt b/Documentation/RelNotes/2.5.2.txt
new file mode 100644
index 0000000..3f74939
--- /dev/null
+++ b/Documentation/RelNotes/2.5.2.txt
@@ -0,0 +1,63 @@
+Git v2.5.2 Release Notes
+========================
+
+Fixes since v2.5.1
+------------------
+
+ * "git init empty && git -C empty log" said "bad default revision 'HEAD'",
+ which was found to be a bit confusing to new users.
+
+ * The "interpret-trailers" helper mistook a multi-paragraph title of
+ a commit log message with a colon in it as the end of the trailer
+ block.
+
+ * When re-priming the cache-tree opportunistically while committing
+ the in-core index as-is, we mistakenly invalidated the in-core
+ index too aggressively, causing the experimental split-index code
+ to unnecessarily rewrite the on-disk index file(s).
+
+ * "git archive" did not use zip64 extension when creating an archive
+ with more than 64k entries, which nobody should need, right ;-)?
+
+ * The code in "multiple-worktree" support that attempted to recover
+ from an inconsistent state updated an incorrect file.
+
+ * "git rev-list" does not take "--notes" option, but did not complain
+ when one is given.
+
+ * Because the configuration system does not allow "alias.0foo" and
+ "pager.0foo" as the configuration key, the user cannot use '0foo'
+ as a custom command name anyway, but "git 0foo" tried to look these
+ keys up and emitted useless warnings before saying '0foo is not a
+ git command'. These warning messages have been squelched.
+
+ * We recently rewrote one of the build scripts in Perl, which made it
+ necessary to have Perl to build Git. Reduced Perl dependency by
+ rewriting it again using sed.
+
+ * t1509 test that requires a dedicated VM environment had some
+ bitrot, which has been corrected.
+
+ * strbuf_read() used to have one extra iteration (and an unnecessary
+ strbuf_grow() of 8kB), which was eliminated.
+
+ * The codepath to produce error messages had a hard-coded limit to
+ the size of the message, primarily to avoid memory allocation while
+ calling die().
+
+ * When trying to see that an object does not exist, a state errno
+ leaked from our "first try to open a packfile with O_NOATIME and
+ then if it fails retry without it" logic on a system that refuses
+ O_NOATIME. This confused us and caused us to die, saying that the
+ packfile is unreadable, when we should have just reported that the
+ object does not exist in that packfile to the caller.
+
+ * An off-by-one error made "git remote" to mishandle a remote with a
+ single letter nickname.
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+ pathnames have been corrected to use strbuf and other mechanisms to
+ allow longer pathnames without fearing overflows.
+
+Also contains typofixes, documentation updates and trivial code
+clean-ups.
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 4e5d55b..75ffb16 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -43,15 +43,17 @@ unreleased) version of Git, that is available from the 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
-* link:v2.5.1/git.html[documentation for release 2.5.1]
+* link:v2.5.2/git.html[documentation for release 2.5.2]
* release notes for
+ link:RelNotes/2.5.2.txt[2.5.2],
link:RelNotes/2.5.1.txt[2.5.1],
link:RelNotes/2.5.0.txt[2.5].
-* link:v2.4.8/git.html[documentation for release 2.4.8]
+* link:v2.4.9/git.html[documentation for release 2.4.9]
* release notes for
+ link:RelNotes/2.4.9.txt[2.4.9],
link:RelNotes/2.4.8.txt[2.4.8],
link:RelNotes/2.4.7.txt[2.4.7],
link:RelNotes/2.4.6.txt[2.4.6],
@@ -62,9 +64,10 @@ Documentation for older releases are available here:
link:RelNotes/2.4.1.txt[2.4.1],
link:RelNotes/2.4.0.txt[2.4].
-* link:v2.3.8/git.html[documentation for release 2.3.8]
+* link:v2.3.9/git.html[documentation for release 2.3.9]
* release notes for
+ link:RelNotes/2.3.9.txt[2.3.9],
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],
@@ -75,9 +78,10 @@ Documentation for older releases are available here:
link:RelNotes/2.3.1.txt[2.3.1],
link:RelNotes/2.3.0.txt[2.3].
-* link:v2.2.2/git.html[documentation for release 2.2.2]
+* link:v2.2.3/git.html[documentation for release 2.2.3]
* release notes for
+ link:RelNotes/2.2.3.txt[2.2.3],
link:RelNotes/2.2.2.txt[2.2.2],
link:RelNotes/2.2.1.txt[2.2.1],
link:RelNotes/2.2.0.txt[2.2].
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index c87c46e..408ce70 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -730,7 +730,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (reflog) {
struct object_id oid;
- char nth_desc[256];
char *ref;
int base = 0;
unsigned int flags = 0;
@@ -769,6 +768,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for (i = 0; i < reflog; i++) {
char *logmsg;
+ char *nth_desc;
const char *msg;
unsigned long timestamp;
int tz;
@@ -788,8 +788,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
DATE_MODE(RELATIVE)),
msg);
free(logmsg);
- sprintf(nth_desc, "%s@{%d}", *av, base+i);
+
+ nth_desc = xstrfmt("%s@{%d}", *av, base+i);
append_ref(nth_desc, &oid, 1);
+ free(nth_desc);
}
free(ref);
}
diff --git a/notes.c b/notes.c
index df08209..eacd2a6 100644
--- a/notes.c
+++ b/notes.c
@@ -362,13 +362,14 @@ static int non_note_cmp(const struct non_note *a, const struct non_note *b)
return strcmp(a->path, b->path);
}
-static void add_non_note(struct notes_tree *t, const char *path,
+/* note: takes ownership of path string */
+static void add_non_note(struct notes_tree *t, char *path,
unsigned int mode, const unsigned char *sha1)
{
struct non_note *p = t->prev_non_note, *n;
n = (struct non_note *) xmalloc(sizeof(struct non_note));
n->next = NULL;
- n->path = xstrdup(path);
+ n->path = path;
n->mode = mode;
hashcpy(n->sha1, sha1);
t->prev_non_note = n;
@@ -482,17 +483,17 @@ handle_non_note:
* component.
*/
{
- char non_note_path[PATH_MAX];
- char *p = non_note_path;
+ struct strbuf non_note_path = STRBUF_INIT;
const char *q = sha1_to_hex(subtree->key_sha1);
int i;
for (i = 0; i < prefix_len; i++) {
- *p++ = *q++;
- *p++ = *q++;
- *p++ = '/';
+ strbuf_addch(&non_note_path, *q++);
+ strbuf_addch(&non_note_path, *q++);
+ strbuf_addch(&non_note_path, '/');
}
- strcpy(p, entry.path);
- add_non_note(t, non_note_path, entry.mode, entry.sha1);
+ strbuf_addstr(&non_note_path, entry.path);
+ add_non_note(t, strbuf_detach(&non_note_path, NULL),
+ entry.mode, entry.sha1);
}
}
free(buf);
diff --git a/sha1_file.c b/sha1_file.c
index 08302f5..d295a32 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -377,15 +377,12 @@ void read_info_alternates(const char * relative_base, int depth)
char *map;
size_t mapsz;
struct stat st;
- const char alt_file_name[] = "info/alternates";
- /* Given that relative_base is no longer than PATH_MAX,
- ensure that "path" has enough space to append "/", the
- file name, "info/alternates", and a trailing NUL. */
- char path[PATH_MAX + 1 + sizeof alt_file_name];
+ char *path;
int fd;
- sprintf(path, "%s/%s", relative_base, alt_file_name);
+ path = xstrfmt("%s/info/alternates", relative_base);
fd = git_open_noatime(path);
+ free(path);
if (fd < 0)
return;
if (fstat(fd, &st) || (st.st_size == 0)) {
diff --git a/unpack-trees.c b/unpack-trees.c
index bb09b1e..f932e80 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1451,15 +1451,18 @@ static int verify_absent_1(const struct cache_entry *ce,
if (!len)
return 0;
else if (len > 0) {
- char path[PATH_MAX + 1];
- memcpy(path, ce->name, len);
- path[len] = 0;
+ char *path;
+ int ret;
+
+ path = xmemdupz(ce->name, len);
if (lstat(path, &st))
- return error("cannot stat '%s': %s", path,
+ ret = error("cannot stat '%s': %s", path,
strerror(errno));
-
- return check_ok_to_remove(path, len, DT_UNKNOWN, NULL, &st,
- error_type, o);
+ else
+ ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL,
+ &st, error_type, o);
+ free(path);
+ return ret;
} else if (lstat(ce->name, &st)) {
if (errno != ENOENT)
return error("cannot stat '%s': %s", ce->name,