diff -Nru git-2.15.0/apply.c git-2.15.1/apply.c --- git-2.15.0/apply.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/apply.c 2017-11-28 04:47:44.000000000 +0000 @@ -305,52 +305,33 @@ static int fuzzy_matchlines(const char *s1, size_t n1, const char *s2, size_t n2) { - const char *last1 = s1 + n1 - 1; - const char *last2 = s2 + n2 - 1; - int result = 0; + const char *end1 = s1 + n1; + const char *end2 = s2 + n2; /* ignore line endings */ - while ((*last1 == '\r') || (*last1 == '\n')) - last1--; - while ((*last2 == '\r') || (*last2 == '\n')) - last2--; + while (s1 < end1 && (end1[-1] == '\r' || end1[-1] == '\n')) + end1--; + while (s2 < end2 && (end2[-1] == '\r' || end2[-1] == '\n')) + end2--; - /* skip leading whitespaces, if both begin with whitespace */ - if (s1 <= last1 && s2 <= last2 && isspace(*s1) && isspace(*s2)) { - while (isspace(*s1) && (s1 <= last1)) - s1++; - while (isspace(*s2) && (s2 <= last2)) - s2++; - } - /* early return if both lines are empty */ - if ((s1 > last1) && (s2 > last2)) - return 1; - while (!result) { - result = *s1++ - *s2++; - /* - * Skip whitespace inside. We check for whitespace on - * both buffers because we don't want "a b" to match - * "ab" - */ - if (isspace(*s1) && isspace(*s2)) { - while (isspace(*s1) && s1 <= last1) + while (s1 < end1 && s2 < end2) { + if (isspace(*s1)) { + /* + * Skip whitespace. We check on both buffers + * because we don't want "a b" to match "ab". + */ + if (!isspace(*s2)) + return 0; + while (s1 < end1 && isspace(*s1)) s1++; - while (isspace(*s2) && s2 <= last2) + while (s2 < end2 && isspace(*s2)) s2++; - } - /* - * If we reached the end on one side only, - * lines don't match - */ - if ( - ((s2 > last2) && (s1 <= last1)) || - ((s1 > last1) && (s2 <= last2))) + } else if (*s1++ != *s2++) return 0; - if ((s1 > last1) && (s2 > last2)) - break; } - return !result; + /* If we reached the end on one side only, lines don't match. */ + return s1 == end1 && s2 == end2; } static void add_line_info(struct image *img, const char *bol, size_t len, unsigned flag) diff -Nru git-2.15.0/bisect.c git-2.15.1/bisect.c --- git-2.15.0/bisect.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/bisect.c 2017-11-28 04:47:44.000000000 +0000 @@ -226,10 +226,11 @@ add_name_decoration(DECORATION_NONE, buf.buf, obj); p->item = array[i].commit; - p = p->next; + if (i < cnt - 1) + p = p->next; } - if (p) - p->next = NULL; + free_commit_list(p->next); + p->next = NULL; strbuf_release(&buf); free(array); return list; @@ -360,28 +361,29 @@ return best_bisection_sorted(list, nr); } -struct commit_list *find_bisection(struct commit_list *list, - int *reaches, int *all, - int find_all) +void find_bisection(struct commit_list **commit_list, int *reaches, + int *all, int find_all) { int nr, on_list; - struct commit_list *p, *best, *next, *last; + struct commit_list *list, *p, *best, *next, *last; int *weights; - show_list("bisection 2 entry", 0, 0, list); + show_list("bisection 2 entry", 0, 0, *commit_list); /* * Count the number of total and tree-changing items on the * list, while reversing the list. */ - for (nr = on_list = 0, last = NULL, p = list; + for (nr = on_list = 0, last = NULL, p = *commit_list; p; p = next) { unsigned flags = p->item->object.flags; next = p->next; - if (flags & UNINTERESTING) + if (flags & UNINTERESTING) { + free(p); continue; + } p->next = last; last = p; if (!(flags & TREESAME)) @@ -397,12 +399,16 @@ /* Do the real work of finding bisection commit. */ best = do_find_bisection(list, nr, weights, find_all); if (best) { - if (!find_all) + if (!find_all) { + list->item = best->item; + free_commit_list(list->next); + best = list; best->next = NULL; + } *reaches = weight(best); } free(weights); - return best; + *commit_list = best; } static int register_ref(const char *refname, const struct object_id *oid, @@ -954,8 +960,7 @@ bisect_common(&revs); - revs.commits = find_bisection(revs.commits, &reaches, &all, - !!skipped_revs.nr); + find_bisection(&revs.commits, &reaches, &all, !!skipped_revs.nr); revs.commits = managed_skipped(revs.commits, &tried); if (!revs.commits) { diff -Nru git-2.15.0/bisect.h git-2.15.1/bisect.h --- git-2.15.0/bisect.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/bisect.h 2017-11-28 04:47:44.000000000 +0000 @@ -1,9 +1,15 @@ #ifndef BISECT_H #define BISECT_H -extern struct commit_list *find_bisection(struct commit_list *list, - int *reaches, int *all, - int find_all); +/* + * Find bisection. If something is found, `reaches` will be the number of + * commits that the best commit reaches. `all` will be the count of + * non-SAMETREE commits. If nothing is found, `list` will be NULL. + * Otherwise, it will be either all non-SAMETREE commits or the single + * best commit, as chosen by `find_all`. + */ +extern void find_bisection(struct commit_list **list, int *reaches, int *all, + int find_all); extern struct commit_list *filter_skipped(struct commit_list *list, struct commit_list **tried, diff -Nru git-2.15.0/builtin/check-ref-format.c git-2.15.1/builtin/check-ref-format.c --- git-2.15.0/builtin/check-ref-format.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/check-ref-format.c 2017-11-28 04:47:44.000000000 +0000 @@ -39,12 +39,14 @@ static int check_ref_format_branch(const char *arg) { struct strbuf sb = STRBUF_INIT; + const char *name; int nongit; setup_git_directory_gently(&nongit); - if (strbuf_check_branch_ref(&sb, arg)) + if (strbuf_check_branch_ref(&sb, arg) || + !skip_prefix(sb.buf, "refs/heads/", &name)) die("'%s' is not a valid branch name", arg); - printf("%s\n", sb.buf + 11); + printf("%s\n", name); strbuf_release(&sb); return 0; } diff -Nru git-2.15.0/builtin/commit.c git-2.15.1/builtin/commit.c --- git-2.15.0/builtin/commit.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/commit.c 2017-11-28 04:47:44.000000000 +0000 @@ -1492,6 +1492,8 @@ diff_setup_done(&rev.diffopt); head = resolve_ref_unsafe("HEAD", 0, NULL, NULL); + if (!head) + die_errno(_("unable to resolve HEAD after creating commit")); if (!strcmp(head, "HEAD")) head = _("detached HEAD"); else @@ -1728,7 +1730,7 @@ allow_fast_forward = 0; } if (allow_fast_forward) - parents = reduce_heads(parents); + reduce_heads_replace(&parents); } else { if (!reflog_msg) reflog_msg = (whence == FROM_CHERRY_PICK) diff -Nru git-2.15.0/builtin/fmt-merge-msg.c git-2.15.1/builtin/fmt-merge-msg.c --- git-2.15.0/builtin/fmt-merge-msg.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/fmt-merge-msg.c 2017-11-28 04:47:44.000000000 +0000 @@ -571,7 +571,7 @@ head_commit = lookup_commit(head); if (head_commit) commit_list_insert(head_commit, &parents); - parents = reduce_heads(parents); + reduce_heads_replace(&parents); while (parents) { struct commit *cmit = pop_commit(&parents); diff -Nru git-2.15.0/builtin/grep.c git-2.15.1/builtin/grep.c --- git-2.15.0/builtin/grep.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/grep.c 2017-11-28 04:47:44.000000000 +0000 @@ -431,7 +431,9 @@ * store is no longer global and instead is a member of the repository * object. */ + grep_read_lock(); add_to_alternates_memory(submodule.objectdir); + grep_read_unlock(); if (oid) { struct object *object; diff -Nru git-2.15.0/builtin/merge-base.c git-2.15.1/builtin/merge-base.c --- git-2.15.0/builtin/merge-base.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/merge-base.c 2017-11-28 04:47:44.000000000 +0000 @@ -9,20 +9,20 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all) { - struct commit_list *result; + struct commit_list *result, *r; result = get_merge_bases_many_dirty(rev[0], rev_nr - 1, rev + 1); if (!result) return 1; - while (result) { - printf("%s\n", oid_to_hex(&result->item->object.oid)); + for (r = result; r; r = r->next) { + printf("%s\n", oid_to_hex(&r->item->object.oid)); if (!show_all) - return 0; - result = result->next; + break; } + free_commit_list(result); return 0; } @@ -51,45 +51,47 @@ static int handle_independent(int count, const char **args) { - struct commit_list *revs = NULL; - struct commit_list *result; + struct commit_list *revs = NULL, *rev; int i; for (i = count - 1; i >= 0; i--) commit_list_insert(get_commit_reference(args[i]), &revs); - result = reduce_heads(revs); - if (!result) + reduce_heads_replace(&revs); + + if (!revs) return 1; - while (result) { - printf("%s\n", oid_to_hex(&result->item->object.oid)); - result = result->next; - } + for (rev = revs; rev; rev = rev->next) + printf("%s\n", oid_to_hex(&rev->item->object.oid)); + + free_commit_list(revs); return 0; } static int handle_octopus(int count, const char **args, int show_all) { struct commit_list *revs = NULL; - struct commit_list *result; + struct commit_list *result, *rev; int i; for (i = count - 1; i >= 0; i--) commit_list_insert(get_commit_reference(args[i]), &revs); - result = reduce_heads(get_octopus_merge_bases(revs)); + result = get_octopus_merge_bases(revs); + free_commit_list(revs); + reduce_heads_replace(&result); if (!result) return 1; - while (result) { - printf("%s\n", oid_to_hex(&result->item->object.oid)); + for (rev = result; rev; rev = rev->next) { + printf("%s\n", oid_to_hex(&rev->item->object.oid)); if (!show_all) - return 0; - result = result->next; + break; } + free_commit_list(result); return 0; } diff -Nru git-2.15.0/builtin/merge.c git-2.15.1/builtin/merge.c --- git-2.15.0/builtin/merge.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/merge.c 2017-11-28 04:47:44.000000000 +0000 @@ -999,6 +999,7 @@ /* Find what parents to record by checking independent ones. */ parents = reduce_heads(remoteheads); + free_commit_list(remoteheads); remoteheads = NULL; remotes = &remoteheads; diff -Nru git-2.15.0/builtin/pull.c git-2.15.1/builtin/pull.c --- git-2.15.0/builtin/pull.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/pull.c 2017-11-28 04:47:44.000000000 +0000 @@ -745,12 +745,15 @@ if (!is_null_oid(fork_point)) commit_list_insert(lookup_commit_reference(fork_point), &revs); - result = reduce_heads(get_octopus_merge_bases(revs)); + result = get_octopus_merge_bases(revs); free_commit_list(revs); + reduce_heads_replace(&result); + if (!result) return 1; oidcpy(merge_base, &result->item->object.oid); + free_commit_list(result); return 0; } diff -Nru git-2.15.0/builtin/remote.c git-2.15.1/builtin/remote.c --- git-2.15.0/builtin/remote.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/remote.c 2017-11-28 04:47:44.000000000 +0000 @@ -565,7 +565,7 @@ item = string_list_append(rename->remote_branches, xstrdup(refname)); symref = resolve_ref_unsafe(refname, RESOLVE_REF_READING, NULL, &flag); - if (flag & REF_ISSYMREF) + if (symref && (flag & REF_ISSYMREF)) item->util = xstrdup(symref); else item->util = NULL; diff -Nru git-2.15.0/builtin/rev-list.c git-2.15.1/builtin/rev-list.c --- git-2.15.0/builtin/rev-list.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/builtin/rev-list.c 2017-11-28 04:47:44.000000000 +0000 @@ -397,8 +397,7 @@ if (bisect_list) { int reaches = reaches, all = all; - revs.commits = find_bisection(revs.commits, &reaches, &all, - bisect_find_all); + find_bisection(&revs.commits, &reaches, &all, bisect_find_all); if (bisect_show_vars) return show_bisect_vars(&info, reaches, all); diff -Nru git-2.15.0/ci/install-dependencies.sh git-2.15.1/ci/install-dependencies.sh --- git-2.15.0/ci/install-dependencies.sh 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ci/install-dependencies.sh 2017-11-28 04:47:44.000000000 +0000 @@ -12,20 +12,18 @@ linux) export GIT_TEST_HTTPD=YesPlease - mkdir --parents custom/p4 - pushd custom/p4 + mkdir --parents "$P4_PATH" + pushd "$P4_PATH" wget --quiet "$P4WHENCE/bin.linux26x86_64/p4d" wget --quiet "$P4WHENCE/bin.linux26x86_64/p4" chmod u+x p4d chmod u+x p4 - export PATH="$(pwd):$PATH" popd - mkdir --parents custom/git-lfs - pushd custom/git-lfs + mkdir --parents "$GIT_LFS_PATH" + pushd "$GIT_LFS_PATH" wget --quiet "$LFSWHENCE/git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" tar --extract --gunzip --file "git-lfs-linux-amd64-$LINUX_GIT_LFS_VERSION.tar.gz" cp git-lfs-$LINUX_GIT_LFS_VERSION/git-lfs . - export PATH="$(pwd):$PATH" popd ;; osx) diff -Nru git-2.15.0/ci/lib-travisci.sh git-2.15.1/ci/lib-travisci.sh --- git-2.15.0/ci/lib-travisci.sh 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ci/lib-travisci.sh 2017-11-28 04:47:44.000000000 +0000 @@ -26,3 +26,11 @@ set -e skip_branch_tip_with_tag + +case "${TRAVIS_OS_NAME:-linux}" in +linux) + P4_PATH="$(pwd)/custom/p4" + GIT_LFS_PATH="$(pwd)/custom/git-lfs" + export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH" + ;; +esac diff -Nru git-2.15.0/column.c git-2.15.1/column.c --- git-2.15.0/column.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/column.c 2017-11-28 04:47:44.000000000 +0000 @@ -224,7 +224,7 @@ if (stdout_is_tty < 0) stdout_is_tty = isatty(1); *colopts &= ~COL_ENABLE_MASK; - if (stdout_is_tty) + if (stdout_is_tty || pager_in_use()) *colopts |= COL_ENABLED; } return 0; diff -Nru git-2.15.0/commit.c git-2.15.1/commit.c --- git-2.15.0/commit.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/commit.c 2017-11-28 04:47:44.000000000 +0000 @@ -1090,6 +1090,13 @@ return result; } +void reduce_heads_replace(struct commit_list **heads) +{ + struct commit_list *result = reduce_heads(*heads); + free_commit_list(*heads); + *heads = result; +} + static const char gpg_sig_header[] = "gpgsig"; static const int gpg_sig_header_len = sizeof(gpg_sig_header) - 1; diff -Nru git-2.15.0/commit.h git-2.15.1/commit.h --- git-2.15.0/commit.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/commit.h 2017-11-28 04:47:44.000000000 +0000 @@ -313,7 +313,23 @@ extern int run_add_interactive(const char *revision, const char *patch_mode, const struct pathspec *pathspec); -struct commit_list *reduce_heads(struct commit_list *heads); +/* + * Takes a list of commits and returns a new list where those + * have been removed that can be reached from other commits in + * the list. It is useful for, e.g., reducing the commits + * randomly thrown at the git-merge command and removing + * redundant commits that the user shouldn't have given to it. + * + * This function destroys the STALE bit of the commit objects' + * flags. + */ +extern struct commit_list *reduce_heads(struct commit_list *heads); + +/* + * Like `reduce_heads()`, except it replaces the list. Use this + * instead of `foo = reduce_heads(foo);` to avoid memory leaks. + */ +extern void reduce_heads_replace(struct commit_list **heads); struct commit_extra_header { struct commit_extra_header *next; diff -Nru git-2.15.0/compat/mingw.c git-2.15.1/compat/mingw.c --- git-2.15.0/compat/mingw.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/mingw.c 2017-11-28 04:47:44.000000000 +0000 @@ -2139,6 +2139,62 @@ return memcpy(malloc_startup(len), buffer, len); } +static void maybe_redirect_std_handle(const wchar_t *key, DWORD std_id, int fd, + DWORD desired_access, DWORD flags) +{ + DWORD create_flag = fd ? OPEN_ALWAYS : OPEN_EXISTING; + wchar_t buf[MAX_PATH]; + DWORD max = ARRAY_SIZE(buf); + HANDLE handle; + DWORD ret = GetEnvironmentVariableW(key, buf, max); + + if (!ret || ret >= max) + return; + + /* make sure this does not leak into child processes */ + SetEnvironmentVariableW(key, NULL); + if (!wcscmp(buf, L"off")) { + close(fd); + handle = GetStdHandle(std_id); + if (handle != INVALID_HANDLE_VALUE) + CloseHandle(handle); + return; + } + if (std_id == STD_ERROR_HANDLE && !wcscmp(buf, L"2>&1")) { + handle = GetStdHandle(STD_OUTPUT_HANDLE); + if (handle == INVALID_HANDLE_VALUE) { + close(fd); + handle = GetStdHandle(std_id); + if (handle != INVALID_HANDLE_VALUE) + CloseHandle(handle); + } else { + int new_fd = _open_osfhandle((intptr_t)handle, O_BINARY); + SetStdHandle(std_id, handle); + dup2(new_fd, fd); + /* do *not* close the new_fd: that would close stdout */ + } + return; + } + handle = CreateFileW(buf, desired_access, 0, NULL, create_flag, + flags, NULL); + if (handle != INVALID_HANDLE_VALUE) { + int new_fd = _open_osfhandle((intptr_t)handle, O_BINARY); + SetStdHandle(std_id, handle); + dup2(new_fd, fd); + close(new_fd); + } +} + +static void maybe_redirect_std_handles(void) +{ + maybe_redirect_std_handle(L"GIT_REDIRECT_STDIN", STD_INPUT_HANDLE, 0, + GENERIC_READ, FILE_ATTRIBUTE_NORMAL); + maybe_redirect_std_handle(L"GIT_REDIRECT_STDOUT", STD_OUTPUT_HANDLE, 1, + GENERIC_WRITE, FILE_ATTRIBUTE_NORMAL); + maybe_redirect_std_handle(L"GIT_REDIRECT_STDERR", STD_ERROR_HANDLE, 2, + GENERIC_WRITE, FILE_FLAG_NO_BUFFERING); +} + void mingw_startup(void) { int i, maxlen, argc; @@ -2146,6 +2202,8 @@ wchar_t **wenv, **wargv; _startupinfo si; + maybe_redirect_std_handles(); + /* get wide char arguments and environment */ si.newmode = 0; if (__wgetmainargs(&argc, &wargv, &wenv, _CRT_glob, &si) < 0) diff -Nru git-2.15.0/compat/obstack.c git-2.15.1/compat/obstack.c --- git-2.15.0/compat/obstack.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/obstack.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ #include "git-compat-util.h" #include diff -Nru git-2.15.0/compat/obstack.h git-2.15.1/compat/obstack.h --- git-2.15.0/compat/obstack.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/obstack.h 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + License along with the GNU C Library; if not, see + . */ /* Summary: diff -Nru git-2.15.0/compat/poll/poll.c git-2.15.1/compat/poll/poll.c --- git-2.15.0/compat/poll/poll.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/poll/poll.c 2017-11-28 04:47:44.000000000 +0000 @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ /* Tell gcc not to warn about the (nfd < 0) tests, below. */ #if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ diff -Nru git-2.15.0/compat/poll/poll.h git-2.15.1/compat/poll/poll.h --- git-2.15.0/compat/poll/poll.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/poll/poll.h 2017-11-28 04:47:44.000000000 +0000 @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + with this program; if not, see . */ #ifndef _GL_POLL_H #define _GL_POLL_H diff -Nru git-2.15.0/compat/regex/regcomp.c git-2.15.1/compat/regex/regcomp.c --- git-2.15.0/compat/regex/regcomp.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/regex/regcomp.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. */ + License along with the GNU C Library; if not, see + . */ static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, size_t length, reg_syntax_t syntax); diff -Nru git-2.15.0/compat/regex/regex.c git-2.15.1/compat/regex/regex.c --- git-2.15.0/compat/regex/regex.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/regex/regex.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. */ + License along with the GNU C Library; if not, see + . */ #ifdef HAVE_CONFIG_H #include "config.h" diff -Nru git-2.15.0/compat/regex/regexec.c git-2.15.1/compat/regex/regexec.c --- git-2.15.0/compat/regex/regexec.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/regex/regexec.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. */ + License along with the GNU C Library; if not, see + . */ static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, int n) internal_function; diff -Nru git-2.15.0/compat/regex/regex.h git-2.15.1/compat/regex/regex.h --- git-2.15.0/compat/regex/regex.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/regex/regex.h 2017-11-28 04:47:44.000000000 +0000 @@ -18,9 +18,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. */ + License along with the GNU C Library; if not, see + . */ #ifndef _REGEX_H #define _REGEX_H 1 diff -Nru git-2.15.0/compat/regex/regex_internal.c git-2.15.1/compat/regex/regex_internal.c --- git-2.15.0/compat/regex/regex_internal.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/regex/regex_internal.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. */ + License along with the GNU C Library; if not, see + . */ static void re_string_construct_common (const char *str, int len, re_string_t *pstr, diff -Nru git-2.15.0/compat/regex/regex_internal.h git-2.15.1/compat/regex/regex_internal.h --- git-2.15.0/compat/regex/regex_internal.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/compat/regex/regex_internal.h 2017-11-28 04:47:44.000000000 +0000 @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + . */ #ifndef _REGEX_INTERNAL_H #define _REGEX_INTERNAL_H 1 diff -Nru git-2.15.0/config.c git-2.15.1/config.c --- git-2.15.0/config.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/config.c 2017-11-28 04:47:44.000000000 +0000 @@ -2315,7 +2315,7 @@ struct strbuf sb = store_create_section(key); ssize_t ret; - ret = write_in_full(fd, sb.buf, sb.len) == sb.len; + ret = write_in_full(fd, sb.buf, sb.len); strbuf_release(&sb); return ret; diff -Nru git-2.15.0/configure git-2.15.1/configure --- git-2.15.0/configure 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/configure 2017-11-28 04:47:44.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for git 2.15.0. +# Generated by GNU Autoconf 2.69 for git 2.15.1. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='git' PACKAGE_TARNAME='git' -PACKAGE_VERSION='2.15.0' -PACKAGE_STRING='git 2.15.0' +PACKAGE_VERSION='2.15.1' +PACKAGE_STRING='git 2.15.1' PACKAGE_BUGREPORT='git@vger.kernel.org' PACKAGE_URL='' @@ -1254,7 +1254,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures git 2.15.0 to adapt to many kinds of systems. +\`configure' configures git 2.15.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of git 2.15.0:";; + short | recursive ) echo "Configuration of git 2.15.1:";; esac cat <<\_ACEOF @@ -1460,7 +1460,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -git configure 2.15.0 +git configure 2.15.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1940,7 +1940,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by git $as_me 2.15.0, which was +It was created by git $as_me 2.15.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8236,7 +8236,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by git $as_me 2.15.0, which was +This file was extended by git $as_me 2.15.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8293,7 +8293,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -git config.status 2.15.0 +git config.status 2.15.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru git-2.15.0/contrib/completion/git-completion.bash git-2.15.1/contrib/completion/git-completion.bash --- git-2.15.0/contrib/completion/git-completion.bash 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/completion/git-completion.bash 2017-11-28 04:47:44.000000000 +0000 @@ -111,8 +111,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# along with this program; if not, see . # # The latest version of this software can be obtained here: # @@ -1250,7 +1249,8 @@ --*) __gitcomp " --quiet --ours --theirs --track --no-track --merge - --conflict= --orphan --patch + --conflict= --orphan --patch --detach --ignore-skip-worktree-bits + --recurse-submodules --no-recurse-submodules " ;; *) diff -Nru git-2.15.0/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c git-2.15.1/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c --- git-2.15.0/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/credential/gnome-keyring/git-credential-gnome-keyring.c 2017-11-28 04:47:44.000000000 +0000 @@ -13,8 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, see . */ /* diff -Nru git-2.15.0/contrib/credential/libsecret/git-credential-libsecret.c git-2.15.1/contrib/credential/libsecret/git-credential-libsecret.c --- git-2.15.0/contrib/credential/libsecret/git-credential-libsecret.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/credential/libsecret/git-credential-libsecret.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, see . */ /* @@ -104,7 +103,7 @@ items = secret_service_search_sync(service, SECRET_SCHEMA_COMPAT_NETWORK, attributes, - SECRET_SEARCH_LOAD_SECRETS, + SECRET_SEARCH_LOAD_SECRETS | SECRET_SEARCH_UNLOCK, NULL, &error); g_hash_table_unref(attributes); diff -Nru git-2.15.0/contrib/credential/wincred/git-credential-wincred.c git-2.15.1/contrib/credential/wincred/git-credential-wincred.c --- git-2.15.0/contrib/credential/wincred/git-credential-wincred.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/credential/wincred/git-credential-wincred.c 2017-11-28 04:47:44.000000000 +0000 @@ -94,6 +94,12 @@ static void write_item(const char *what, LPCWSTR wbuf, int wlen) { char *buf; + + if (!wbuf || !wlen) { + printf("%s=\n", what); + return; + } + int len = WideCharToMultiByte(CP_UTF8, 0, wbuf, wlen, NULL, 0, NULL, FALSE); buf = xmalloc(len); @@ -160,7 +166,7 @@ static int match_cred(const CREDENTIALW *cred) { LPCWSTR target = cred->TargetName; - if (wusername && wcscmp(wusername, cred->UserName)) + if (wusername && wcscmp(wusername, cred->UserName ? cred->UserName : L"")) return 0; return match_part(&target, L"git", L":") && @@ -183,7 +189,7 @@ for (i = 0; i < num_creds; ++i) if (match_cred(creds[i])) { write_item("username", creds[i]->UserName, - wcslen(creds[i]->UserName)); + creds[i]->UserName ? wcslen(creds[i]->UserName) : 0); write_item("password", (LPCWSTR)creds[i]->CredentialBlob, creds[i]->CredentialBlobSize / sizeof(WCHAR)); diff -Nru git-2.15.0/contrib/emacs/git-blame.el git-2.15.1/contrib/emacs/git-blame.el --- git-2.15.0/contrib/emacs/git-blame.el 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/emacs/git-blame.el 2017-11-28 04:47:44.000000000 +0000 @@ -25,9 +25,8 @@ ;; PURPOSE. See the GNU General Public License for more details. ;; You should have received a copy of the GNU General Public -;; License along with this program; if not, write to the Free -;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, -;; MA 02111-1307 USA +;; License along with this program; if not, see +;; . ;; http://www.fsf.org/copyleft/gpl.html diff -Nru git-2.15.0/contrib/emacs/git.el git-2.15.1/contrib/emacs/git.el --- git-2.15.0/contrib/emacs/git.el 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/emacs/git.el 2017-11-28 04:47:44.000000000 +0000 @@ -15,9 +15,8 @@ ;; PURPOSE. See the GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public -;; License along with this program; if not, write to the Free -;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, -;; MA 02111-1307 USA +;; License along with this program; if not, see +;; . ;;; Commentary: diff -Nru git-2.15.0/contrib/fast-import/import-directories.perl git-2.15.1/contrib/fast-import/import-directories.perl --- git-2.15.0/contrib/fast-import/import-directories.perl 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/fast-import/import-directories.perl 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# along with this program; if not, see . # # ------------------------------------------------------------------------ diff -Nru git-2.15.0/contrib/hg-to-git/hg-to-git.py git-2.15.1/contrib/hg-to-git/hg-to-git.py --- git-2.15.0/contrib/hg-to-git/hg-to-git.py 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/contrib/hg-to-git/hg-to-git.py 2017-11-28 04:47:44.000000000 +0000 @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program; if not, see . """ import os, os.path, sys diff -Nru git-2.15.0/debian/changelog git-2.15.1/debian/changelog --- git-2.15.0/debian/changelog 2017-10-31 20:57:18.000000000 +0000 +++ git-2.15.1/debian/changelog 2017-11-30 22:24:44.000000000 +0000 @@ -1,8 +1,21 @@ -git (1:2.15.0-1~ppa0~ubuntu17.04.1) zesty; urgency=medium +git (1:2.15.1-1~ppa0~ubuntu17.04.1) zesty; urgency=medium * Build for PPA. - -- Anders Kaseorg Tue, 31 Oct 2017 16:57:18 -0400 + -- Anders Kaseorg Thu, 30 Nov 2017 17:24:44 -0500 + +git (1:2.15.1-1) unstable; urgency=low + + * new upstream point release (see RelNotes/2.15.1.txt). + * debian/control: Build-Depends-Indep: asciidoc (>= 8.6.10). + * debian/control: Standards-Version: 4.1.1.1. + * debian/patches: + * Normalize-generated-asciidoc-timestamps-...diff: remove; no + longer needed (thx Anders Kaseorg; see #782294). + * git-gui-Sort-entries-in-optimized-tclIndex.diff: update to + upstream version. + + -- Jonathan Nieder Wed, 29 Nov 2017 13:49:38 -0800 git (1:2.15.0-1) unstable; urgency=low diff -Nru git-2.15.0/debian/changelog.upstream git-2.15.1/debian/changelog.upstream --- git-2.15.0/debian/changelog.upstream 2017-10-31 20:55:49.000000000 +0000 +++ git-2.15.1/debian/changelog.upstream 2017-11-30 22:24:25.000000000 +0000 @@ -1,3 +1,114 @@ +Version v2.15.1; changes since v2.15.0: +--------------------------------------- + +Adam Dinwoodie (3): + t5580: add Cygwin support + rebase -i: fix comment typo + doc/SubmittingPatches: correct subject guidance + +Andrey Okoshkin (2): + commit: check result of resolve_ref_unsafe + diff: fix lstat() error handling in diff_populate_filespec() + +Brandon Williams (1): + wt-status: actually ignore submodules when requested + +Carlos Martín Nieto (1): + diff: --indent-heuristic is no longer experimental + +Charles Bailey (2): + t4201: make use of abbreviation in the test more robust + grep: fix NO_LIBPCRE1_JIT to fully disable JIT + +Dennis Kaarsemaker (1): + credential-libsecret: unlock locked secrets + +Jacob Keller (1): + sequencer: pass absolute GIT_DIR to exec commands + +Jakub Bereżański (2): + t0302: check helper can handle empty credentials + wincred: handle empty username/password correctly + +Jean Carlo Machado (1): + fix typos in 2.15.0 release notes + +Jeff King (11): + t4015: refactor --color-moved whitespace test + t4015: check "negative" case for "-w --color-moved" + t4015: test the output of "diff --color-moved -b" + diff: fix whitespace-skipping with --color-moved + diff: handle NULs in get_string_hash() + test-ref-store: avoid passing NULL to printf + remote: handle broken symrefs + log: handle broken HEAD in decoration check + worktree: handle broken symrefs in find_shared_symref() + setup: avoid double slashes when looking for HEAD + link_alt_odb_entries: make empty input a noop + +Johannes Schindelin (5): + status: do not get confused by submodules in excluded directories + mingw: include the full version information in the resources + mingw: add experimental feature to redirect standard handles + mingw: optionally redirect stderr/stdout via the same handle + mingw: document the standard handle redirection + +Junio C Hamano (9): + t5601: rm the target file of cp that could still be executing + check-ref-format --branch: do not expand @{...} outside repository + check-ref-format --branch: strip refs/heads/ using skip_prefix + check-ref-format doc: --branch validates and expands + column: do not include pager.c + Start preparation for 2.15.1 + Almost ready for 2.15.1 + A bit more fixes for 2.15.1 + Git 2.15.1 + +Kaartic Sivaraam (1): + mailmap: use Kaartic Sivaraam's new address + +Kevin Daudt (1): + column: show auto columns when pager is active + +Martin Ågren (7): + grep: take the read-lock when adding a submodule + bisect: change calling-convention of `find_bisection()` + bisect: fix memory leak in `find_bisection()` + bisect: fix off-by-one error in `best_bisection_sorted()` + bisect: fix memory leak when returning best element + builtin/merge-base: free commit lists + reduce_heads: fix memory leaks + +René Scharfe (6): + sequencer: factor out rewrite_file() + sequencer: use O_TRUNC to truncate files + imap-send: handle NULL return of next_arg() + imap-send: handle missing response codes gracefully + apply: avoid out-of-bounds access in fuzzy_matchlines() + config: flip return value of write_section() + +SZEDER Gábor (2): + travis-ci: fix running P4 and Git LFS tests in Linux build jobs + travis-ci: don't build Git for the static analysis job + +Simon Ruderich (2): + sequencer.c: check return value of close() in rewrite_file() + wrapper.c: consistently quote filenames in error messages + +Stefan Beller (3): + xdiff-interface: export comparing and hashing strings + diff.c: get rid of duplicate implementation + config: document blame configuration + +Thomas Braun (1): + completion: add remaining flags to checkout + +Todd Zullinger (3): + Replace Free Software Foundation address in license notices + Replace Free Software Foundation address in license notices + RelNotes: minor typo fixes in 2.15.1 draft + + Version v2.15.0; changes since v2.15.0-rc2: ------------------------------------------- diff -Nru git-2.15.0/debian/control git-2.15.1/debian/control --- git-2.15.0/debian/control 2017-10-31 20:56:40.000000000 +0000 +++ git-2.15.1/debian/control 2017-11-30 22:24:25.000000000 +0000 @@ -18,7 +18,7 @@ dh-apache2, dpkg-dev (>= 1.16.2~) Build-Depends-Indep: asciidoc, xmlto, docbook-xsl -Standards-Version: 4.0.1.0 +Standards-Version: 4.1.1.1 Homepage: https://git-scm.com/ Vcs-Git: https://repo.or.cz/r/git/debian.git/ Vcs-Browser: http://repo.or.cz/w/git/debian.git/ diff -Nru git-2.15.0/debian/patches/git-gui-Sort-entries-in-optimized-tclIndex.diff git-2.15.1/debian/patches/git-gui-Sort-entries-in-optimized-tclIndex.diff --- git-2.15.0/debian/patches/git-gui-Sort-entries-in-optimized-tclIndex.diff 2017-10-09 18:49:40.000000000 +0000 +++ git-2.15.1/debian/patches/git-gui-Sort-entries-in-optimized-tclIndex.diff 2017-11-30 22:24:25.000000000 +0000 @@ -1,19 +1,21 @@ -From a41e3597a3f5877aa86bb1b0296088bf4b31f6c0 Mon Sep 17 00:00:00 2001 +From a74fe226d8247a1fb78947fadccbff0a041fa8dc Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 16 Nov 2016 16:37:17 -0500 -Subject: git-gui: Sort entries in optimized tclIndex -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit +Subject: git-gui: sort entries in optimized tclIndex + +commit 474642b4a47c74a1f277955d7387d1886546fa01 upstream. auto_mkindex expands wildcards in directory order, which depends on the underlying filesystem. To improve build reproducibility, sort the list of *.tcl files in the Makefile. -The unoptimized loading case was previously fixed in -v2.11.0-rc0~31^2^2~14 “git-gui: sort entries in tclIndex”. +The unoptimized loading case was previously fixed in gitgui-0.21.0~14 +(git-gui: sort entries in tclIndex, 2015-01-26). Signed-off-by: Anders Kaseorg +Signed-off-by: Jonathan Nieder +Signed-off-by: Junio C Hamano +Signed-off-by: Jonathan Nieder --- git-gui/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -32,5 +34,5 @@ else \ echo >&2 " * $(TCL_PATH) failed; using unoptimized loading"; \ -- -2.14.1.992.g2c7b836f3a +2.15.0.531.g2ccb3012c9 diff -Nru git-2.15.0/debian/versions.upstream git-2.15.1/debian/versions.upstream --- git-2.15.0/debian/versions.upstream 2017-10-31 20:55:49.000000000 +0000 +++ git-2.15.1/debian/versions.upstream 2017-11-30 22:24:25.000000000 +0000 @@ -598,3 +598,4 @@ v2.15.0-rc1 v2.15.0-rc2 v2.15.0 +v2.15.1 diff -Nru git-2.15.0/diff.c git-2.15.1/diff.c --- git-2.15.0/diff.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/diff.c 2017-11-28 04:47:44.000000000 +0000 @@ -707,83 +707,14 @@ struct moved_entry *next_line; }; -static int next_byte(const char **cp, const char **endp, - const struct diff_options *diffopt) -{ - int retval; - - if (*cp > *endp) - return -1; - - if (isspace(**cp)) { - if (DIFF_XDL_TST(diffopt, IGNORE_WHITESPACE_CHANGE)) { - while (*cp < *endp && isspace(**cp)) - (*cp)++; - /* - * After skipping a couple of whitespaces, - * we still have to account for one space. - */ - return (int)' '; - } - - if (DIFF_XDL_TST(diffopt, IGNORE_WHITESPACE)) { - while (*cp < *endp && isspace(**cp)) - (*cp)++; - /* return the first non-ws character via the usual below */ - } - } - - retval = (unsigned char)(**cp); - (*cp)++; - return retval; -} - static int moved_entry_cmp(const struct diff_options *diffopt, const struct moved_entry *a, const struct moved_entry *b, const void *keydata) { - const char *ap = a->es->line, *ae = a->es->line + a->es->len; - const char *bp = b->es->line, *be = b->es->line + b->es->len; - - if (!(diffopt->xdl_opts & XDF_WHITESPACE_FLAGS)) - return a->es->len != b->es->len || memcmp(ap, bp, a->es->len); - - if (DIFF_XDL_TST(diffopt, IGNORE_WHITESPACE_AT_EOL)) { - while (ae > ap && isspace(*ae)) - ae--; - while (be > bp && isspace(*be)) - be--; - } - - while (1) { - int ca, cb; - ca = next_byte(&ap, &ae, diffopt); - cb = next_byte(&bp, &be, diffopt); - if (ca != cb) - return 1; - if (ca < 0) - return 0; - } -} - -static unsigned get_string_hash(struct emitted_diff_symbol *es, struct diff_options *o) -{ - if (o->xdl_opts & XDF_WHITESPACE_FLAGS) { - static struct strbuf sb = STRBUF_INIT; - const char *ap = es->line, *ae = es->line + es->len; - int c; - - strbuf_reset(&sb); - while (ae > ap && isspace(*ae)) - ae--; - while ((c = next_byte(&ap, &ae, o)) > 0) - strbuf_addch(&sb, c); - - return memhash(sb.buf, sb.len); - } else { - return memhash(es->line, es->len); - } + return !xdiff_compare_lines(a->es->line, a->es->len, + b->es->line, b->es->len, + diffopt->xdl_opts); } static struct moved_entry *prepare_entry(struct diff_options *o, @@ -792,7 +723,7 @@ struct moved_entry *ret = xmalloc(sizeof(*ret)); struct emitted_diff_symbol *l = &o->emitted_symbols->buf[line_no]; - ret->ent.hash = get_string_hash(l, o); + ret->ent.hash = xdiff_hash_string(l->line, l->len, o->xdl_opts); ret->es = l; ret->next_line = NULL; @@ -3614,14 +3545,12 @@ int fd; if (lstat(s->path, &st) < 0) { - if (errno == ENOENT) { - err_empty: - err = -1; - empty: - s->data = (char *)""; - s->size = 0; - return err; - } + err_empty: + err = -1; + empty: + s->data = (char *)""; + s->size = 0; + return err; } s->size = xsize_t(st.st_size); if (!s->size) diff -Nru git-2.15.0/dir.c git-2.15.1/dir.c --- git-2.15.0/dir.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/dir.c 2017-11-28 04:47:44.000000000 +0000 @@ -1392,7 +1392,7 @@ if (!(dir->flags & DIR_NO_GITLINKS)) { unsigned char sha1[20]; if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0) - return path_untracked; + return exclude ? path_excluded : path_untracked; } return path_recurse; } diff -Nru git-2.15.0/Documentation/config.txt git-2.15.1/Documentation/config.txt --- git-2.15.0/Documentation/config.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/config.txt 2017-11-28 04:47:44.000000000 +0000 @@ -949,6 +949,23 @@ Tells 'git apply' how to handle whitespaces, in the same way as the `--whitespace` option. See linkgit:git-apply[1]. +blame.showRoot:: + Do not treat root commits as boundaries in linkgit:git-blame[1]. + This option defaults to false. + +blame.blankBoundary:: + Show blank commit object name for boundary commits in + linkgit:git-blame[1]. This option defaults to false. + +blame.showEmail:: + Show the author email instead of author name in linkgit:git-blame[1]. + This option defaults to false. + +blame.date:: + Specifies the format used to output dates in linkgit:git-blame[1]. + If unset the iso format is used. For supported values, + see the discussion of the `--date` option at linkgit:git-log[1]. + branch.autoSetupMerge:: Tells 'git branch' and 'git checkout' to set up new branches so that linkgit:git-pull[1] will appropriately merge from the diff -Nru git-2.15.0/Documentation/diff-heuristic-options.txt git-2.15.1/Documentation/diff-heuristic-options.txt --- git-2.15.0/Documentation/diff-heuristic-options.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/diff-heuristic-options.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ ---indent-heuristic:: ---no-indent-heuristic:: - These are to help debugging and tuning experimental heuristics - (which are off by default) that shift diff hunk boundaries to - make patches easier to read. diff -Nru git-2.15.0/Documentation/diff-options.txt git-2.15.1/Documentation/diff-options.txt --- git-2.15.0/Documentation/diff-options.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/diff-options.txt 2017-11-28 04:47:44.000000000 +0000 @@ -63,7 +63,12 @@ Synonym for `-p --raw`. endif::git-format-patch[] -include::diff-heuristic-options.txt[] +--indent-heuristic:: + Enable the heuristic that shift diff hunk boundaries to make patches + easier to read. This is the default. + +--no-indent-heuristic:: + Disable the indent heuristic. --minimal:: Spend extra time to make sure the smallest possible diff -Nru git-2.15.0/Documentation/git-annotate.txt git-2.15.1/Documentation/git-annotate.txt --- git-2.15.0/Documentation/git-annotate.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/git-annotate.txt 2017-11-28 04:47:44.000000000 +0000 @@ -23,7 +23,6 @@ OPTIONS ------- include::blame-options.txt[] -include::diff-heuristic-options.txt[] SEE ALSO -------- diff -Nru git-2.15.0/Documentation/git-blame.txt git-2.15.1/Documentation/git-blame.txt --- git-2.15.0/Documentation/git-blame.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/git-blame.txt 2017-11-28 04:47:44.000000000 +0000 @@ -89,8 +89,6 @@ abbreviated object name, use +1 digits. Note that 1 column is used for a caret to mark the boundary commit. -include::diff-heuristic-options.txt[] - THE PORCELAIN FORMAT -------------------- diff -Nru git-2.15.0/Documentation/git-check-ref-format.txt git-2.15.1/Documentation/git-check-ref-format.txt --- git-2.15.0/Documentation/git-check-ref-format.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/git-check-ref-format.txt 2017-11-28 04:47:44.000000000 +0000 @@ -77,7 +77,14 @@ . at-open-brace `@{` is used as a notation to access a reflog entry. -With the `--branch` option, it expands the ``previous branch syntax'' +With the `--branch` option, the command takes a name and checks if +it can be used as a valid branch name (e.g. when creating a new +branch). The rule `git check-ref-format --branch $name` implements +may be stricter than what `git check-ref-format refs/heads/$name` +says (e.g. a dash may appear at the beginning of a ref component, +but it is explicitly forbidden at the beginning of a branch name). +When run with `--branch` option in a repository, the input is first +expanded for the ``previous branch syntax'' `@{-n}`. For example, `@{-1}` is a way to refer the last branch you were on. This option should be used by porcelains to accept this syntax anywhere a branch name is expected, so they can act as if you diff -Nru git-2.15.0/Documentation/git.txt git-2.15.1/Documentation/git.txt --- git-2.15.0/Documentation/git.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/git.txt 2017-11-28 04:47:44.000000000 +0000 @@ -709,6 +709,24 @@ the background which do not want to cause lock contention with other operations on the repository. Defaults to `1`. +`GIT_REDIRECT_STDIN`:: +`GIT_REDIRECT_STDOUT`:: +`GIT_REDIRECT_STDERR`:: + Windows-only: allow redirecting the standard input/output/error + handles to paths specified by the environment variables. This is + particularly useful in multi-threaded applications where the + canonical way to pass standard handles via `CreateProcess()` is + not an option because it would require the handles to be marked + inheritable (and consequently *every* spawned process would + inherit them, possibly blocking regular Git operations). The + primary intended use case is to use named pipes for communication + (e.g. `\\.\pipe\my-git-stdin-123`). ++ +Two special values are supported: `off` will simply close the +corresponding standard handle, and if `GIT_REDIRECT_STDERR` is +`2>&1`, standard error will be redirected to the same handle as +standard output. + Discussion[[Discussion]] ------------------------ diff -Nru git-2.15.0/Documentation/RelNotes/2.15.0.txt git-2.15.1/Documentation/RelNotes/2.15.0.txt --- git-2.15.0/Documentation/RelNotes/2.15.0.txt 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/RelNotes/2.15.0.txt 2017-11-28 04:47:44.000000000 +0000 @@ -65,7 +65,7 @@ learned to take the 'unfold' and 'only' modifiers to normalize its output, e.g. "git log --format=%(trailers:only,unfold)". - * "gitweb" shows a link to visit the 'raw' contents of blbos in the + * "gitweb" shows a link to visit the 'raw' contents of blobs in the history overview page. * "[gc] rerereResolved = 5.days" used to be invalid, as the variable @@ -109,13 +109,13 @@ * Conversion from uchar[20] to struct object_id continues. * Start using selected c99 constructs in small, stable and - essentialpart of the system to catch people who care about + essential part of the system to catch people who care about older compilers that do not grok them. * The filter-process interface learned to allow a process with long latency give a "delayed" response. - * Many uses of comparision callback function the hashmap API uses + * Many uses of comparison callback function the hashmap API uses cast the callback function type when registering it to hashmap_init(), which defeats the compile time type checking when the callback interface changes (e.g. gaining more parameters). diff -Nru git-2.15.0/Documentation/RelNotes/2.15.1.txt git-2.15.1/Documentation/RelNotes/2.15.1.txt --- git-2.15.0/Documentation/RelNotes/2.15.1.txt 1970-01-01 00:00:00.000000000 +0000 +++ git-2.15.1/Documentation/RelNotes/2.15.1.txt 2017-11-28 04:47:44.000000000 +0000 @@ -0,0 +1,88 @@ +Git v2.15.1 Release Notes +========================= + +Fixes since v2.15 +----------------- + + * TravisCI build updates. + + * "auto" as a value for the columnar output configuration ought to + judge "is the output consumed by humans?" with the same criteria as + "auto" for coloured output configuration, i.e. either the standard + output stream is going to tty, or a pager is in use. We forgot the + latter, which has been fixed. + + * The experimental "color moved lines differently in diff output" + feature was buggy around "ignore whitespace changes" edges, which + has been corrected. + + * Instead of using custom line comparison and hashing functions to + implement "moved lines" coloring in the diff output, use the pair + of these functions from lower-layer xdiff/ code. + + * Some codepaths did not check for errors when asking what branch the + HEAD points at, which have been fixed. + + * "git commit", after making a commit, did not check for errors when + asking on what branch it made the commit, which has been corrected. + + * "git status --ignored -u" did not stop at a working tree of a + separate project that is embedded in an ignored directory and + listed files in that other project, instead of just showing the + directory itself as ignored. + + * A broken access to object databases in recent update to "git grep + --recurse-submodules" has been fixed. + + * A recent regression in "git rebase -i" that broke execution of git + commands from subdirectories via "exec" instruction has been fixed. + + * "git check-ref-format --branch @{-1}" bit a "BUG()" when run + outside a repository for obvious reasons; clarify the documentation + and make sure we do not even try to expand the at-mark magic in + such a case, but still call the validation logic for branch names. + + * Command line completion (in contrib/) update. + + * Description of blame.{showroot,blankboundary,showemail,date} + configuration variables have been added to "git config --help". + + * After an error from lstat(), diff_populate_filespec() function + sometimes still went ahead and used invalid data in struct stat, + which has been fixed. + + * UNC paths are also relevant in Cygwin builds and they are now + tested just like Mingw builds. + + * Correct start-up sequence so that a repository could be placed + immediately under the root directory again (which was broken at + around Git 2.13). + + * The credential helper for libsecret (in contrib/) has been improved + to allow possibly prompting the end user to unlock secrets that are + currently locked (otherwise the secrets may not be loaded). + + * Updates from GfW project. + + * "git rebase -i" recently started misbehaving when a submodule that + is configured with 'submodule..ignore' is dirty; this has + been corrected. + + * Some error messages did not quote filenames shown in it, which have + been fixed. + + * Building with NO_LIBPCRE1_JIT did not disable it, which has been fixed. + + * We used to add an empty alternate object database to the system + that does not help anything; it has been corrected. + + * Error checking in "git imap-send" for empty response has been + improved. + + * An ancient bug in "git apply --ignore-space-change" codepath has + been fixed. + + * There was a recent semantic mismerge in the codepath to write out a + section of a configuration section, which has been corrected. + +Also contains various documentation updates and code clean-ups. diff -Nru git-2.15.0/Documentation/SubmittingPatches git-2.15.1/Documentation/SubmittingPatches --- git-2.15.0/Documentation/SubmittingPatches 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Documentation/SubmittingPatches 2017-11-28 04:47:44.000000000 +0000 @@ -184,14 +184,15 @@ It is a common convention to prefix your subject line with [PATCH]. This lets people easily distinguish patches from other -e-mail discussions. Use of additional markers after PATCH and -the closing bracket to mark the nature of the patch is also -encouraged. E.g. [PATCH/RFC] is often used when the patch is -not ready to be applied but it is for discussion, [PATCH v2], -[PATCH v3] etc. are often seen when you are sending an update to -what you have previously sent. +e-mail discussions. Use of markers in addition to PATCH within +the brackets to describe the nature of the patch is also +encouraged. E.g. [RFC PATCH] (where RFC stands for "request for +comments") is often used to indicate a patch needs further +discussion before being accepted, [PATCH v2], [PATCH v3] etc. +are often seen when you are sending an update to what you have +previously sent. -"git format-patch" command follows the best current practice to +The "git format-patch" command follows the best current practice to format the body of an e-mail message. At the beginning of the patch should come your commit message, ending with the Signed-off-by: lines, and a line that consists of three dashes, @@ -199,6 +200,10 @@ you are forwarding a patch from somebody else, optionally, at the beginning of the e-mail message just before the commit message starts, you can put a "From: " line to name that person. +To change the default "[PATCH]" in the subject to "[]", use +`git format-patch --subject-prefix=`. As a shortcut, you +can use `--rfc` instead of `--subject-prefix="RFC PATCH"`, or +`-v ` instead of `--subject-prefix="PATCH v"`. You often want to add additional explanation about the patch, other than the commit message itself. Place such "cover letter" diff -Nru git-2.15.0/ewah/bitmap.c git-2.15.1/ewah/bitmap.c --- git-2.15.0/ewah/bitmap.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ewah/bitmap.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * along with this program; if not, see . */ #include "cache.h" #include "ewok.h" diff -Nru git-2.15.0/ewah/ewah_bitmap.c git-2.15.1/ewah/ewah_bitmap.c --- git-2.15.0/ewah/ewah_bitmap.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ewah/ewah_bitmap.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * along with this program; if not, see . */ #include "git-compat-util.h" #include "ewok.h" diff -Nru git-2.15.0/ewah/ewah_io.c git-2.15.1/ewah/ewah_io.c --- git-2.15.0/ewah/ewah_io.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ewah/ewah_io.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * along with this program; if not, see . */ #include "git-compat-util.h" #include "ewok.h" diff -Nru git-2.15.0/ewah/ewah_rlw.c git-2.15.1/ewah/ewah_rlw.c --- git-2.15.0/ewah/ewah_rlw.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ewah/ewah_rlw.c 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * along with this program; if not, see . */ #include "git-compat-util.h" #include "ewok.h" diff -Nru git-2.15.0/ewah/ewok.h git-2.15.1/ewah/ewok.h --- git-2.15.0/ewah/ewok.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ewah/ewok.h 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * along with this program; if not, see . */ #ifndef __EWOK_BITMAP_H__ #define __EWOK_BITMAP_H__ diff -Nru git-2.15.0/ewah/ewok_rlw.h git-2.15.1/ewah/ewok_rlw.h --- git-2.15.0/ewah/ewok_rlw.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/ewah/ewok_rlw.h 2017-11-28 04:47:44.000000000 +0000 @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * along with this program; if not, see . */ #ifndef __EWOK_RLW_H__ #define __EWOK_RLW_H__ diff -Nru git-2.15.0/git-gui/git-gui.sh git-2.15.1/git-gui/git-gui.sh --- git-2.15.0/git-gui/git-gui.sh 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/git-gui/git-gui.sh 2017-11-28 04:47:44.000000000 +0000 @@ -24,8 +24,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}] +along with this program; if not, see .}] ###################################################################### ## diff -Nru git-2.15.0/git.rc git-2.15.1/git.rc --- git-2.15.0/git.rc 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/git.rc 2017-11-28 04:47:44.000000000 +0000 @@ -1,6 +1,6 @@ 1 VERSIONINFO -FILEVERSION MAJOR,MINOR,0,0 -PRODUCTVERSION MAJOR,MINOR,0,0 +FILEVERSION MAJOR,MINOR,MICRO,PATCHLEVEL +PRODUCTVERSION MAJOR,MINOR,MICRO,PATCHLEVEL BEGIN BLOCK "StringFileInfo" BEGIN diff -Nru git-2.15.0/git-rebase--interactive.sh git-2.15.1/git-rebase--interactive.sh --- git-2.15.0/git-rebase--interactive.sh 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/git-rebase--interactive.sh 2017-11-28 04:47:44.000000000 +0000 @@ -722,7 +722,7 @@ git rebase--helper --shorten-ids } -# Add commands after a pick or after a squash/fixup serie +# Add commands after a pick or after a squash/fixup series # in the todo list. add_exec_commands () { { diff -Nru git-2.15.0/GIT-VERSION-GEN git-2.15.1/GIT-VERSION-GEN --- git-2.15.0/GIT-VERSION-GEN 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/GIT-VERSION-GEN 2017-11-28 04:47:44.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.15.0 +DEF_VER=v2.15.1 LF=' ' diff -Nru git-2.15.0/grep.c git-2.15.1/grep.c --- git-2.15.0/grep.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/grep.c 2017-11-28 04:47:44.000000000 +0000 @@ -387,7 +387,7 @@ if (!p->pcre1_regexp) compile_regexp_failed(p, error); - p->pcre1_extra_info = pcre_study(p->pcre1_regexp, PCRE_STUDY_JIT_COMPILE, &error); + p->pcre1_extra_info = pcre_study(p->pcre1_regexp, GIT_PCRE_STUDY_JIT_COMPILE, &error); if (!p->pcre1_extra_info && error) die("%s", error); diff -Nru git-2.15.0/grep.h git-2.15.1/grep.h --- git-2.15.0/grep.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/grep.h 2017-11-28 04:47:44.000000000 +0000 @@ -7,11 +7,12 @@ #if PCRE_MAJOR >= 8 && PCRE_MINOR >= 32 #ifndef NO_LIBPCRE1_JIT #define GIT_PCRE1_USE_JIT +#define GIT_PCRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE #endif #endif #endif -#ifndef PCRE_STUDY_JIT_COMPILE -#define PCRE_STUDY_JIT_COMPILE 0 +#ifndef GIT_PCRE_STUDY_JIT_COMPILE +#define GIT_PCRE_STUDY_JIT_COMPILE 0 #endif #if PCRE_MAJOR <= 8 && PCRE_MINOR < 20 typedef int pcre_jit_stack; diff -Nru git-2.15.0/imap-send.c git-2.15.1/imap-send.c --- git-2.15.0/imap-send.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/imap-send.c 2017-11-28 04:47:44.000000000 +0000 @@ -18,8 +18,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, see . */ #include "cache.h" @@ -684,7 +683,7 @@ struct imap *imap = ctx->imap; char *arg, *p; - if (*s != '[') + if (!s || *s != '[') return RESP_OK; /* no response code */ s++; if (!(p = strchr(s, ']'))) { @@ -693,6 +692,10 @@ } *p++ = 0; arg = next_arg(&s); + if (!arg) { + fprintf(stderr, "IMAP error: empty response code\n"); + return RESP_BAD; + } if (!strcmp("UIDVALIDITY", arg)) { if (!(arg = next_arg(&s)) || !(ctx->uidvalidity = atoi(arg))) { fprintf(stderr, "IMAP error: malformed UIDVALIDITY status\n"); @@ -725,7 +728,8 @@ { struct imap *imap = ctx->imap; struct imap_cmd *cmdp, **pcmdp; - char *cmd, *arg, *arg1; + char *cmd; + const char *arg, *arg1; int n, resp, resp2, tag; for (;;) { @@ -733,6 +737,10 @@ return RESP_BAD; arg = next_arg(&cmd); + if (!arg) { + fprintf(stderr, "IMAP error: empty response\n"); + return RESP_BAD; + } if (*arg == '*') { arg = next_arg(&cmd); if (!arg) { @@ -807,6 +815,8 @@ if (cmdp->cb.cont || cmdp->cb.data) imap->literal_pending = 0; arg = next_arg(&cmd); + if (!arg) + arg = ""; if (!strcmp("OK", arg)) resp = DRV_OK; else { diff -Nru git-2.15.0/kwset.c git-2.15.1/kwset.c --- git-2.15.0/kwset.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/kwset.c 2017-11-28 04:47:44.000000000 +0000 @@ -18,9 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program; if not, see . */ /* Written August 1989 by Mike Haertel. The author may be reached (Email) at the address mike@ai.mit.edu, diff -Nru git-2.15.0/kwset.h git-2.15.1/kwset.h --- git-2.15.0/kwset.h 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/kwset.h 2017-11-28 04:47:44.000000000 +0000 @@ -17,9 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program; if not, see . */ /* Written August 1989 by Mike Haertel. The author may be reached (Email) at the address mike@ai.mit.edu, diff -Nru git-2.15.0/log-tree.c git-2.15.1/log-tree.c --- git-2.15.0/log-tree.c 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/log-tree.c 2017-11-28 04:47:44.000000000 +0000 @@ -198,7 +198,7 @@ /* Now resolve and find the matching current branch */ branch_name = resolve_ref_unsafe("HEAD", 0, NULL, &rru_flags); - if (!(rru_flags & REF_ISSYMREF)) + if (!branch_name || !(rru_flags & REF_ISSYMREF)) return NULL; if (!starts_with(branch_name, "refs/")) diff -Nru git-2.15.0/.mailmap git-2.15.1/.mailmap --- git-2.15.0/.mailmap 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/.mailmap 2017-11-28 04:47:44.000000000 +0000 @@ -113,6 +113,7 @@ Junio C Hamano Junio C Hamano Junio C Hamano +Kaartic Sivaraam Karl Wiberg Karl Hasselström Karl Wiberg Karsten Blees diff -Nru git-2.15.0/Makefile git-2.15.1/Makefile --- git-2.15.0/Makefile 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/Makefile 2017-11-28 04:47:44.000000000 +0000 @@ -1940,7 +1940,8 @@ git.res: git.rc GIT-VERSION-FILE $(QUIET_RC)$(RC) \ - $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \ + $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \ + $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \ -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@ # This makes sure we depend on the NO_PERL setting itself. diff -Nru git-2.15.0/RelNotes git-2.15.1/RelNotes --- git-2.15.0/RelNotes 2017-10-30 05:56:17.000000000 +0000 +++ git-2.15.1/RelNotes 2017-11-28 04:47:44.000000000 +0000 @@ -1,508 +1,88 @@ -Git 2.15 Release Notes -====================== +Git v2.15.1 Release Notes +========================= -Backward compatibility notes and other notable changes. - - * Use of an empty string as a pathspec element that is used for - 'everything matches' is still warned and Git asks users to use a - more explicit '.' for that instead. The hope is that existing - users will not mind this change, and eventually the warning can be - turned into a hard error, upgrading the deprecation into removal of - this (mis)feature. That is now scheduled to happen in Git v2.16, - the next major release after this one. - - * Git now avoids blindly falling back to ".git" when the setup - sequence said we are _not_ in Git repository. A corner case that - happens to work right now may be broken by a call to BUG(). - We've tried hard to locate such cases and fixed them, but there - might still be cases that need to be addressed--bug reports are - greatly appreciated. - - * "branch --set-upstream" that has been deprecated in Git 1.8 has - finally been retired. - - -Updates since v2.14 -------------------- - -UI, Workflows & Features - - * An example that is now obsolete has been removed from a sample hook, - and an old example in it that added a sign-off manually has been - improved to use the interpret-trailers command. - - * The advice message given when "git rebase" stops for conflicting - changes has been improved. - - * The "rerere-train" script (in contrib/) learned the "--overwrite" - option to allow overwriting existing recorded resolutions. - - * "git contacts" (in contrib/) now lists the address on the - "Reported-by:" trailer to its output, in addition to those on - S-o-b: and other trailers, to make it easier to notify (and thank) - the original bug reporter. - - * "git rebase", especially when it is run by mistake and ends up - trying to replay many changes, spent long time in silence. The - command has been taught to show progress report when it spends - long time preparing these many changes to replay (which would give - the user a chance to abort with ^C). - - * "git merge" learned a "--signoff" option to add the Signed-off-by: - trailer with the committer's name. - - * "git diff" learned to optionally paint new lines that are the same - as deleted lines elsewhere differently from genuinely new lines. - - * "git interpret-trailers" learned to take the trailer specifications - from the command line that overrides the configured values. - - * "git interpret-trailers" has been taught a "--parse" and a few - other options to make it easier for scripts to grab existing - trailer lines from a commit log message. - - * The "--format=%(trailers)" option "git log" and its friends take - learned to take the 'unfold' and 'only' modifiers to normalize its - output, e.g. "git log --format=%(trailers:only,unfold)". - - * "gitweb" shows a link to visit the 'raw' contents of blbos in the - history overview page. - - * "[gc] rerereResolved = 5.days" used to be invalid, as the variable - is defined to take an integer counting the number of days. It now - is allowed. - - * The code to acquire a lock on a reference (e.g. while accepting a - push from a client) used to immediately fail when the reference is - already locked---now it waits for a very short while and retries, - which can make it succeed if the lock holder was holding it during - a read-only operation. - - * "branch --set-upstream" that has been deprecated in Git 1.8 has - finally been retired. - - * The codepath to call external process filter for smudge/clean - operation learned to show the progress meter. - - * "git rev-parse" learned "--is-shallow-repository", that is to be - used in a way similar to existing "--is-bare-repository" and - friends. +Fixes since v2.15 +----------------- - * "git describe --match " has been taught to play well with - the "--all" option. + * TravisCI build updates. - * "git branch" learned "-c/-C" to create a new branch by copying an - existing one. + * "auto" as a value for the columnar output configuration ought to + judge "is the output consumed by humans?" with the same criteria as + "auto" for coloured output configuration, i.e. either the standard + output stream is going to tty, or a pager is in use. We forgot the + latter, which has been fixed. - * Some commands (most notably "git status") makes an opportunistic - update when performing a read-only operation to help optimize later - operations in the same repository. The new "--no-optional-locks" - option can be passed to Git to disable them. + * The experimental "color moved lines differently in diff output" + feature was buggy around "ignore whitespace changes" edges, which + has been corrected. - * "git for-each-ref --format=..." learned a new format element, - %(trailers), to show only the commit log trailer part of the log - message. + * Instead of using custom line comparison and hashing functions to + implement "moved lines" coloring in the diff output, use the pair + of these functions from lower-layer xdiff/ code. + * Some codepaths did not check for errors when asking what branch the + HEAD points at, which have been fixed. -Performance, Internal Implementation, Development Support etc. + * "git commit", after making a commit, did not check for errors when + asking on what branch it made the commit, which has been corrected. - * Conversion from uchar[20] to struct object_id continues. + * "git status --ignored -u" did not stop at a working tree of a + separate project that is embedded in an ignored directory and + listed files in that other project, instead of just showing the + directory itself as ignored. - * Start using selected c99 constructs in small, stable and - essentialpart of the system to catch people who care about - older compilers that do not grok them. + * A broken access to object databases in recent update to "git grep + --recurse-submodules" has been fixed. - * The filter-process interface learned to allow a process with long - latency give a "delayed" response. + * A recent regression in "git rebase -i" that broke execution of git + commands from subdirectories via "exec" instruction has been fixed. - * Many uses of comparision callback function the hashmap API uses - cast the callback function type when registering it to - hashmap_init(), which defeats the compile time type checking when - the callback interface changes (e.g. gaining more parameters). - The callback implementations have been updated to take "void *" - pointers and cast them to the type they expect instead. + * "git check-ref-format --branch @{-1}" bit a "BUG()" when run + outside a repository for obvious reasons; clarify the documentation + and make sure we do not even try to expand the at-mark magic in + such a case, but still call the validation logic for branch names. - * Because recent Git for Windows do come with a real msgfmt, the - build procedure for git-gui has been updated to use it instead of a - hand-rolled substitute. + * Command line completion (in contrib/) update. - * "git grep --recurse-submodules" has been reworked to give a more - consistent output across submodule boundary (and do its thing - without having to fork a separate process). + * Description of blame.{showroot,blankboundary,showemail,date} + configuration variables have been added to "git config --help". - * A helper function to read a single whole line into strbuf - mistakenly triggered OOM error at EOF under certain conditions, + * After an error from lstat(), diff_populate_filespec() function + sometimes still went ahead and used invalid data in struct stat, which has been fixed. - * The "ref-store" code reorganization continues. - - * "git commit" used to discard the index and re-read from the filesystem - just in case the pre-commit hook has updated it in the middle; this - has been optimized out when we know we do not run the pre-commit hook. - (merge 680ee550d7 kw/commit-keep-index-when-pre-commit-is-not-run later to maint). - - * Updates to the HTTP layer we made recently unconditionally used - features of libCurl without checking the existence of them, causing - compilation errors, which has been fixed. Also migrate the code to - check feature macros, not version numbers, to cope better with - libCurl that vendor ships with backported features. - - * The API to start showing progress meter after a short delay has - been simplified. - (merge 8aade107dd jc/simplify-progress later to maint). - - * Code clean-up to avoid mixing values read from the .gitmodules file - and values read from the .git/config file. - - * We used to spend more than necessary cycles allocating and freeing - piece of memory while writing each index entry out. This has been - optimized. - - * Platforms that ship with a separate sha1 with collision detection - library can link to it instead of using the copy we ship as part of - our source tree. - - * Code around "notes" have been cleaned up. - (merge 3964281524 mh/notes-cleanup later to maint). - - * The long-standing rule that an in-core lockfile instance, once it - is used, must not be freed, has been lifted and the lockfile and - tempfile APIs have been updated to reduce the chance of programming - errors. - - * Our hashmap implementation in hashmap.[ch] is not thread-safe when - adding a new item needs to expand the hashtable by rehashing; add - an API to disable the automatic rehashing to work it around. - - * Many of our programs consider that it is OK to release dynamic - storage that is used throughout the life of the program by simply - exiting, but this makes it harder to leak detection tools to avoid - reporting false positives. Plug many existing leaks and introduce - a mechanism for developers to mark that the region of memory - pointed by a pointer is not lost/leaking to help these tools. - - * As "git commit" to conclude a conflicted "git merge" honors the - commit-msg hook, "git merge" that records a merge commit that - cleanly auto-merges should, but it didn't. - - * The codepath for "git merge-recursive" has been cleaned up. - - * Many leaks of strbuf have been fixed. - - * "git imap-send" has our own implementation of the protocol and also - can use more recent libCurl with the imap protocol support. Update - the latter so that it can use the credential subsystem, and then - make it the default option to use, so that we can eventually - deprecate and remove the former. - - * "make style" runs git-clang-format to help developers by pointing - out coding style issues. - - * A test to demonstrate "git mv" failing to adjust nested submodules - has been added. - (merge c514167df2 hv/mv-nested-submodules-test later to maint). - - * On Cygwin, "ulimit -s" does not report failure but it does not work - at all, which causes an unexpected success of some tests that - expect failures under a limited stack situation. This has been - fixed. - - * Many codepaths have been updated to squelch -Wimplicit-fallthrough - warnings from Gcc 7 (which is a good code hygiene). - - * Add a helper for DLL loading in anticipation for its need in a - future topic RSN. - - * "git status --ignored", when noticing that a directory without any - tracked path is ignored, still enumerated all the ignored paths in - the directory, which is unnecessary. The codepath has been - optimized to avoid this overhead. - - * The final batch to "git rebase -i" updates to move more code from - the shell script to C has been merged. - - * Operations that do not touch (majority of) packed refs have been - optimized by making accesses to packed-refs file lazy; we no longer - pre-parse everything, and an access to a single ref in the - packed-refs does not touch majority of irrelevant refs, either. - - * Add comment to clarify that the style file is meant to be used with - clang-5 and the rules are still work in progress. + * UNC paths are also relevant in Cygwin builds and they are now + tested just like Mingw builds. - * Many variables that points at a region of memory that will live - throughout the life of the program have been marked with UNLEAK - marker to help the leak checkers concentrate on real leaks.. + * Correct start-up sequence so that a repository could be placed + immediately under the root directory again (which was broken at + around Git 2.13). - * Plans for weaning us off of SHA-1 has been documented. + * The credential helper for libsecret (in contrib/) has been improved + to allow possibly prompting the end user to unlock secrets that are + currently locked (otherwise the secrets may not be loaded). - * A new "oidmap" API has been introduced and oidset API has been - rewritten to use it. + * Updates from GfW project. + * "git rebase -i" recently started misbehaving when a submodule that + is configured with 'submodule..ignore' is dirty; this has + been corrected. -Also contains various documentation updates and code clean-ups. - - -Fixes since v2.14 ------------------ - - * "%C(color name)" in the pretty print format always produced ANSI - color escape codes, which was an early design mistake. They now - honor the configuration (e.g. "color.ui = never") and also tty-ness - of the output medium. - - * The http.{sslkey,sslCert} configuration variables are to be - interpreted as a pathname that honors "~[username]/" prefix, but - weren't, which has been fixed. - - * Numerous bugs in walking of reflogs via "log -g" and friends have + * Some error messages did not quote filenames shown in it, which have been fixed. - * "git commit" when seeing an totally empty message said "you did not - edit the message", which is clearly wrong. The message has been - corrected. - - * When a directory is not readable, "gitweb" fails to build the - project list. Work this around by skipping such a directory. - - * Some versions of GnuPG fails to kill gpg-agent it auto-spawned - and such a left-over agent can interfere with a test. Work it - around by attempting to kill one before starting a new test. - - * A recently added test for the "credential-cache" helper revealed - that EOF detection done around the time the connection to the cache - daemon is torn down were flaky. This was fixed by reacting to - ECONNRESET and behaving as if we got an EOF. - - * "git log --tag=no-such-tag" showed log starting from HEAD, which - has been fixed---it now shows nothing. - - * The "tag.pager" configuration variable was useless for those who - actually create tag objects, as it interfered with the use of an - editor. A new mechanism has been introduced for commands to enable - pager depending on what operation is being carried out to fix this, - and then "git tag -l" is made to run pager by default. - - * "git push --recurse-submodules $there HEAD:$target" was not - propagated down to the submodules, but now it is. - - * Commands like "git rebase" accepted the --rerere-autoupdate option - from the command line, but did not always use it. This has been - fixed. - - * "git clone --recurse-submodules --quiet" did not pass the quiet - option down to submodules. - - * Test portability fix for OBSD. - - * Portability fix for OBSD. - - * "git am -s" has been taught that some input may end with a trailer - block that is not Signed-off-by: and it should refrain from adding - an extra blank line before adding a new sign-off in such a case. - - * "git svn" used with "--localtime" option did not compute the tz - offset for the timestamp in question and instead always used the - current time, which has been corrected. - - * Memory leak in an error codepath has been plugged. - - * "git stash -u" used the contents of the committed version of the - ".gitignore" file to decide which paths are ignored, even when the - file has local changes. The command has been taught to instead use - the locally modified contents. - - * bash 4.4 or newer gave a warning on NUL byte in command - substitution done in "git stash"; this has been squelched. - - * "git grep -L" and "git grep --quiet -L" reported different exit - codes; this has been corrected. - - * When handshake with a subprocess filter notices that the process - asked for an unknown capability, Git did not report what program - the offending subprocess was running. This has been corrected. + * Building with NO_LIBPCRE1_JIT did not disable it, which has been fixed. - * "git apply" that is used as a better "patch -p1" failed to apply a - taken from a file with CRLF line endings to a file with CRLF line - endings. The root cause was because it misused convert_to_git() - that tried to do "safe-crlf" processing by looking at the index - entry at the same path, which is a nonsense---in that mode, "apply" - is not working on the data in (or derived from) the index at all. - This has been fixed. + * We used to add an empty alternate object database to the system + that does not help anything; it has been corrected. - * Killing "git merge --edit" before the editor returns control left - the repository in a state with MERGE_MSG but without MERGE_HEAD, - which incorrectly tells the subsequent "git commit" that there was - a squash merge in progress. This has been fixed. + * Error checking in "git imap-send" for empty response has been + improved. - * "git archive" did not work well with pathspecs and the - export-ignore attribute. - - * In addition to "cc: # cruft", "cc: a@dd.re.ss # cruft" - was taught to "git send-email" as a valid way to tell it that it - needs to also send a carbon copy to in the trailer - section. - - * "git branch -M a b" while on a branch that is completely unrelated - to either branch a or branch b misbehaved when multiple worktree - was in use. This has been fixed. - (merge 31824d180d nd/worktree-kill-parse-ref later to maint). - - * "git gc" and friends when multiple worktrees are used off of a - single repository did not consider the index and per-worktree refs - of other worktrees as the root for reachability traversal, making - objects that are in use only in other worktrees to be subject to - garbage collection. - - * A regression to "gitk --bisect" by a recent update has been fixed. - - * "git -c submodule.recurse=yes pull" did not work as if the - "--recurse-submodules" option was given from the command line. - This has been corrected. - - * Unlike "git commit-tree < file", "git commit-tree -F file" did not - pass the contents of the file verbatim and instead completed an - incomplete line at the end, if exists. The latter has been updated - to match the behaviour of the former. - - * Many codepaths did not diagnose write failures correctly when disks - go full, due to their misuse of write_in_full() helper function, - which have been corrected. - (merge f48ecd38cb jk/write-in-full-fix later to maint). - - * "git help co" now says "co is aliased to ...", not "git co is". - (merge b3a8076e0d ks/help-alias-label later to maint). - - * "git archive", especially when used with pathspec, stored an empty - directory in its output, even though Git itself never does so. - This has been fixed. - - * API error-proofing which happens to also squelch warnings from GCC. - - * The explanation of the cut-line in the commit log editor has been - slightly tweaked. - (merge 8c4b1a3593 ks/commit-do-not-touch-cut-line later to maint). - - * "git gc" tries to avoid running two instances at the same time by - reading and writing pid/host from and to a lock file; it used to - use an incorrect fscanf() format when reading, which has been - corrected. - - * The scripts to drive TravisCI has been reorganized and then an - optimization to avoid spending cycles on a branch whose tip is - tagged has been implemented. - (merge 8376eb4a8f ls/travis-scriptify later to maint). - - * The test linter has been taught that we do not like "echo -e". - - * Code cmp.std.c nitpick. - - * A regression fix for 2.11 that made the code to read the list of - alternate object stores overrun the end of the string. - (merge f0f7bebef7 jk/info-alternates-fix later to maint). - - * "git describe --match" learned to take multiple patterns in v2.13 - series, but the feature ignored the patterns after the first one - and did not work at all. This has been fixed. - - * "git filter-branch" cannot reproduce a history with a tag without - the tagger field, which only ancient versions of Git allowed to be - created. This has been corrected. - (merge b2c1ca6b4b ic/fix-filter-branch-to-handle-tag-without-tagger later to maint). - - * "git cat-file --textconv" started segfaulting recently, which - has been corrected. - - * The built-in pattern to detect the "function header" for HTML did - not match

..

elements without any attributes, which has + * An ancient bug in "git apply --ignore-space-change" codepath has been fixed. - * "git mailinfo" was loose in decoding quoted printable and produced - garbage when the two letters after the equal sign are not - hexadecimal. This has been fixed. - - * The machinery to create xdelta used in pack files received the - sizes of the data in size_t, but lost the higher bits of them by - storing them in "unsigned int" during the computation, which is - fixed. - - * The delta format used in the packfile cannot reference data at - offset larger than what can be expressed in 4-byte, but the - generator for the data failed to make sure the offset does not - overflow. This has been corrected. - - * The documentation for '-X