Hello community,

here is the log from the commit of package git for openSUSE:Factory checked in 
at 2015-09-17 09:17:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/git (Old)
 and      /work/SRC/openSUSE:Factory/.git.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "git"

Changes:
--------
--- /work/SRC/openSUSE:Factory/git/git.changes  2015-09-03 18:06:34.000000000 
+0200
+++ /work/SRC/openSUSE:Factory/.git.new/git.changes     2015-09-17 
09:17:55.000000000 +0200
@@ -1,0 +2,8 @@
+Fri Sep 11 18:29:52 UTC 2015 - [email protected]
+
+- git 2.5.2:
+  * usability bug fixes
+  * performance bug fixes
+  * fix "git archive" usage of zip64 for >64k entries
+
+-------------------------------------------------------------------

Old:
----
  git-2.5.1.tar.sign
  git-2.5.1.tar.xz

New:
----
  git-2.5.2.tar.sign
  git-2.5.2.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ git.spec ++++++
--- /var/tmp/diff_new_pack.vSLuqH/_old  2015-09-17 09:17:56.000000000 +0200
+++ /var/tmp/diff_new_pack.vSLuqH/_new  2015-09-17 09:17:56.000000000 +0200
@@ -26,7 +26,7 @@
 %endif
 
 Name:           git
-Version:        2.5.1
+Version:        2.5.2
 Release:        0
 Summary:        Fast, scalable, distributed revision control system
 License:        GPL-2.0

++++++ git-2.5.1.tar.xz -> git-2.5.2.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/RelNotes/2.2.3.txt 
new/git-2.5.2/Documentation/RelNotes/2.2.3.txt
--- old/git-2.5.1/Documentation/RelNotes/2.2.3.txt      1970-01-01 
01:00:00.000000000 +0100
+++ new/git-2.5.2/Documentation/RelNotes/2.2.3.txt      2015-09-04 
20:02:19.000000000 +0200
@@ -0,0 +1,9 @@
+Git v2.2.3 Release Notes
+========================
+
+Fixes since v2.2.2
+------------------
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+   pathnames have been corrected to use strbuf and other mechanisms to
+   allow longer pathnames without fearing overflows.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/RelNotes/2.3.9.txt 
new/git-2.5.2/Documentation/RelNotes/2.3.9.txt
--- old/git-2.5.1/Documentation/RelNotes/2.3.9.txt      1970-01-01 
01:00:00.000000000 +0100
+++ new/git-2.5.2/Documentation/RelNotes/2.3.9.txt      2015-09-04 
20:02:19.000000000 +0200
@@ -0,0 +1,9 @@
+Git v2.3.9 Release Notes
+========================
+
+Fixes since v2.3.8
+------------------
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+   pathnames have been corrected to use strbuf and other mechanisms to
+   allow longer pathnames without fearing overflows.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/RelNotes/2.4.9.txt 
new/git-2.5.2/Documentation/RelNotes/2.4.9.txt
--- old/git-2.5.1/Documentation/RelNotes/2.4.9.txt      1970-01-01 
01:00:00.000000000 +0100
+++ new/git-2.5.2/Documentation/RelNotes/2.4.9.txt      2015-09-04 
20:02:19.000000000 +0200
@@ -0,0 +1,9 @@
+Git v2.4.9 Release Notes
+========================
+
+Fixes since v2.4.9
+------------------
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+   pathnames have been corrected to use strbuf and other mechanisms to
+   allow longer pathnames without fearing overflows.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/RelNotes/2.5.2.txt 
new/git-2.5.2/Documentation/RelNotes/2.5.2.txt
--- old/git-2.5.1/Documentation/RelNotes/2.5.2.txt      1970-01-01 
01:00:00.000000000 +0100
+++ new/git-2.5.2/Documentation/RelNotes/2.5.2.txt      2015-09-04 
20:02:19.000000000 +0200
@@ -0,0 +1,63 @@
+Git v2.5.2 Release Notes
+========================
+
+Fixes since v2.5.1
+------------------
+
+ * "git init empty && git -C empty log" said "bad default revision 'HEAD'",
+   which was found to be a bit confusing to new users.
+
+ * The "interpret-trailers" helper mistook a multi-paragraph title of
+   a commit log message with a colon in it as the end of the trailer
+   block.
+
+ * When re-priming the cache-tree opportunistically while committing
+   the in-core index as-is, we mistakenly invalidated the in-core
+   index too aggressively, causing the experimental split-index code
+   to unnecessarily rewrite the on-disk index file(s).
+
+ * "git archive" did not use zip64 extension when creating an archive
+   with more than 64k entries, which nobody should need, right ;-)?
+
+ * The code in "multiple-worktree" support that attempted to recover
+   from an inconsistent state updated an incorrect file.
+
+ * "git rev-list" does not take "--notes" option, but did not complain
+   when one is given.
+
+ * Because the configuration system does not allow "alias.0foo" and
+   "pager.0foo" as the configuration key, the user cannot use '0foo'
+   as a custom command name anyway, but "git 0foo" tried to look these
+   keys up and emitted useless warnings before saying '0foo is not a
+   git command'.  These warning messages have been squelched.
+
+ * We recently rewrote one of the build scripts in Perl, which made it
+   necessary to have Perl to build Git.  Reduced Perl dependency by
+   rewriting it again using sed.
+
+ * t1509 test that requires a dedicated VM environment had some
+   bitrot, which has been corrected.
+
+ * strbuf_read() used to have one extra iteration (and an unnecessary
+   strbuf_grow() of 8kB), which was eliminated.
+
+ * The codepath to produce error messages had a hard-coded limit to
+   the size of the message, primarily to avoid memory allocation while
+   calling die().
+
+ * When trying to see that an object does not exist, a state errno
+   leaked from our "first try to open a packfile with O_NOATIME and
+   then if it fails retry without it" logic on a system that refuses
+   O_NOATIME.  This confused us and caused us to die, saying that the
+   packfile is unreadable, when we should have just reported that the
+   object does not exist in that packfile to the caller.
+
+ * An off-by-one error made "git remote" to mishandle a remote with a
+   single letter nickname.
+
+ * A handful of codepaths that used to use fixed-sized arrays to hold
+   pathnames have been corrected to use strbuf and other mechanisms to
+   allow longer pathnames without fearing overflows.
+
+Also contains typofixes, documentation updates and trivial code
+clean-ups.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/config.txt 
new/git-2.5.2/Documentation/config.txt
--- old/git-2.5.1/Documentation/config.txt      2015-08-28 21:37:13.000000000 
+0200
+++ new/git-2.5.2/Documentation/config.txt      2015-09-04 20:02:19.000000000 
+0200
@@ -1298,7 +1298,7 @@
        the refs that match the <pattern>.
 
 gc.reflogExpireUnreachable::
-gc.<ref>.reflogExpireUnreachable::
+gc.<pattern>.reflogExpireUnreachable::
        'git reflog expire' removes reflog entries older than
        this time and are not reachable from the current tip;
        defaults to 30 days.  With "<pattern>" (e.g. "refs/stash")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/git.txt 
new/git-2.5.2/Documentation/git.txt
--- old/git-2.5.1/Documentation/git.txt 2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/Documentation/git.txt 2015-09-04 20:02:19.000000000 +0200
@@ -43,15 +43,17 @@
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v2.5.1/git.html[documentation for release 2.5.1]
+* link:v2.5.2/git.html[documentation for release 2.5.2]
 
 * release notes for
+  link:RelNotes/2.5.2.txt[2.5.2],
   link:RelNotes/2.5.1.txt[2.5.1],
   link:RelNotes/2.5.0.txt[2.5].
 
-* link:v2.4.8/git.html[documentation for release 2.4.8]
+* link:v2.4.9/git.html[documentation for release 2.4.9]
 
 * release notes for
+  link:RelNotes/2.4.9.txt[2.4.9],
   link:RelNotes/2.4.8.txt[2.4.8],
   link:RelNotes/2.4.7.txt[2.4.7],
   link:RelNotes/2.4.6.txt[2.4.6],
@@ -62,9 +64,10 @@
   link:RelNotes/2.4.1.txt[2.4.1],
   link:RelNotes/2.4.0.txt[2.4].
 
-* link:v2.3.8/git.html[documentation for release 2.3.8]
+* link:v2.3.9/git.html[documentation for release 2.3.9]
 
 * release notes for
+  link:RelNotes/2.3.9.txt[2.3.9],
   link:RelNotes/2.3.8.txt[2.3.8],
   link:RelNotes/2.3.7.txt[2.3.7],
   link:RelNotes/2.3.6.txt[2.3.6],
@@ -75,9 +78,10 @@
   link:RelNotes/2.3.1.txt[2.3.1],
   link:RelNotes/2.3.0.txt[2.3].
 
-* link:v2.2.2/git.html[documentation for release 2.2.2]
+* link:v2.2.3/git.html[documentation for release 2.2.3]
 
 * release notes for
+  link:RelNotes/2.2.3.txt[2.2.3],
   link:RelNotes/2.2.2.txt[2.2.2],
   link:RelNotes/2.2.1.txt[2.2.1],
   link:RelNotes/2.2.0.txt[2.2].
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/pretty-formats.txt 
new/git-2.5.2/Documentation/pretty-formats.txt
--- old/git-2.5.1/Documentation/pretty-formats.txt      2015-08-28 
21:37:13.000000000 +0200
+++ new/git-2.5.2/Documentation/pretty-formats.txt      2015-09-04 
20:02:19.000000000 +0200
@@ -139,7 +139,9 @@
 - '%f': sanitized subject line, suitable for a filename
 - '%b': body
 - '%B': raw body (unwrapped subject and body)
+ifndef::git-rev-list[]
 - '%N': commit notes
+endif::git-rev-list[]
 - '%GG': raw verification message from GPG for a signed commit
 - '%G?': show "G" for a Good signature, "B" for a Bad signature, "U" for a 
good,
   untrusted signature and "N" for no signature
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/pretty-options.txt 
new/git-2.5.2/Documentation/pretty-options.txt
--- old/git-2.5.1/Documentation/pretty-options.txt      2015-08-28 
21:37:13.000000000 +0200
+++ new/git-2.5.2/Documentation/pretty-options.txt      2015-09-04 
20:02:19.000000000 +0200
@@ -42,6 +42,7 @@
        verbatim; this means that invalid sequences in the original
        commit may be copied to the output.
 
+ifndef::git-rev-list[]
 --notes[=<ref>]::
        Show the notes (see linkgit:git-notes[1]) that annotate the
        commit, when showing the commit log message.  This is the default
@@ -73,6 +74,7 @@
 --[no-]standard-notes::
        These options are deprecated. Use the above --notes/--no-notes
        options instead.
+endif::git-rev-list[]
 
 --show-signature::
        Check the validity of a signed commit object by passing the signature
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Documentation/rev-list-options.txt 
new/git-2.5.2/Documentation/rev-list-options.txt
--- old/git-2.5.1/Documentation/rev-list-options.txt    2015-08-28 
21:37:13.000000000 +0200
+++ new/git-2.5.2/Documentation/rev-list-options.txt    2015-09-04 
20:02:19.000000000 +0200
@@ -58,9 +58,11 @@
        more than one `--grep=<pattern>`, commits whose message
        matches any of the given patterns are chosen (but see
        `--all-match`).
+ifndef::git-rev-list[]
 +
 When `--show-notes` is in effect, the message from the notes is
 matched as if it were part of the log message.
+endif::git-rev-list[]
 
 --all-match::
        Limit the commits output to ones that match all given `--grep`,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/GIT-VERSION-GEN 
new/git-2.5.2/GIT-VERSION-GEN
--- old/git-2.5.1/GIT-VERSION-GEN       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/GIT-VERSION-GEN       2015-09-04 20:02:19.000000000 +0200
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.5.1
+DEF_VER=v2.5.2
 
 LF='
 '
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/Makefile new/git-2.5.2/Makefile
--- old/git-2.5.1/Makefile      2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/Makefile      2015-09-04 20:02:19.000000000 +0200
@@ -1696,10 +1696,10 @@
        ln -s $< $@ 2>/dev/null || \
        cp $< $@
 
-common-cmds.h: generate-cmdlist.perl command-list.txt
+common-cmds.h: generate-cmdlist.sh command-list.txt
 
 common-cmds.h: $(wildcard Documentation/git-*.txt)
-       $(QUIET_GEN)$(PERL_PATH) generate-cmdlist.perl command-list.txt > $@+ 
&& mv $@+ $@
+       $(QUIET_GEN)./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@
 
 SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
        $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/RelNotes new/git-2.5.2/RelNotes
--- old/git-2.5.1/RelNotes      2015-09-17 09:17:58.000000000 +0200
+++ new/git-2.5.2/RelNotes      2015-09-17 09:17:58.000000000 +0200
@@ -1 +1 @@
-symbolic link to Documentation/RelNotes/2.5.1.txt
+symbolic link to Documentation/RelNotes/2.5.2.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/alias.c new/git-2.5.2/alias.c
--- old/git-2.5.1/alias.c       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/alias.c       2015-09-04 20:02:19.000000000 +0200
@@ -5,7 +5,8 @@
        char *v = NULL;
        struct strbuf key = STRBUF_INIT;
        strbuf_addf(&key, "alias.%s", alias);
-       git_config_get_string(key.buf, &v);
+       if (git_config_key_is_valid(key.buf))
+               git_config_get_string(key.buf, &v);
        strbuf_release(&key);
        return v;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/archive-zip.c new/git-2.5.2/archive-zip.c
--- old/git-2.5.1/archive-zip.c 2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/archive-zip.c 2015-09-04 20:02:19.000000000 +0200
@@ -16,7 +16,9 @@
 
 static unsigned int zip_offset;
 static unsigned int zip_dir_offset;
-static unsigned int zip_dir_entries;
+static uint64_t zip_dir_entries;
+
+static unsigned int max_creator_version;
 
 #define ZIP_DIRECTORY_MIN_SIZE (1024 * 1024)
 #define ZIP_STREAM     (1 <<  3)
@@ -86,6 +88,28 @@
        unsigned char _end[1];
 };
 
+struct zip64_dir_trailer {
+       unsigned char magic[4];
+       unsigned char record_size[8];
+       unsigned char creator_version[2];
+       unsigned char version[2];
+       unsigned char disk[4];
+       unsigned char directory_start_disk[4];
+       unsigned char entries_on_this_disk[8];
+       unsigned char entries[8];
+       unsigned char size[8];
+       unsigned char offset[8];
+       unsigned char _end[1];
+};
+
+struct zip64_dir_trailer_locator {
+       unsigned char magic[4];
+       unsigned char disk[4];
+       unsigned char offset[8];
+       unsigned char number_of_disks[4];
+       unsigned char _end[1];
+};
+
 /*
  * On ARM, padding is added at the end of the struct, so a simple
  * sizeof(struct ...) reports two bytes more than the payload size
@@ -98,6 +122,12 @@
 #define ZIP_EXTRA_MTIME_SIZE   offsetof(struct zip_extra_mtime, _end)
 #define ZIP_EXTRA_MTIME_PAYLOAD_SIZE \
        (ZIP_EXTRA_MTIME_SIZE - offsetof(struct zip_extra_mtime, flags))
+#define ZIP64_DIR_TRAILER_SIZE offsetof(struct zip64_dir_trailer, _end)
+#define ZIP64_DIR_TRAILER_RECORD_SIZE \
+       (ZIP64_DIR_TRAILER_SIZE - \
+        offsetof(struct zip64_dir_trailer, creator_version))
+#define ZIP64_DIR_TRAILER_LOCATOR_SIZE \
+       offsetof(struct zip64_dir_trailer_locator, _end)
 
 static void copy_le16(unsigned char *dest, unsigned int n)
 {
@@ -113,6 +143,31 @@
        dest[3] = 0xff & (n >> 030);
 }
 
+static void copy_le64(unsigned char *dest, uint64_t n)
+{
+       dest[0] = 0xff & n;
+       dest[1] = 0xff & (n >> 010);
+       dest[2] = 0xff & (n >> 020);
+       dest[3] = 0xff & (n >> 030);
+       dest[4] = 0xff & (n >> 040);
+       dest[5] = 0xff & (n >> 050);
+       dest[6] = 0xff & (n >> 060);
+       dest[7] = 0xff & (n >> 070);
+}
+
+static uint64_t clamp_max(uint64_t n, uint64_t max, int *clamped)
+{
+       if (n <= max)
+               return n;
+       *clamped = 1;
+       return max;
+}
+
+static void copy_le16_clamp(unsigned char *dest, uint64_t n, int *clamped)
+{
+       copy_le16(dest, clamp_max(n, 0xffff, clamped));
+}
+
 static void *zlib_deflate_raw(void *data, unsigned long size,
                              int compression_level,
                              unsigned long *compressed_size)
@@ -223,6 +278,7 @@
        unsigned long size;
        int is_binary = -1;
        const char *path_without_prefix = path + args->baselen;
+       unsigned int creator_version = 0;
 
        crc = crc32(0, NULL, 0);
 
@@ -251,6 +307,8 @@
                method = 0;
                attr2 = S_ISLNK(mode) ? ((mode | 0777) << 16) :
                        (mode & 0111) ? ((mode) << 16) : 0;
+               if (S_ISLNK(mode) || (mode & 0111))
+                       creator_version = 0x0317;
                if (S_ISREG(mode) && args->compression_level != 0 && size > 0)
                        method = 8;
 
@@ -279,6 +337,9 @@
                                sha1_to_hex(sha1));
        }
 
+       if (creator_version > max_creator_version)
+               max_creator_version = creator_version;
+
        if (buffer && method == 8) {
                out = deflated = zlib_deflate_raw(buffer, size,
                                                  args->compression_level,
@@ -303,8 +364,7 @@
        }
 
        copy_le32(dirent.magic, 0x02014b50);
-       copy_le16(dirent.creator_version,
-               S_ISLNK(mode) || (S_ISREG(mode) && (mode & 0111)) ? 0x0317 : 0);
+       copy_le16(dirent.creator_version, creator_version);
        copy_le16(dirent.version, 10);
        copy_le16(dirent.flags, flags);
        copy_le16(dirent.compression_method, method);
@@ -437,20 +497,49 @@
        return 0;
 }
 
+static void write_zip64_trailer(void)
+{
+       struct zip64_dir_trailer trailer64;
+       struct zip64_dir_trailer_locator locator64;
+
+       copy_le32(trailer64.magic, 0x06064b50);
+       copy_le64(trailer64.record_size, ZIP64_DIR_TRAILER_RECORD_SIZE);
+       copy_le16(trailer64.creator_version, max_creator_version);
+       copy_le16(trailer64.version, 45);
+       copy_le32(trailer64.disk, 0);
+       copy_le32(trailer64.directory_start_disk, 0);
+       copy_le64(trailer64.entries_on_this_disk, zip_dir_entries);
+       copy_le64(trailer64.entries, zip_dir_entries);
+       copy_le64(trailer64.size, zip_dir_offset);
+       copy_le64(trailer64.offset, zip_offset);
+
+       copy_le32(locator64.magic, 0x07064b50);
+       copy_le32(locator64.disk, 0);
+       copy_le64(locator64.offset, zip_offset + zip_dir_offset);
+       copy_le32(locator64.number_of_disks, 1);
+
+       write_or_die(1, &trailer64, ZIP64_DIR_TRAILER_SIZE);
+       write_or_die(1, &locator64, ZIP64_DIR_TRAILER_LOCATOR_SIZE);
+}
+
 static void write_zip_trailer(const unsigned char *sha1)
 {
        struct zip_dir_trailer trailer;
+       int clamped = 0;
 
        copy_le32(trailer.magic, 0x06054b50);
        copy_le16(trailer.disk, 0);
        copy_le16(trailer.directory_start_disk, 0);
-       copy_le16(trailer.entries_on_this_disk, zip_dir_entries);
-       copy_le16(trailer.entries, zip_dir_entries);
+       copy_le16_clamp(trailer.entries_on_this_disk, zip_dir_entries,
+                       &clamped);
+       copy_le16_clamp(trailer.entries, zip_dir_entries, &clamped);
        copy_le32(trailer.size, zip_dir_offset);
        copy_le32(trailer.offset, zip_offset);
        copy_le16(trailer.comment_length, sha1 ? GIT_SHA1_HEXSZ : 0);
 
        write_or_die(1, zip_dir, zip_dir_offset);
+       if (clamped)
+               write_zip64_trailer();
        write_or_die(1, &trailer, ZIP_DIR_TRAILER_SIZE);
        if (sha1)
                write_or_die(1, sha1_to_hex(sha1), GIT_SHA1_HEXSZ);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/builtin/checkout.c 
new/git-2.5.2/builtin/checkout.c
--- old/git-2.5.1/builtin/checkout.c    2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/builtin/checkout.c    2015-09-04 20:02:19.000000000 +0200
@@ -282,7 +282,7 @@
        if (opts->source_tree)
                read_tree_some(opts->source_tree, &opts->pathspec);
 
-       ps_matched = xcalloc(1, opts->pathspec.nr);
+       ps_matched = xcalloc(opts->pathspec.nr, 1);
 
        /*
         * Make sure all pathspecs participated in locating the paths
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/builtin/commit.c 
new/git-2.5.2/builtin/commit.c
--- old/git-2.5.1/builtin/commit.c      2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/builtin/commit.c      2015-09-04 20:02:19.000000000 +0200
@@ -404,10 +404,8 @@
                hold_locked_index(&index_lock, 1);
                refresh_cache_or_die(refresh_flags);
                if (active_cache_changed
-                   || !cache_tree_fully_valid(active_cache_tree)) {
+                   || !cache_tree_fully_valid(active_cache_tree))
                        update_main_cache_tree(WRITE_TREE_SILENT);
-                       active_cache_changed = 1;
-               }
                if (active_cache_changed) {
                        if (write_locked_index(&the_index, &index_lock,
                                               COMMIT_LOCK))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/builtin/fetch.c 
new/git-2.5.2/builtin/fetch.c
--- old/git-2.5.1/builtin/fetch.c       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/builtin/fetch.c       2015-09-04 20:02:19.000000000 +0200
@@ -979,17 +979,15 @@
 {
        struct remote_group_data *g = priv;
 
-       if (starts_with(key, "remotes.") &&
-                       !strcmp(key + 8, g->name)) {
+       if (skip_prefix(key, "remotes.", &key) && !strcmp(key, g->name)) {
                /* split list by white space */
-               int space = strcspn(value, " \t\n");
                while (*value) {
-                       if (space > 1) {
+                       size_t wordlen = strcspn(value, " \t\n");
+
+                       if (wordlen >= 1)
                                string_list_append(g->list,
-                                                  xstrndup(value, space));
-                       }
-                       value += space + (value[space] != '\0');
-                       space = strcspn(value, " \t\n");
+                                                  xstrndup(value, wordlen));
+                       value += wordlen + (value[wordlen] != '\0');
                }
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/builtin/ls-files.c 
new/git-2.5.2/builtin/ls-files.c
--- old/git-2.5.1/builtin/ls-files.c    2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/builtin/ls-files.c    2015-09-04 20:02:19.000000000 +0200
@@ -516,7 +516,7 @@
 
        /* Treat unmatching pathspec elements as errors */
        if (pathspec.nr && error_unmatch)
-               ps_matched = xcalloc(1, pathspec.nr);
+               ps_matched = xcalloc(pathspec.nr, 1);
 
        if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given)
                die("ls-files --ignored needs some exclude pattern");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/builtin/rev-list.c 
new/git-2.5.2/builtin/rev-list.c
--- old/git-2.5.1/builtin/rev-list.c    2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/builtin/rev-list.c    2015-09-04 20:02:19.000000000 +0200
@@ -350,6 +350,9 @@
            revs.diff)
                usage(rev_list_usage);
 
+       if (revs.show_notes)
+               die(_("rev-list does not support display of notes"));
+
        save_commit_buffer = (revs.verbose_header ||
                              revs.grep_filter.pattern_list ||
                              revs.grep_filter.header_list);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/builtin/show-branch.c 
new/git-2.5.2/builtin/show-branch.c
--- old/git-2.5.1/builtin/show-branch.c 2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/builtin/show-branch.c 2015-09-04 20:02:19.000000000 +0200
@@ -730,7 +730,6 @@
 
        if (reflog) {
                struct object_id oid;
-               char nth_desc[256];
                char *ref;
                int base = 0;
                unsigned int flags = 0;
@@ -769,6 +768,7 @@
 
                for (i = 0; i < reflog; i++) {
                        char *logmsg;
+                       char *nth_desc;
                        const char *msg;
                        unsigned long timestamp;
                        int tz;
@@ -787,8 +787,10 @@
                                                show_date(timestamp, tz, 1),
                                                msg);
                        free(logmsg);
-                       sprintf(nth_desc, "%s@{%d}", *av, base+i);
+
+                       nth_desc = xstrfmt("%s@{%d}", *av, base+i);
                        append_ref(nth_desc, &oid, 1);
+                       free(nth_desc);
                }
                free(ref);
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/cache.h new/git-2.5.2/cache.h
--- old/git-2.5.1/cache.h       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/cache.h       2015-09-04 20:02:19.000000000 +0200
@@ -1446,6 +1446,7 @@
 extern int git_config_set_in_file(const char *, const char *, const char *);
 extern int git_config_set(const char *, const char *);
 extern int git_config_parse_key(const char *, char **, int *);
+extern int git_config_key_is_valid(const char *key);
 extern int git_config_set_multivar(const char *, const char *, const char *, 
int);
 extern int git_config_set_multivar_in_file(const char *, const char *, const 
char *, const char *, int);
 extern int git_config_rename_section(const char *, const char *);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/config.c new/git-2.5.2/config.c
--- old/git-2.5.1/config.c      2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/config.c      2015-09-04 20:02:19.000000000 +0200
@@ -1848,7 +1848,7 @@
  * baselen - pointer to int which will hold the length of the
  *           section + subsection part, can be NULL
  */
-int git_config_parse_key(const char *key, char **store_key, int *baselen_)
+static int git_config_parse_key_1(const char *key, char **store_key, int 
*baselen_, int quiet)
 {
        int i, dot, baselen;
        const char *last_dot = strrchr(key, '.');
@@ -1859,12 +1859,14 @@
         */
 
        if (last_dot == NULL || last_dot == key) {
-               error("key does not contain a section: %s", key);
+               if (!quiet)
+                       error("key does not contain a section: %s", key);
                return -CONFIG_NO_SECTION_OR_NAME;
        }
 
        if (!last_dot[1]) {
-               error("key does not contain variable name: %s", key);
+               if (!quiet)
+                       error("key does not contain variable name: %s", key);
                return -CONFIG_NO_SECTION_OR_NAME;
        }
 
@@ -1875,7 +1877,8 @@
        /*
         * Validate the key and while at it, lower case it for matching.
         */
-       *store_key = xmalloc(strlen(key) + 1);
+       if (store_key)
+               *store_key = xmalloc(strlen(key) + 1);
 
        dot = 0;
        for (i = 0; key[i]; i++) {
@@ -1886,26 +1889,42 @@
                if (!dot || i > baselen) {
                        if (!iskeychar(c) ||
                            (i == baselen + 1 && !isalpha(c))) {
-                               error("invalid key: %s", key);
+                               if (!quiet)
+                                       error("invalid key: %s", key);
                                goto out_free_ret_1;
                        }
                        c = tolower(c);
                } else if (c == '\n') {
-                       error("invalid key (newline): %s", key);
+                       if (!quiet)
+                               error("invalid key (newline): %s", key);
                        goto out_free_ret_1;
                }
-               (*store_key)[i] = c;
+               if (store_key)
+                       (*store_key)[i] = c;
        }
-       (*store_key)[i] = 0;
+       if (store_key)
+               (*store_key)[i] = 0;
 
        return 0;
 
 out_free_ret_1:
-       free(*store_key);
-       *store_key = NULL;
+       if (store_key) {
+               free(*store_key);
+               *store_key = NULL;
+       }
        return -CONFIG_INVALID_KEY;
 }
 
+int git_config_parse_key(const char *key, char **store_key, int *baselen)
+{
+       return git_config_parse_key_1(key, store_key, baselen, 0);
+}
+
+int git_config_key_is_valid(const char *key)
+{
+       return !git_config_parse_key_1(key, NULL, NULL, 1);
+}
+
 /*
  * If value==NULL, unset in (remove from) config,
  * if value_regex!=NULL, disregard key/value pairs where value does not match.
@@ -1935,7 +1954,7 @@
                                const char *key, const char *value,
                                const char *value_regex, int multi_replace)
 {
-       int fd = -1, in_fd;
+       int fd = -1, in_fd = -1;
        int ret;
        struct lock_file *lock = NULL;
        char *filename_buf = NULL;
@@ -2065,6 +2084,7 @@
                        goto out_free;
                }
                close(in_fd);
+               in_fd = -1;
 
                if (chmod(lock->filename.buf, st.st_mode & 07777) < 0) {
                        error("chmod on %s failed: %s",
@@ -2148,6 +2168,8 @@
        free(filename_buf);
        if (contents)
                munmap(contents, contents_sz);
+       if (in_fd >= 0)
+               close(in_fd);
        return ret;
 
 write_err_out:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/configure new/git-2.5.2/configure
--- old/git-2.5.1/configure     2015-08-28 21:37:14.000000000 +0200
+++ new/git-2.5.2/configure     2015-09-04 20:02:19.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for git 2.5.1.
+# Generated by GNU Autoconf 2.69 for git 2.5.2.
 #
 # Report bugs to <[email protected]>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='git'
 PACKAGE_TARNAME='git'
-PACKAGE_VERSION='2.5.1'
-PACKAGE_STRING='git 2.5.1'
+PACKAGE_VERSION='2.5.2'
+PACKAGE_STRING='git 2.5.2'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 
@@ -1251,7 +1251,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.5.1 to adapt to many kinds of systems.
+\`configure' configures git 2.5.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1312,7 +1312,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of git 2.5.1:";;
+     short | recursive ) echo "Configuration of git 2.5.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1451,7 +1451,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-git configure 2.5.1
+git configure 2.5.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1931,7 +1931,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.5.1, which was
+It was created by git $as_me 2.5.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -8155,7 +8155,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.5.1, which was
+This file was extended by git $as_me 2.5.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8212,7 +8212,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.5.1
+git config.status 2.5.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.5.1/generate-cmdlist.perl 
new/git-2.5.2/generate-cmdlist.perl
--- old/git-2.5.1/generate-cmdlist.perl 2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/generate-cmdlist.perl 1970-01-01 01:00:00.000000000 +0100
@@ -1,50 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use warnings;
-
-print <<"EOT";
-/* Automatically generated by $0 */
-
-struct cmdname_help {
-       char name[16];
-       char help[80];
-       unsigned char group;
-};
-
-static char *common_cmd_groups[] = {
-EOT
-
-my $n = 0;
-my %grp;
-while (<>) {
-       last if /^### command list/;
-       next if (1../^### common groups/) || /^#/ || /^\s*$/;
-       chop;
-       my ($k, $v) = split ' ', $_, 2;
-       $grp{$k} = $n++;
-       print "\tN_(\"$v\"),\n";
-}
-
-print "};\n\nstatic struct cmdname_help common_cmds[] = {\n";
-
-while (<>) {
-       next if /^#/ || /^\s*$/;
-       my @tags = split;
-       my $cmd = shift @tags;
-       for my $t (@tags) {
-               if (exists $grp{$t}) {
-                       my $s;
-                       open my $f, '<', "Documentation/$cmd.txt" or die;
-                       while (<$f>) {
-                               ($s) = /^$cmd - (.+)$/;
-                               last if $s;
-                       }
-                       close $f;
-                       $cmd =~ s/^git-//;
-                       print "\t{\"$cmd\", N_(\"$s\"), $grp{$t}},\n";
-                       last;
-               }
-       }
-}
-
-print "};\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/generate-cmdlist.sh 
new/git-2.5.2/generate-cmdlist.sh
--- old/git-2.5.1/generate-cmdlist.sh   1970-01-01 01:00:00.000000000 +0100
+++ new/git-2.5.2/generate-cmdlist.sh   2015-09-04 20:02:19.000000000 +0200
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+echo "/* Automatically generated by $0 */
+struct cmdname_help {
+       char name[16];
+       char help[80];
+       unsigned char group;
+};
+
+static const char *common_cmd_groups[] = {"
+
+grps=grps$$.tmp
+match=match$$.tmp
+trap "rm -f '$grps' '$match'" 0 1 2 3 15
+
+sed -n '
+       1,/^### common groups/b
+       /^### command list/q
+       /^#/b
+       /^[     ]*$/b
+       h;s/^[^         ][^     ]*[     ][      ]*\(.*\)/       N_("\1"),/p
+       g;s/^\([^       ][^     ]*\)[   ].*/\1/w '$grps'
+       ' "$1"
+printf '};\n\n'
+
+n=0
+substnum=
+while read grp
+do
+       echo "^git-..*[         ]$grp"
+       substnum="$substnum${substnum:+;}s/[    ]$grp/$n/"
+       n=$(($n+1))
+done <"$grps" >"$match"
+
+printf 'static struct cmdname_help common_cmds[] = {\n'
+grep -f "$match" "$1" |
+sed 's/^git-//' |
+sort |
+while read cmd tags
+do
+       tag=$(echo "$tags" | sed "$substnum; s/[^0-9]//g")
+       sed -n '
+               /^NAME/,/git-'"$cmd"'/H
+               ${
+                       x
+                       s/.*git-'"$cmd"' - \(.*\)/      {"'"$cmd"'", N_("\1"), 
'$tag'},/
+                       p
+               }' "Documentation/git-$cmd.txt"
+done
+echo "};"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/git-compat-util.h 
new/git-2.5.2/git-compat-util.h
--- old/git-2.5.1/git-compat-util.h     2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/git-compat-util.h     2015-09-04 20:02:19.000000000 +0200
@@ -389,7 +389,6 @@
 
 /* General helper functions */
 extern void vreportf(const char *prefix, const char *err, va_list params);
-extern void vwritef(int fd, const char *prefix, const char *err, va_list 
params);
 extern NORETURN void usage(const char *err);
 extern NORETURN void usagef(const char *err, ...) __attribute__((format 
(printf, 1, 2)));
 extern NORETURN void die(const char *err, ...) __attribute__((format (printf, 
1, 2)));
@@ -425,6 +424,7 @@
 extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, 
va_list params));
 extern void set_error_routine(void (*routine)(const char *err, va_list 
params));
 extern void set_die_is_recursing_routine(int (*routine)(void));
+extern void set_error_handle(FILE *);
 
 extern int starts_with(const char *str, const char *prefix);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/git.spec new/git-2.5.2/git.spec
--- old/git-2.5.1/git.spec      2015-08-28 21:37:14.000000000 +0200
+++ new/git-2.5.2/git.spec      2015-09-04 20:02:19.000000000 +0200
@@ -1,7 +1,7 @@
 # Pass --without docs to rpmbuild if you don't want the documentation
 
 Name:          git
-Version:       2.5.1
+Version:       2.5.2
 Release:       1%{?dist}
 Summary:       Core git tools
 License:       GPL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/notes.c new/git-2.5.2/notes.c
--- old/git-2.5.1/notes.c       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/notes.c       2015-09-04 20:02:19.000000000 +0200
@@ -362,13 +362,14 @@
        return strcmp(a->path, b->path);
 }
 
-static void add_non_note(struct notes_tree *t, const char *path,
+/* note: takes ownership of path string */
+static void add_non_note(struct notes_tree *t, char *path,
                unsigned int mode, const unsigned char *sha1)
 {
        struct non_note *p = t->prev_non_note, *n;
        n = (struct non_note *) xmalloc(sizeof(struct non_note));
        n->next = NULL;
-       n->path = xstrdup(path);
+       n->path = path;
        n->mode = mode;
        hashcpy(n->sha1, sha1);
        t->prev_non_note = n;
@@ -482,17 +483,17 @@
                 * component.
                 */
                {
-                       char non_note_path[PATH_MAX];
-                       char *p = non_note_path;
+                       struct strbuf non_note_path = STRBUF_INIT;
                        const char *q = sha1_to_hex(subtree->key_sha1);
                        int i;
                        for (i = 0; i < prefix_len; i++) {
-                               *p++ = *q++;
-                               *p++ = *q++;
-                               *p++ = '/';
+                               strbuf_addch(&non_note_path, *q++);
+                               strbuf_addch(&non_note_path, *q++);
+                               strbuf_addch(&non_note_path, '/');
                        }
-                       strcpy(p, entry.path);
-                       add_non_note(t, non_note_path, entry.mode, entry.sha1);
+                       strbuf_addstr(&non_note_path, entry.path);
+                       add_non_note(t, strbuf_detach(&non_note_path, NULL),
+                                    entry.mode, entry.sha1);
                }
        }
        free(buf);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/pager.c new/git-2.5.2/pager.c
--- old/git-2.5.1/pager.c       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/pager.c       2015-09-04 20:02:19.000000000 +0200
@@ -150,7 +150,8 @@
        struct strbuf key = STRBUF_INIT;
        const char *value = NULL;
        strbuf_addf(&key, "pager.%s", cmd);
-       if (!git_config_get_value(key.buf, &value)) {
+       if (git_config_key_is_valid(key.buf) &&
+           !git_config_get_value(key.buf, &value)) {
                int b = git_config_maybe_bool(key.buf, value);
                if (b >= 0)
                        want = b;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/po/README new/git-2.5.2/po/README
--- old/git-2.5.1/po/README     2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/po/README     2015-09-04 20:02:19.000000000 +0200
@@ -10,10 +10,26 @@
 
         https://github.com/git-l10n/git-po/
 
+The two character language translation codes are defined by ISO_639-1, as
+stated in the gettext(1) full manual, appendix A.1, Usual Language Codes.
+
+
+Contributing to an existing translation
+---------------------------------------
 As a contributor for a language XX, you should first check TEAMS file in
 this directory to see whether a dedicated repository for your language XX
 exists. Fork the dedicated repository and start to work if it exists.
 
+Sometime, contributors may find that the translations of their Git
+distributions are quite different with the translations of the
+corresponding version from Git official. This is because some Git
+distributions (such as from Ubuntu, etc.) have their own l10n workflow.
+For this case, wrong translations should be reported and fixed through
+their workflows.
+
+
+Creating a new language translation
+-----------------------------------
 If you are the first contributor for the language XX, please fork this
 repository, prepare and/or update the translated message file po/XX.po
 (described later), and ask the l10n coordinator to pull your work.
@@ -23,6 +39,9 @@
 language, so that the l10n coordinator only needs to interact with one
 person per language.
 
+
+Translation Process Flow
+------------------------
 The overall data-flow looks like this:
 
     +-------------------+            +------------------+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/revision.c new/git-2.5.2/revision.c
--- old/git-2.5.1/revision.c    2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/revision.c    2015-09-04 20:02:19.000000000 +0200
@@ -2173,6 +2173,21 @@
        return 1;
 }
 
+static void NORETURN diagnose_missing_default(const char *def)
+{
+       unsigned char sha1[20];
+       int flags;
+       const char *refname;
+
+       refname = resolve_ref_unsafe(def, 0, sha1, &flags);
+       if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))
+               die(_("your current branch appears to be broken"));
+
+       skip_prefix(refname, "refs/heads/", &refname);
+       die(_("your current branch '%s' does not have any commits yet"),
+           refname);
+}
+
 /*
  * Parse revision information, filling in the "rev_info" structure,
  * and removing the used arguments from the argument list.
@@ -2302,7 +2317,7 @@
                struct object *object;
                struct object_context oc;
                if (get_sha1_with_context(revs->def, 0, sha1, &oc))
-                       die("bad default revision '%s'", revs->def);
+                       diagnose_missing_default(revs->def);
                object = get_reference(revs, revs->def, sha1, 0);
                add_pending_object_with_mode(revs, object, revs->def, oc.mode);
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/run-command.c new/git-2.5.2/run-command.c
--- old/git-2.5.1/run-command.c 2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/run-command.c 2015-09-04 20:02:19.000000000 +0200
@@ -200,7 +200,6 @@
 #endif
 
 #ifndef GIT_WINDOWS_NATIVE
-static int child_err = 2;
 static int child_notifier = -1;
 
 static void notify_parent(void)
@@ -212,17 +211,6 @@
         */
        xwrite(child_notifier, "", 1);
 }
-
-static NORETURN void die_child(const char *err, va_list params)
-{
-       vwritef(child_err, "fatal: ", err, params);
-       exit(128);
-}
-
-static void error_child(const char *err, va_list params)
-{
-       vwritef(child_err, "error: ", err, params);
-}
 #endif
 
 static inline void set_cloexec(int fd)
@@ -362,11 +350,10 @@
                 * in subsequent call paths use the parent's stderr.
                 */
                if (cmd->no_stderr || need_err) {
-                       child_err = dup(2);
+                       int child_err = dup(2);
                        set_cloexec(child_err);
+                       set_error_handle(fdopen(child_err, "w"));
                }
-               set_die_routine(die_child);
-               set_error_routine(error_child);
 
                close(notify_pipe[0]);
                set_cloexec(notify_pipe[1]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/setup.c new/git-2.5.2/setup.c
--- old/git-2.5.1/setup.c       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/setup.c       2015-09-04 20:02:19.000000000 +0200
@@ -402,9 +402,9 @@
        struct strbuf path = STRBUF_INIT;
        struct stat st;
 
-       strbuf_addf(&path, "%s/gitfile", gitdir);
+       strbuf_addf(&path, "%s/gitdir", gitdir);
        if (stat(path.buf, &st) || st.st_mtime + 24 * 3600 < time(NULL))
-               write_file(path.buf, 0, "%s\n", gitfile);
+               write_file(path.buf, 1, "%s\n", gitfile);
        strbuf_release(&path);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/sha1_file.c new/git-2.5.2/sha1_file.c
--- old/git-2.5.1/sha1_file.c   2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/sha1_file.c   2015-09-04 20:02:19.000000000 +0200
@@ -377,15 +377,12 @@
        char *map;
        size_t mapsz;
        struct stat st;
-       const char alt_file_name[] = "info/alternates";
-       /* Given that relative_base is no longer than PATH_MAX,
-          ensure that "path" has enough space to append "/", the
-          file name, "info/alternates", and a trailing NUL.  */
-       char path[PATH_MAX + 1 + sizeof alt_file_name];
+       char *path;
        int fd;
 
-       sprintf(path, "%s/%s", relative_base, alt_file_name);
+       path = xstrfmt("%s/info/alternates", relative_base);
        fd = git_open_noatime(path);
+       free(path);
        if (fd < 0)
                return;
        if (fstat(fd, &st) || (st.st_size == 0)) {
@@ -1461,7 +1458,10 @@
        static int sha1_file_open_flag = O_NOATIME;
 
        for (;;) {
-               int fd = open(name, O_RDONLY | sha1_file_open_flag);
+               int fd;
+
+               errno = 0;
+               fd = open(name, O_RDONLY | sha1_file_open_flag);
                if (fd >= 0)
                        return fd;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/strbuf.c new/git-2.5.2/strbuf.c
--- old/git-2.5.1/strbuf.c      2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/strbuf.c      2015-09-04 20:02:19.000000000 +0200
@@ -364,19 +364,19 @@
 
        strbuf_grow(sb, hint ? hint : 8192);
        for (;;) {
-               ssize_t cnt;
+               ssize_t want = sb->alloc - sb->len - 1;
+               ssize_t got = read_in_full(fd, sb->buf + sb->len, want);
 
-               cnt = xread(fd, sb->buf + sb->len, sb->alloc - sb->len - 1);
-               if (cnt < 0) {
+               if (got < 0) {
                        if (oldalloc == 0)
                                strbuf_release(sb);
                        else
                                strbuf_setlen(sb, oldlen);
                        return -1;
                }
-               if (!cnt)
+               sb->len += got;
+               if (got < want)
                        break;
-               sb->len += cnt;
                strbuf_grow(sb, 8192);
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t0090-cache-tree.sh 
new/git-2.5.2/t/t0090-cache-tree.sh
--- old/git-2.5.1/t/t0090-cache-tree.sh 2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t0090-cache-tree.sh 2015-09-04 20:02:19.000000000 +0200
@@ -218,4 +218,14 @@
        ! test -s errors
 '
 
+test_expect_success 'switching trees does not invalidate shared index' '
+       git update-index --split-index &&
+       >split &&
+       git add split &&
+       test-dump-split-index .git/index | grep -v ^own >before &&
+       git commit -m "as-is" &&
+       test-dump-split-index .git/index | grep -v ^own >after &&
+       test_cmp before after
+'
+
 test_done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t1509-root-worktree.sh 
new/git-2.5.2/t/t1509-root-worktree.sh
--- old/git-2.5.1/t/t1509-root-worktree.sh      2015-08-28 21:37:13.000000000 
+0200
+++ new/git-2.5.2/t/t1509-root-worktree.sh      2015-09-04 20:02:19.000000000 
+0200
@@ -125,7 +125,7 @@
 ONE_SHA1=d00491fd7e5bb6fa28c517a0bb32b8b506539d4d
 
 test_expect_success 'setup' '
-       rm -rf /foo
+       rm -rf /foo &&
        mkdir /foo &&
        mkdir /foo/bar &&
        echo 1 > /foo/foome &&
@@ -218,7 +218,7 @@
 
 test_expect_success 'go to /' 'cd /'
 test_expect_success 'setup' '
-       rm -rf /.git
+       rm -rf /.git &&
        echo "Initialized empty Git repository in /.git/" > expected &&
        git init > result &&
        test_cmp expected result
@@ -241,8 +241,8 @@
 
 # DESTROYYYYY!!!!!
 test_expect_success 'setup' '
-       rm -rf /refs /objects /info /hooks
-       rm /*
+       rm -rf /refs /objects /info /hooks &&
+       rm -f /expected /ls.expected /me /result &&
        cd / &&
        echo "Initialized empty Git repository in /" > expected &&
        git init --bare > result &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t2019-checkout-ambiguous-ref.sh 
new/git-2.5.2/t/t2019-checkout-ambiguous-ref.sh
--- old/git-2.5.1/t/t2019-checkout-ambiguous-ref.sh     2015-08-28 
21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t2019-checkout-ambiguous-ref.sh     2015-09-04 
20:02:19.000000000 +0200
@@ -69,7 +69,7 @@
        )
 '
 
-test_expect_success 'wildcard ambiguation, refs lose' '
+test_expect_success !MINGW 'wildcard ambiguation, refs lose' '
        git init ambi2 &&
        (
                cd ambi2 &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t3020-ls-files-error-unmatch.sh 
new/git-2.5.2/t/t3020-ls-files-error-unmatch.sh
--- old/git-2.5.1/t/t3020-ls-files-error-unmatch.sh     2015-08-28 
21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t3020-ls-files-error-unmatch.sh     2015-09-04 
20:02:19.000000000 +0200
@@ -22,7 +22,7 @@
     'test_must_fail git ls-files --error-unmatch foo bar-does-not-match'
 
 test_expect_success \
-    'git ls-files --error-unmatch should succeed eith matched paths.' \
+    'git ls-files --error-unmatch should succeed with matched paths.' \
     'git ls-files --error-unmatch foo bar'
 
 test_done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t4202-log.sh new/git-2.5.2/t/t4202-log.sh
--- old/git-2.5.1/t/t4202-log.sh        2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t4202-log.sh        2015-09-04 20:02:19.000000000 +0200
@@ -871,4 +871,18 @@
        test_must_fail git log --graph --no-walk
 '
 
+test_expect_success 'log diagnoses bogus HEAD' '
+       git init empty &&
+       test_must_fail git -C empty log 2>stderr &&
+       test_i18ngrep does.not.have.any.commits stderr &&
+       echo 1234abcd >empty/.git/refs/heads/master &&
+       test_must_fail git -C empty log 2>stderr &&
+       test_i18ngrep broken stderr &&
+       echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
+       test_must_fail git -C empty log 2>stderr &&
+       test_i18ngrep broken stderr &&
+       test_must_fail git -C empty log --default totally-bogus 2>stderr &&
+       test_i18ngrep broken stderr
+'
+
 test_done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t5004-archive-corner-cases.sh 
new/git-2.5.2/t/t5004-archive-corner-cases.sh
--- old/git-2.5.1/t/t5004-archive-corner-cases.sh       2015-08-28 
21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t5004-archive-corner-cases.sh       2015-09-04 
20:02:19.000000000 +0200
@@ -115,4 +115,44 @@
        check_dir extract sub
 '
 
+ZIPINFO=zipinfo
+
+test_lazy_prereq ZIPINFO '
+       n=$("$ZIPINFO" "$TEST_DIRECTORY"/t5004/empty.zip | sed -n "2s/.* //p")
+       test "x$n" = "x0"
+'
+
+test_expect_success ZIPINFO 'zip archive with many entries' '
+       # add a directory with 256 files
+       mkdir 00 &&
+       for a in 0 1 2 3 4 5 6 7 8 9 a b c d e f
+       do
+               for b in 0 1 2 3 4 5 6 7 8 9 a b c d e f
+               do
+                       : >00/$a$b
+               done
+       done &&
+       git add 00 &&
+       git commit -m "256 files in 1 directory" &&
+
+       # duplicate it to get 65536 files in 256 directories
+       subtree=$(git write-tree --prefix=00/) &&
+       for c in 0 1 2 3 4 5 6 7 8 9 a b c d e f
+       do
+               for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f
+               do
+                       echo "040000 tree $subtree      $c$d"
+               done
+       done >tree &&
+       tree=$(git mktree <tree) &&
+
+       # zip them
+       git archive -o many.zip $tree &&
+
+       # check the number of entries in the ZIP file directory
+       expr 65536 + 256 >expect &&
+       "$ZIPINFO" many.zip | head -2 | sed -n "2s/.* //p" >actual &&
+       test_cmp expect actual
+'
+
 test_done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t7006-pager.sh 
new/git-2.5.2/t/t7006-pager.sh
--- old/git-2.5.1/t/t7006-pager.sh      2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t7006-pager.sh      2015-09-04 20:02:19.000000000 +0200
@@ -447,4 +447,13 @@
        test_cmp expect actual
 '
 
+test_expect_success 'command with underscores does not complain' '
+       write_script git-under_score <<-\EOF &&
+       echo ok
+       EOF
+       git --exec-path=. under_score >actual 2>&1 &&
+       echo ok >expect &&
+       test_cmp expect actual
+'
+
 test_done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t7300-clean.sh 
new/git-2.5.2/t/t7300-clean.sh
--- old/git-2.5.1/t/t7300-clean.sh      2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/t/t7300-clean.sh      2015-09-04 20:02:19.000000000 +0200
@@ -432,9 +432,7 @@
        (
                cd foo &&
                git init &&
-               >hello.world
-               git add . &&
-               git commit -a -m nested
+               test_commit nested hello.world
        ) &&
        (
                cd bar &&
@@ -443,9 +441,7 @@
        (
                cd baz/boo &&
                git init &&
-               >deeper.world
-               git add . &&
-               git commit -a -m deeply.nested
+               test_commit deeply.nested deeper.world
        ) &&
        git clean -f -d &&
        test -f foo/.git/index &&
@@ -461,9 +457,7 @@
        (
                cd foo &&
                git init &&
-               >hello.world
-               git add . &&
-               git commit -a -m nested
+               test_commit nested hello.world
        ) &&
        (
                cd bar &&
@@ -472,9 +466,7 @@
        (
                cd baz/boo &&
                git init &&
-               >deeper.world
-               git add . &&
-               git commit -a -m deeply.nested
+               test_commit deeply.nested deeper.world
        ) &&
        git clean -f -f -d &&
        ! test -d foo &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/t/t7513-interpret-trailers.sh 
new/git-2.5.2/t/t7513-interpret-trailers.sh
--- old/git-2.5.1/t/t7513-interpret-trailers.sh 2015-08-28 21:37:13.000000000 
+0200
+++ new/git-2.5.2/t/t7513-interpret-trailers.sh 2015-09-04 20:02:19.000000000 
+0200
@@ -93,12 +93,39 @@
                Acked-by: Johan
                Reviewed-by: Peff
        EOF
-       echo "Acked-by: Johan" |
+       { echo; echo "Acked-by: Johan"; } |
        git -c "trailer.Acked-by.ifexists=addifdifferent" interpret-trailers \
                --trailer "Reviewed-by: Peff" --trailer "Acked-by: Johan" 
>actual &&
        test_cmp expected actual
 '
 
+test_expect_success 'with only a title in the message' '
+       cat >expected <<-\EOF &&
+               area: change
+
+               Reviewed-by: Peff
+               Acked-by: Johan
+       EOF
+       echo "area: change" |
+       git interpret-trailers --trailer "Reviewed-by: Peff" \
+               --trailer "Acked-by: Johan" >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success 'with multiline title in the message' '
+       cat >expected <<-\EOF &&
+               place of
+               code: change
+
+               Reviewed-by: Peff
+               Acked-by: Johan
+       EOF
+       printf "%s\n" "place of" "code: change" |
+       git interpret-trailers --trailer "Reviewed-by: Peff" \
+               --trailer "Acked-by: Johan" >actual &&
+       test_cmp expected actual
+'
+
 test_expect_success 'with config setup' '
        git config trailer.ack.key "Acked-by: " &&
        cat >expected <<-\EOF &&
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/test-dump-split-index.c 
new/git-2.5.2/test-dump-split-index.c
--- old/git-2.5.1/test-dump-split-index.c       2015-08-28 21:37:13.000000000 
+0200
+++ new/git-2.5.2/test-dump-split-index.c       2015-09-04 20:02:19.000000000 
+0200
@@ -26,9 +26,11 @@
                       sha1_to_hex(ce->sha1), ce_stage(ce), ce->name);
        }
        printf("replacements:");
-       ewah_each_bit(si->replace_bitmap, show_bit, NULL);
+       if (si->replace_bitmap)
+               ewah_each_bit(si->replace_bitmap, show_bit, NULL);
        printf("\ndeletions:");
-       ewah_each_bit(si->delete_bitmap, show_bit, NULL);
+       if (si->delete_bitmap)
+               ewah_each_bit(si->delete_bitmap, show_bit, NULL);
        printf("\n");
        return 0;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/trailer.c new/git-2.5.2/trailer.c
--- old/git-2.5.1/trailer.c     2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/trailer.c     2015-09-04 20:02:19.000000000 +0200
@@ -735,13 +735,22 @@
  */
 static int find_trailer_start(struct strbuf **lines, int count)
 {
-       int start, only_spaces = 1;
+       int start, end_of_title, only_spaces = 1;
+
+       /* The first paragraph is the title and cannot be trailers */
+       for (start = 0; start < count; start++) {
+               if (lines[start]->buf[0] == comment_line_char)
+                       continue;
+               if (contains_only_spaces(lines[start]->buf))
+                       break;
+       }
+       end_of_title = start;
 
        /*
         * Get the start of the trailers by looking starting from the end
         * for a line with only spaces before lines with one separator.
         */
-       for (start = count - 1; start >= 0; start--) {
+       for (start = count - 1; start >= end_of_title; start--) {
                if (lines[start]->buf[0] == comment_line_char)
                        continue;
                if (contains_only_spaces(lines[start]->buf)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/unpack-trees.c new/git-2.5.2/unpack-trees.c
--- old/git-2.5.1/unpack-trees.c        2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/unpack-trees.c        2015-09-04 20:02:19.000000000 +0200
@@ -1441,15 +1441,18 @@
        if (!len)
                return 0;
        else if (len > 0) {
-               char path[PATH_MAX + 1];
-               memcpy(path, ce->name, len);
-               path[len] = 0;
+               char *path;
+               int ret;
+
+               path = xmemdupz(ce->name, len);
                if (lstat(path, &st))
-                       return error("cannot stat '%s': %s", path,
+                       ret = error("cannot stat '%s': %s", path,
                                        strerror(errno));
-
-               return check_ok_to_remove(path, len, DT_UNKNOWN, NULL, &st,
-                               error_type, o);
+               else
+                       ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL,
+                                                &st, error_type, o);
+               free(path);
+               return ret;
        } else if (lstat(ce->name, &st)) {
                if (errno != ENOENT)
                        return error("cannot stat '%s': %s", ce->name,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/usage.c new/git-2.5.2/usage.c
--- old/git-2.5.1/usage.c       2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/usage.c       2015-09-04 20:02:19.000000000 +0200
@@ -6,23 +6,22 @@
 #include "git-compat-util.h"
 #include "cache.h"
 
-void vreportf(const char *prefix, const char *err, va_list params)
-{
-       char msg[4096];
-       vsnprintf(msg, sizeof(msg), err, params);
-       fprintf(stderr, "%s%s\n", prefix, msg);
-}
+static FILE *error_handle;
+static int tweaked_error_buffering;
 
-void vwritef(int fd, const char *prefix, const char *err, va_list params)
+void vreportf(const char *prefix, const char *err, va_list params)
 {
-       char msg[4096];
-       int len = vsnprintf(msg, sizeof(msg), err, params);
-       if (len > sizeof(msg))
-               len = sizeof(msg);
+       FILE *fh = error_handle ? error_handle : stderr;
 
-       write_in_full(fd, prefix, strlen(prefix));
-       write_in_full(fd, msg, len);
-       write_in_full(fd, "\n", 1);
+       fflush(fh);
+       if (!tweaked_error_buffering) {
+               setvbuf(fh, NULL, _IOLBF, 0);
+               tweaked_error_buffering = 1;
+       }
+
+       fputs(prefix, fh);
+       vfprintf(fh, err, params);
+       fputc('\n', fh);
 }
 
 static NORETURN void usage_builtin(const char *err, va_list params)
@@ -76,6 +75,12 @@
        die_is_recursing = routine;
 }
 
+void set_error_handle(FILE *fh)
+{
+       error_handle = fh;
+       tweaked_error_buffering = 0;
+}
+
 void NORETURN usagef(const char *err, ...)
 {
        va_list params;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/version new/git-2.5.2/version
--- old/git-2.5.1/version       2015-08-28 21:37:14.000000000 +0200
+++ new/git-2.5.2/version       2015-09-04 20:02:19.000000000 +0200
@@ -1 +1 @@
-2.5.1
+2.5.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/wt-status.c new/git-2.5.2/wt-status.c
--- old/git-2.5.1/wt-status.c   2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/wt-status.c   2015-09-04 20:02:19.000000000 +0200
@@ -1,5 +1,4 @@
 #include "cache.h"
-#include "pathspec.h"
 #include "wt-status.h"
 #include "object.h"
 #include "dir.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/git-2.5.1/wt-status.h new/git-2.5.2/wt-status.h
--- old/git-2.5.1/wt-status.h   2015-08-28 21:37:13.000000000 +0200
+++ new/git-2.5.2/wt-status.h   2015-09-04 20:02:19.000000000 +0200
@@ -4,6 +4,7 @@
 #include <stdio.h>
 #include "string-list.h"
 #include "color.h"
+#include "pathspec.h"
 
 enum color_wt_status {
        WT_STATUS_HEADER = 0,


Reply via email to