Hello community, here is the log from the commit of package git for openSUSE:Factory checked in at 2018-02-19 12:54:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/git (Old) and /work/SRC/openSUSE:Factory/.git.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "git" Mon Feb 19 12:54:02 2018 rev:213 rq:577719 version:2.16.2 Changes: -------- --- /work/SRC/openSUSE:Factory/git/git.changes 2018-01-24 15:25:24.200677238 +0100 +++ /work/SRC/openSUSE:Factory/.git.new/git.changes 2018-02-19 12:54:11.612735990 +0100 @@ -1,0 +2,22 @@ +Sun Feb 18 02:45:50 UTC 2018 - [email protected] + +- git 2.16.2: + * An old regression in "git describe --all $annotated_tag^0" has + been fixed. + * "git svn dcommit" did not take into account the fact that a + svn+ssh:// URL with a username@ (typically used for pushing) + refers to the same SVN repository without the username@ and + failed when svn.pushmergeinfo option is set. + * "git merge -Xours/-Xtheirs" learned to use our/their version + when resolving a conflicting updates to a symbolic link. + * "git clone $there $here" is allowed even when here directory + exists as long as it is an empty directory, but the command + incorrectly removed it upon a failure of the operation. + * "git stash -- <pathspec>" incorrectly blew away untracked files + in the directory that matched the pathspec, which has been + corrected. + * "git add -p" was taught to ignore local changes to submodules + as they do not interfere with the partial addition of regular + changes anyway. + +------------------------------------------------------------------- Old: ---- git-2.16.1.tar.sign git-2.16.1.tar.xz New: ---- git-2.16.2.tar.sign git-2.16.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ git.spec ++++++ --- /var/tmp/diff_new_pack.ITTdmD/_old 2018-02-19 12:54:12.520703245 +0100 +++ /var/tmp/diff_new_pack.ITTdmD/_new 2018-02-19 12:54:12.520703245 +0100 @@ -33,7 +33,7 @@ %bcond_without docs Name: git -Version: 2.16.1 +Version: 2.16.2 Release: 0 Summary: Fast, scalable, distributed revision control system License: GPL-2.0 ++++++ git-2.16.1.tar.xz -> git-2.16.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/Documentation/RelNotes/2.16.2.txt new/git-2.16.2/Documentation/RelNotes/2.16.2.txt --- old/git-2.16.1/Documentation/RelNotes/2.16.2.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/git-2.16.2/Documentation/RelNotes/2.16.2.txt 2018-02-16 00:32:34.000000000 +0100 @@ -0,0 +1,30 @@ +Git v2.16.2 Release Notes +========================= + +Fixes since v2.16.1 +------------------- + + * An old regression in "git describe --all $annotated_tag^0" has been + fixed. + + * "git svn dcommit" did not take into account the fact that a + svn+ssh:// URL with a username@ (typically used for pushing) refers + to the same SVN repository without the username@ and failed when + svn.pushmergeinfo option is set. + + * "git merge -Xours/-Xtheirs" learned to use our/their version when + resolving a conflicting updates to a symbolic link. + + * "git clone $there $here" is allowed even when here directory exists + as long as it is an empty directory, but the command incorrectly + removed it upon a failure of the operation. + + * "git stash -- <pathspec>" incorrectly blew away untracked files in + the directory that matched the pathspec, which has been corrected. + + * "git add -p" was taught to ignore local changes to submodules as + they do not interfere with the partial addition of regular changes + anyway. + + +Also contains various documentation updates and code clean-ups. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/Documentation/git-cat-file.txt new/git-2.16.2/Documentation/git-cat-file.txt --- old/git-2.16.1/Documentation/git-cat-file.txt 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/Documentation/git-cat-file.txt 2018-02-16 00:32:34.000000000 +0100 @@ -42,8 +42,9 @@ <object>. -e:: - Suppress all output; instead exit with zero status if <object> - exists and is a valid object. + Exit with zero status if <object> exists and is a valid + object. If <object> is of an invalid format exit with non-zero and + emits an error on stderr. -p:: Pretty-print the contents of <object> based on its type. @@ -168,7 +169,7 @@ If `-s` is specified, the size of the <object> in bytes. -If `-e` is specified, no output. +If `-e` is specified, no output, unless the <object> is malformed. If `-p` is specified, the contents of <object> are pretty-printed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/Documentation/git-read-tree.txt new/git-2.16.2/Documentation/git-read-tree.txt --- old/git-2.16.1/Documentation/git-read-tree.txt 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/Documentation/git-read-tree.txt 2018-02-16 00:32:34.000000000 +0100 @@ -81,12 +81,11 @@ * when both sides add a path identically. The resolution is to add that path. ---prefix=<prefix>/:: +--prefix=<prefix>:: Keep the current index contents, and read the contents of the named tree-ish under the directory at `<prefix>`. The command will refuse to overwrite entries that already - existed in the original index file. Note that the `<prefix>/` - value must end with a slash. + existed in the original index file. --exclude-per-directory=<gitignore>:: When running the command with `-u` and `-m` options, the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/GIT-VERSION-GEN new/git-2.16.2/GIT-VERSION-GEN --- old/git-2.16.1/GIT-VERSION-GEN 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/GIT-VERSION-GEN 2018-02-16 00:32:34.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.16.1 +DEF_VER=v2.16.2 LF=' ' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/RelNotes new/git-2.16.2/RelNotes --- old/git-2.16.1/RelNotes 2018-02-19 12:54:13.668661843 +0100 +++ new/git-2.16.2/RelNotes 2018-02-19 12:54:13.676661555 +0100 @@ -1 +1 @@ -symbolic link to Documentation/RelNotes/2.16.1.txt +symbolic link to Documentation/RelNotes/2.16.2.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/bisect.c new/git-2.16.2/bisect.c --- old/git-2.16.1/bisect.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/bisect.c 2018-02-16 00:32:34.000000000 +0100 @@ -792,11 +792,9 @@ * - If one is "skipped", we can't know but we should warn. * - If we don't know, we should check it out and ask the user to test. */ -static void check_merge_bases(int no_checkout) +static void check_merge_bases(int rev_nr, struct commit **rev, int no_checkout) { struct commit_list *result; - int rev_nr; - struct commit **rev = get_bad_and_good_commits(&rev_nr); result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1); @@ -814,34 +812,21 @@ } } - free(rev); free_commit_list(result); } -static int check_ancestors(const char *prefix) +static int check_ancestors(int rev_nr, struct commit **rev, const char *prefix) { struct rev_info revs; - struct object_array pending_copy; int res; bisect_rev_setup(&revs, prefix, "^%s", "%s", 0); - /* Save pending objects, so they can be cleaned up later. */ - pending_copy = revs.pending; - revs.leak_pending = 1; - - /* - * bisect_common calls prepare_revision_walk right away, which - * (together with .leak_pending = 1) makes us the sole owner of - * the list of pending objects. - */ bisect_common(&revs); res = (revs.commits != NULL); /* Clean up objects used, as they will be reused. */ - clear_commit_marks_for_object_array(&pending_copy, ALL_REV_FLAGS); - - object_array_clear(&pending_copy); + clear_commit_marks_many(rev_nr, rev, ALL_REV_FLAGS); return res; } @@ -858,7 +843,8 @@ { char *filename = git_pathdup("BISECT_ANCESTORS_OK"); struct stat st; - int fd; + int fd, rev_nr; + struct commit **rev; if (!current_bad_oid) die(_("a %s revision is needed"), term_bad); @@ -872,8 +858,10 @@ goto done; /* Check if all good revs are ancestor of the bad rev. */ - if (check_ancestors(prefix)) - check_merge_bases(no_checkout); + rev = get_bad_and_good_commits(&rev_nr); + if (check_ancestors(rev_nr, rev, prefix)) + check_merge_bases(rev_nr, rev, no_checkout); + free(rev); /* Create file BISECT_ANCESTORS_OK. */ fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0600); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/builtin/checkout.c new/git-2.16.2/builtin/checkout.c --- old/git-2.16.1/builtin/checkout.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/builtin/checkout.c 2018-02-16 00:32:34.000000000 +0100 @@ -791,7 +791,6 @@ { struct rev_info revs; struct object *object = &old->object; - struct object_array refs; init_revisions(&revs, NULL); setup_revisions(0, NULL, &revs, NULL); @@ -802,14 +801,6 @@ for_each_ref(add_pending_uninteresting_ref, &revs); add_pending_oid(&revs, "HEAD", &new->object.oid, UNINTERESTING); - /* Save pending objects, so they can be cleaned up later. */ - refs = revs.pending; - revs.leak_pending = 1; - - /* - * prepare_revision_walk (together with .leak_pending = 1) makes us - * the sole owner of the list of pending objects. - */ if (prepare_revision_walk(&revs)) die(_("internal error in revision walk")); if (!(old->object.flags & UNINTERESTING)) @@ -818,9 +809,7 @@ describe_detached_head(_("Previous HEAD position was"), old); /* Clean up objects used, as they will be reused. */ - clear_commit_marks_for_object_array(&refs, ALL_REV_FLAGS); - - object_array_clear(&refs); + clear_commit_marks_all(ALL_REV_FLAGS); } static int switch_branches(const struct checkout_opts *opts, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/builtin/clone.c new/git-2.16.2/builtin/clone.c --- old/git-2.16.1/builtin/clone.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/builtin/clone.c 2018-02-16 00:32:34.000000000 +0100 @@ -473,7 +473,9 @@ } static const char *junk_work_tree; +static int junk_work_tree_flags; static const char *junk_git_dir; +static int junk_git_dir_flags; static enum { JUNK_LEAVE_NONE, JUNK_LEAVE_REPO, @@ -502,12 +504,12 @@ if (junk_git_dir) { strbuf_addstr(&sb, junk_git_dir); - remove_dir_recursively(&sb, 0); + remove_dir_recursively(&sb, junk_git_dir_flags); strbuf_reset(&sb); } if (junk_work_tree) { strbuf_addstr(&sb, junk_work_tree); - remove_dir_recursively(&sb, 0); + remove_dir_recursively(&sb, junk_work_tree_flags); } strbuf_release(&sb); } @@ -863,10 +865,15 @@ free(alternates); } +static int dir_exists(const char *path) +{ + struct stat sb; + return !stat(path, &sb); +} + int cmd_clone(int argc, const char **argv, const char *prefix) { int is_bundle = 0, is_local; - struct stat buf; const char *repo_name, *repo, *work_tree, *git_dir; char *path, *dir; int dest_exists; @@ -938,7 +945,7 @@ dir = guess_dir_name(repo_name, is_bundle, option_bare); strip_trailing_slashes(dir); - dest_exists = !stat(dir, &buf); + dest_exists = dir_exists(dir); if (dest_exists && !is_empty_dir(dir)) die(_("destination path '%s' already exists and is not " "an empty directory."), dir); @@ -949,7 +956,7 @@ work_tree = NULL; else { work_tree = getenv("GIT_WORK_TREE"); - if (work_tree && !stat(work_tree, &buf)) + if (work_tree && dir_exists(work_tree)) die(_("working tree '%s' already exists."), work_tree); } @@ -967,14 +974,24 @@ if (safe_create_leading_directories_const(work_tree) < 0) die_errno(_("could not create leading directories of '%s'"), work_tree); - if (!dest_exists && mkdir(work_tree, 0777)) + if (dest_exists) + junk_work_tree_flags |= REMOVE_DIR_KEEP_TOPLEVEL; + else if (mkdir(work_tree, 0777)) die_errno(_("could not create work tree dir '%s'"), work_tree); junk_work_tree = work_tree; set_git_work_tree(work_tree); } - junk_git_dir = real_git_dir ? real_git_dir : git_dir; + if (real_git_dir) { + if (dir_exists(real_git_dir)) + junk_git_dir_flags |= REMOVE_DIR_KEEP_TOPLEVEL; + junk_git_dir = real_git_dir; + } else { + if (dest_exists) + junk_git_dir_flags |= REMOVE_DIR_KEEP_TOPLEVEL; + junk_git_dir = git_dir; + } if (safe_create_leading_directories_const(git_dir) < 0) die(_("could not create leading directories of '%s'"), git_dir); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/builtin/describe.c new/git-2.16.2/builtin/describe.c --- old/git-2.16.1/builtin/describe.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/builtin/describe.c 2018-02-16 00:32:34.000000000 +0100 @@ -274,10 +274,13 @@ n->name_checked = 1; } - if (n->tag) + if (n->tag) { + if (all) + strbuf_addstr(dst, "tags/"); strbuf_addstr(dst, n->tag->tag); - else + } else { strbuf_addstr(dst, n->path); + } } static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/bundle.c new/git-2.16.2/bundle.c --- old/git-2.16.1/bundle.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/bundle.c 2018-02-16 00:32:34.000000000 +0100 @@ -134,7 +134,6 @@ struct ref_list *p = &header->prerequisites; struct rev_info revs; const char *argv[] = {NULL, "--all", NULL}; - struct object_array refs; struct commit *commit; int i, ret = 0, req_nr; const char *message = _("Repository lacks these prerequisite commits:"); @@ -157,14 +156,6 @@ req_nr = revs.pending.nr; setup_revisions(2, argv, &revs, NULL); - /* Save pending objects, so they can be cleaned up later. */ - refs = revs.pending; - revs.leak_pending = 1; - - /* - * prepare_revision_walk (together with .leak_pending = 1) makes us - * the sole owner of the list of pending objects. - */ if (prepare_revision_walk(&revs)) die(_("revision walk setup failed")); @@ -173,18 +164,24 @@ if (commit->object.flags & PREREQ_MARK) i--; - for (i = 0; i < req_nr; i++) - if (!(refs.objects[i].item->flags & SHOWN)) { - if (++ret == 1) - error("%s", message); - error("%s %s", oid_to_hex(&refs.objects[i].item->oid), - refs.objects[i].name); - } + for (i = 0; i < p->nr; i++) { + struct ref_list_entry *e = p->list + i; + struct object *o = parse_object(&e->oid); + assert(o); /* otherwise we'd have returned early */ + if (o->flags & SHOWN) + continue; + if (++ret == 1) + error("%s", message); + error("%s %s", oid_to_hex(&e->oid), e->name); + } /* Clean up objects used, as they will be reused. */ - clear_commit_marks_for_object_array(&refs, ALL_REV_FLAGS); - - object_array_clear(&refs); + for (i = 0; i < p->nr; i++) { + struct ref_list_entry *e = p->list + i; + commit = lookup_commit_reference_gently(&e->oid, 1); + if (commit) + clear_commit_marks(commit, ALL_REV_FLAGS); + } if (verbose) { struct ref_list *r; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/commit.c new/git-2.16.2/commit.c --- old/git-2.16.1/commit.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/commit.c 2018-02-16 00:32:34.000000000 +0100 @@ -547,7 +547,7 @@ struct commit_list *list = NULL; while (nr--) { - commit_list_insert(*commit, &list); + clear_commit_marks_1(&list, *commit, mark); commit++; } while (list) @@ -559,20 +559,6 @@ clear_commit_marks_many(1, &commit, mark); } -void clear_commit_marks_for_object_array(struct object_array *a, unsigned mark) -{ - struct object *object; - struct commit *commit; - unsigned int i; - - for (i = 0; i < a->nr; i++) { - object = a->objects[i].item; - commit = lookup_commit_reference_gently(&object->oid, 1); - if (commit) - clear_commit_marks(commit, mark); - } -} - struct commit *pop_commit(struct commit_list **stack) { struct commit_list *top = *stack; @@ -929,8 +915,7 @@ if (work[j]->object.flags & PARENT1) redundant[filled_index[j]] = 1; clear_commit_marks(array[i], all_flags); - for (j = 0; j < filled; j++) - clear_commit_marks(work[j], all_flags); + clear_commit_marks_many(filled, work, all_flags); free_commit_list(common); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/commit.h new/git-2.16.2/commit.h --- old/git-2.16.1/commit.h 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/commit.h 2018-02-16 00:32:34.000000000 +0100 @@ -140,7 +140,6 @@ void clear_commit_marks(struct commit *commit, unsigned int mark); void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark); -void clear_commit_marks_for_object_array(struct object_array *a, unsigned mark); enum rev_sort_order { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/configure new/git-2.16.2/configure --- old/git-2.16.1/configure 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/configure 2018-02-16 00:32:35.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for git 2.16.1. +# Generated by GNU Autoconf 2.69 for git 2.16.2. # # Report bugs to <[email protected]>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='git' PACKAGE_TARNAME='git' -PACKAGE_VERSION='2.16.1' -PACKAGE_STRING='git 2.16.1' +PACKAGE_VERSION='2.16.2' +PACKAGE_STRING='git 2.16.2' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -661,6 +661,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -752,6 +753,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1004,6 +1006,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1141,7 +1152,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1254,7 +1265,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.16.1 to adapt to many kinds of systems. +\`configure' configures git 2.16.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1294,6 +1305,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1315,7 +1327,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of git 2.16.1:";; + short | recursive ) echo "Configuration of git 2.16.2:";; esac cat <<\_ACEOF @@ -1460,7 +1472,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -git configure 2.16.1 +git configure 2.16.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1940,7 +1952,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.16.1, which was +It was created by git $as_me 2.16.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8235,7 +8247,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.16.1, which was +This file was extended by git $as_me 2.16.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8292,7 +8304,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.16.1 +git config.status 2.16.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/git-add--interactive.perl new/git-2.16.2/git-add--interactive.perl --- old/git-2.16.1/git-add--interactive.perl 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/git-add--interactive.perl 2018-02-16 00:32:34.000000000 +0100 @@ -262,7 +262,7 @@ } } - for (run_cmd_pipe(qw(git diff-files --numstat --summary --raw --), @ARGV)) { + for (run_cmd_pipe(qw(git diff-files --ignore-submodules=dirty --numstat --summary --raw --), @ARGV)) { if (($add, $del, $file) = /^([-\d]+) ([-\d]+) (.*)/) { $file = unquote_path($file); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/git-stash.sh new/git-2.16.2/git-stash.sh --- old/git-2.16.1/git-stash.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/git-stash.sh 2018-02-16 00:32:34.000000000 +0100 @@ -322,10 +322,9 @@ if test $# != 0 then - git reset -q -- "$@" - git ls-files -z --modified -- "$@" | + git add -u -- "$@" | git checkout-index -z --force --stdin - git clean --force -q -d -- "$@" + git diff-index -p --cached --binary HEAD -- "$@" | git apply --index -R else git reset --hard -q fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/git-svn.perl new/git-2.16.2/git-svn.perl --- old/git-2.16.1/git-svn.perl 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/git-svn.perl 2018-02-16 00:32:34.000000000 +0100 @@ -931,6 +931,7 @@ # information from different SVN repos, and paths # which are not underneath this repository root. my $rooturl = $gs->repos_root; + Git::SVN::remove_username($rooturl); foreach my $d (@$linear_refs) { my %parentshash; read_commit_parents(\%parentshash, $d); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/merge-recursive.c new/git-2.16.2/merge-recursive.c --- old/git-2.16.1/merge-recursive.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/merge-recursive.c 2018-02-16 00:32:34.000000000 +0100 @@ -1026,10 +1026,19 @@ &b->oid, !o->call_depth); } else if (S_ISLNK(a->mode)) { - oidcpy(&result->oid, &a->oid); - - if (!oid_eq(&a->oid, &b->oid)) - result->clean = 0; + switch (o->recursive_variant) { + case MERGE_RECURSIVE_NORMAL: + oidcpy(&result->oid, &a->oid); + if (!oid_eq(&a->oid, &b->oid)) + result->clean = 0; + break; + case MERGE_RECURSIVE_OURS: + oidcpy(&result->oid, &a->oid); + break; + case MERGE_RECURSIVE_THEIRS: + oidcpy(&result->oid, &b->oid); + break; + } } else die("BUG: unsupported object type in the tree"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/object.c new/git-2.16.2/object.c --- old/git-2.16.1/object.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/object.c 2018-02-16 00:32:34.000000000 +0100 @@ -434,3 +434,14 @@ obj->flags &= ~flags; } } + +void clear_commit_marks_all(unsigned int flags) +{ + int i; + + for (i = 0; i < obj_hash_size; i++) { + struct object *obj = obj_hash[i]; + if (obj && obj->type == OBJ_COMMIT) + obj->flags &= ~flags; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/object.h new/git-2.16.2/object.h --- old/git-2.16.1/object.h 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/object.h 2018-02-16 00:32:34.000000000 +0100 @@ -149,4 +149,9 @@ void clear_object_flags(unsigned flags); +/* + * Clear the specified object flags from all in-core commit objects. + */ +extern void clear_commit_marks_all(unsigned int flags); + #endif /* OBJECT_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/ref-filter.c new/git-2.16.2/ref-filter.c --- old/git-2.16.1/ref-filter.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/ref-filter.c 2018-02-16 00:32:34.000000000 +0100 @@ -1995,8 +1995,7 @@ free_array_item(item); } - for (i = 0; i < old_nr; i++) - clear_commit_marks(to_clear[i], ALL_REV_FLAGS); + clear_commit_marks_many(old_nr, to_clear, ALL_REV_FLAGS); clear_commit_marks(filter->merge_commit, ALL_REV_FLAGS); free(to_clear); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/revision.c new/git-2.16.2/revision.c --- old/git-2.16.1/revision.c 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/revision.c 2018-02-16 00:32:34.000000000 +0100 @@ -2862,8 +2862,7 @@ } } } - if (!revs->leak_pending) - object_array_clear(&old_pending); + object_array_clear(&old_pending); /* Signal whether we need per-parent treesame decoration */ if (revs->simplify_merges || diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/revision.h new/git-2.16.2/revision.h --- old/git-2.16.1/revision.h 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/revision.h 2018-02-16 00:32:34.000000000 +0100 @@ -151,18 +151,6 @@ date_mode_explicit:1, preserve_subject:1; unsigned int disable_stdin:1; - /* - * Set `leak_pending` to prevent `prepare_revision_walk()` from clearing - * the array of pending objects (`pending`). It will still forget about - * the array and its entries, so they really are leaked. This can be - * useful if the `struct object_array` `pending` is copied before - * calling `prepare_revision_walk()`. By setting `leak_pending`, you - * effectively claim ownership of the old array, so you should most - * likely call `object_array_clear(&pending_copy)` once you are done. - * Observe that this is about ownership of the array and its entries, - * not the commits referenced by those entries. - */ - unsigned int leak_pending:1; /* --show-linear-break */ unsigned int track_linear:1, track_first_time:1, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/perf/p7820-grep-engines.sh new/git-2.16.2/t/perf/p7820-grep-engines.sh --- old/git-2.16.1/t/perf/p7820-grep-engines.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/perf/p7820-grep-engines.sh 2018-02-16 00:32:34.000000000 +0100 @@ -12,6 +12,9 @@ -vi -vw -viw + +If GIT_PERF_GREP_THREADS is set to a list of threads (e.g. '1 4 8' +etc.) we will test the patterns under those numbers of threads. " . ./perf-lib.sh @@ -19,6 +22,11 @@ test_perf_large_repo test_checkout_worktree +if test -n "$GIT_PERF_GREP_THREADS" +then + test_set_prereq PERF_GREP_ENGINES_THREADS +fi + for pattern in \ 'how.to' \ '^how to' \ @@ -39,18 +47,42 @@ else prereq="" fi - test_perf $prereq "$engine grep$GIT_PERF_7820_GREP_OPTS '$pattern'" " - git -c grep.patternType=$engine grep$GIT_PERF_7820_GREP_OPTS -- '$pattern' >'out.$engine' || : - " - done - - test_expect_success "assert that all engines found the same for$GIT_PERF_7820_GREP_OPTS '$pattern'" ' - test_cmp out.basic out.extended && - if test_have_prereq PCRE + if ! test_have_prereq PERF_GREP_ENGINES_THREADS then - test_cmp out.basic out.perl + test_perf $prereq "$engine grep$GIT_PERF_7820_GREP_OPTS '$pattern'" " + git -c grep.patternType=$engine grep$GIT_PERF_7820_GREP_OPTS -- '$pattern' >'out.$engine' || : + " + else + for threads in $GIT_PERF_GREP_THREADS + do + test_perf PTHREADS,$prereq "$engine grep$GIT_PERF_7820_GREP_OPTS '$pattern' with $threads threads" " + git -c grep.patternType=$engine -c grep.threads=$threads grep$GIT_PERF_7820_GREP_OPTS -- '$pattern' >'out.$engine.$threads' || : + " + done fi - ' + done + + if ! test_have_prereq PERF_GREP_ENGINES_THREADS + then + test_expect_success "assert that all engines found the same for$GIT_PERF_7820_GREP_OPTS '$pattern'" ' + test_cmp out.basic out.extended && + if test_have_prereq PCRE + then + test_cmp out.basic out.perl + fi + ' + else + for threads in $GIT_PERF_GREP_THREADS + do + test_expect_success PTHREADS "assert that all engines found the same for$GIT_PERF_7820_GREP_OPTS '$pattern' under threading" " + test_cmp out.basic.$threads out.extended.$threads && + if test_have_prereq PCRE + then + test_cmp out.basic.$threads out.perl.$threads + fi + " + done + fi done test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/perf/p7821-grep-engines-fixed.sh new/git-2.16.2/t/perf/p7821-grep-engines-fixed.sh --- old/git-2.16.1/t/perf/p7821-grep-engines-fixed.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/perf/p7821-grep-engines-fixed.sh 2018-02-16 00:32:34.000000000 +0100 @@ -6,6 +6,9 @@ git-grep. Make sure to include a leading space, e.g. GIT_PERF_7821_GREP_OPTS=' -w'. See p7820-grep-engines.sh for more options to try. + +If GIT_PERF_7821_THREADS is set to a list of threads (e.g. '1 4 8' +etc.) we will test the patterns under those numbers of threads. " . ./perf-lib.sh @@ -13,6 +16,11 @@ test_perf_large_repo test_checkout_worktree +if test -n "$GIT_PERF_GREP_THREADS" +then + test_set_prereq PERF_GREP_ENGINES_THREADS +fi + for pattern in 'int' 'uncommon' 'æ' do for engine in fixed basic extended perl @@ -23,19 +31,44 @@ else prereq="" fi - test_perf $prereq "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern" " - git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || : - " - done - - test_expect_success "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern" ' - test_cmp out.fixed out.basic && - test_cmp out.fixed out.extended && - if test_have_prereq PCRE + if ! test_have_prereq PERF_GREP_ENGINES_THREADS then - test_cmp out.fixed out.perl + test_perf $prereq "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern" " + git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || : + " + else + for threads in $GIT_PERF_GREP_THREADS + do + test_perf PTHREADS,$prereq "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern with $threads threads" " + git -c grep.patternType=$engine -c grep.threads=$threads grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine.$threads' || : + " + done fi - ' + done + + if ! test_have_prereq PERF_GREP_ENGINES_THREADS + then + test_expect_success "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern" ' + test_cmp out.fixed out.basic && + test_cmp out.fixed out.extended && + if test_have_prereq PCRE + then + test_cmp out.fixed out.perl + fi + ' + else + for threads in $GIT_PERF_GREP_THREADS + do + test_expect_success PTHREADS "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern under threading" " + test_cmp out.fixed.$threads out.basic.$threads && + test_cmp out.fixed.$threads out.extended.$threads && + if test_have_prereq PCRE + then + test_cmp out.fixed.$threads out.perl.$threads + fi + " + done + fi done test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/t3701-add-interactive.sh new/git-2.16.2/t/t3701-add-interactive.sh --- old/git-2.16.1/t/t3701-add-interactive.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/t3701-add-interactive.sh 2018-02-16 00:32:34.000000000 +0100 @@ -493,4 +493,52 @@ test_cmp expect actual ' +test_expect_success 'setup different kinds of dirty submodules' ' + test_create_repo for-submodules && + ( + cd for-submodules && + test_commit initial && + test_create_repo dirty-head && + ( + cd dirty-head && + test_commit initial + ) && + cp -R dirty-head dirty-otherwise && + cp -R dirty-head dirty-both-ways && + git add dirty-head && + git add dirty-otherwise dirty-both-ways && + git commit -m initial && + + cd dirty-head && + test_commit updated && + cd ../dirty-both-ways && + test_commit updated && + echo dirty >>initial && + : >untracked && + cd ../dirty-otherwise && + echo dirty >>initial && + : >untracked + ) && + git -C for-submodules diff-files --name-only >actual && + cat >expected <<-\EOF && + dirty-both-ways + dirty-head + dirty-otherwise + EOF + test_cmp expected actual && + git -C for-submodules diff-files --name-only --ignore-submodules=dirty >actual && + cat >expected <<-\EOF && + dirty-both-ways + dirty-head + EOF + test_cmp expected actual +' + +test_expect_success 'status ignores dirty submodules (except HEAD)' ' + git -C for-submodules add -i </dev/null >output && + grep dirty-head output && + grep dirty-both-ways output && + ! grep dirty-otherwise output +' + test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/t3903-stash.sh new/git-2.16.2/t/t3903-stash.sh --- old/git-2.16.1/t/t3903-stash.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/t3903-stash.sh 2018-02-16 00:32:34.000000000 +0100 @@ -1064,4 +1064,36 @@ test foo,bar = $(cat foo),$(cat bar) ' +test_expect_success 'stash -- <subdir> leaves untracked files in subdir intact' ' + git reset && + >subdir/untracked && + >subdir/tracked1 && + >subdir/tracked2 && + git add subdir/tracked* && + git stash -- subdir/ && + test_path_is_missing subdir/tracked1 && + test_path_is_missing subdir/tracked2 && + test_path_is_file subdir/untracked && + git stash pop && + test_path_is_file subdir/tracked1 && + test_path_is_file subdir/tracked2 && + test_path_is_file subdir/untracked +' + +test_expect_success 'stash -- <subdir> works with binary files' ' + git reset && + >subdir/untracked && + >subdir/tracked && + cp "$TEST_DIRECTORY"/test-binary-1.png subdir/tracked-binary && + git add subdir/tracked* && + git stash -- subdir/ && + test_path_is_missing subdir/tracked && + test_path_is_missing subdir/tracked-binary && + test_path_is_file subdir/untracked && + git stash pop && + test_path_is_file subdir/tracked && + test_path_is_file subdir/tracked-binary && + test_path_is_file subdir/untracked +' + test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/t5600-clone-fail-cleanup.sh new/git-2.16.2/t/t5600-clone-fail-cleanup.sh --- old/git-2.16.1/t/t5600-clone-fail-cleanup.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/t5600-clone-fail-cleanup.sh 2018-02-16 00:32:34.000000000 +0100 @@ -7,46 +7,94 @@ This test covers the fact that if git clone fails, it should remove the directory it created, to avoid the user having to manually -remove the directory before attempting a clone again.' +remove the directory before attempting a clone again. + +Unless the directory already exists, in which case we clean up only what we +wrote. +' . ./test-lib.sh -test_expect_success \ - 'clone of non-existent source should fail' \ - 'test_must_fail git clone foo bar' - -test_expect_success \ - 'failed clone should not leave a directory' \ - '! test -d bar' +corrupt_repo () { + test_when_finished "rmdir foo/.git/objects.bak" && + mkdir foo/.git/objects.bak/ && + test_when_finished "mv foo/.git/objects.bak/* foo/.git/objects/" && + mv foo/.git/objects/* foo/.git/objects.bak/ +} -# Need a repo to clone -test_create_repo foo +test_expect_success 'clone of non-existent source should fail' ' + test_must_fail git clone foo bar +' -# clone doesn't like it if there is no HEAD. Is that a bug? -(cd foo && touch file && git add file && git commit -m 'add file' >/dev/null 2>&1) +test_expect_success 'failed clone should not leave a directory' ' + test_path_is_missing bar +' + +test_expect_success 'create a repo to clone' ' + test_create_repo foo +' + +test_expect_success 'create objects in repo for later corruption' ' + test_commit -C foo file +' # source repository given to git clone should be relative to the # current path not to the target dir -test_expect_success \ - 'clone of non-existent (relative to $PWD) source should fail' \ - 'test_must_fail git clone ../foo baz' - -test_expect_success \ - 'clone should work now that source exists' \ - 'git clone foo bar' - -test_expect_success \ - 'successful clone must leave the directory' \ - 'test -d bar' +test_expect_success 'clone of non-existent (relative to $PWD) source should fail' ' + test_must_fail git clone ../foo baz +' + +test_expect_success 'clone should work now that source exists' ' + git clone foo bar +' + +test_expect_success 'successful clone must leave the directory' ' + test_path_is_dir bar +' test_expect_success 'failed clone --separate-git-dir should not leave any directories' ' - mkdir foo/.git/objects.bak/ && - mv foo/.git/objects/* foo/.git/objects.bak/ && + corrupt_repo && test_must_fail git clone --separate-git-dir gitdir foo worktree && - test_must_fail test -e gitdir && - test_must_fail test -e worktree && - mv foo/.git/objects.bak/* foo/.git/objects/ && - rmdir foo/.git/objects.bak + test_path_is_missing gitdir && + test_path_is_missing worktree +' + +test_expect_success 'failed clone into empty leaves directory (vanilla)' ' + mkdir -p empty && + corrupt_repo && + test_must_fail git clone foo empty && + test_dir_is_empty empty +' + +test_expect_success 'failed clone into empty leaves directory (bare)' ' + mkdir -p empty && + corrupt_repo && + test_must_fail git clone --bare foo empty && + test_dir_is_empty empty +' + +test_expect_success 'failed clone into empty leaves directory (separate)' ' + mkdir -p empty-git empty-wt && + corrupt_repo && + test_must_fail git clone --separate-git-dir empty-git foo empty-wt && + test_dir_is_empty empty-git && + test_dir_is_empty empty-wt +' + +test_expect_success 'failed clone into empty leaves directory (separate, git)' ' + mkdir -p empty-git && + corrupt_repo && + test_must_fail git clone --separate-git-dir empty-git foo no-wt && + test_dir_is_empty empty-git && + test_path_is_missing no-wt +' + +test_expect_success 'failed clone into empty leaves directory (separate, wt)' ' + mkdir -p empty-wt && + corrupt_repo && + test_must_fail git clone --separate-git-dir no-git foo empty-wt && + test_path_is_missing no-git && + test_dir_is_empty empty-wt ' test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/t6037-merge-ours-theirs.sh new/git-2.16.2/t/t6037-merge-ours-theirs.sh --- old/git-2.16.1/t/t6037-merge-ours-theirs.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/t6037-merge-ours-theirs.sh 2018-02-16 00:32:34.000000000 +0100 @@ -73,4 +73,36 @@ git reset --hard master && test_must_fail git pull -s recursive -X bork . side ' +test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' ' + git reset --hard master && + git checkout -b two master && + ln -s target-zero link && + git add link && + git commit -m "add link pointing to zero" && + + ln -f -s target-two link && + git commit -m "add link pointing to two" link && + + git checkout -b one HEAD^ && + ln -f -s target-one link && + git commit -m "add link pointing to one" link && + + # we expect symbolic links not to resolve automatically, of course + git checkout one^0 && + test_must_fail git merge -s recursive two && + + # favor theirs to resolve to target-two? + git reset --hard && + git checkout one^0 && + git merge -s recursive -X theirs two && + git diff --exit-code two HEAD link && + + # favor ours to resolve to target-one? + git reset --hard && + git checkout one^0 && + git merge -s recursive -X ours two && + git diff --exit-code one HEAD link + +' + test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/t/t6120-describe.sh new/git-2.16.2/t/t6120-describe.sh --- old/git-2.16.1/t/t6120-describe.sh 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/t/t6120-describe.sh 2018-02-16 00:32:34.000000000 +0100 @@ -122,7 +122,7 @@ ' : >err.expect -check_describe A --all A^0 +check_describe tags/A --all A^0 test_expect_success 'no warning was displayed for A' ' test_cmp err.expect err.actual ' @@ -374,4 +374,8 @@ test_cmp expect actual ' +check_describe tags/A --all A +check_describe tags/c --all c +check_describe heads/branch_A --all --match='branch_*' branch_A + test_done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/git-2.16.1/version new/git-2.16.2/version --- old/git-2.16.1/version 2018-01-22 06:38:30.000000000 +0100 +++ new/git-2.16.2/version 2018-02-16 00:32:35.000000000 +0100 @@ -1 +1 @@ -2.16.1 +2.16.2
