Imported Upstream version 2.1.3 upstream/2.1.3
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 3 Mar 2021 06:14:44 +0000 (15:14 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 3 Mar 2021 06:14:44 +0000 (15:14 +0900)
18 files changed:
Documentation/RelNotes/2.1.3.txt [new file with mode: 0644]
Documentation/config.txt
Documentation/git-tag.txt
Documentation/git.txt
Documentation/pretty-formats.txt
GIT-VERSION-GEN
RelNotes
builtin/mailinfo.c
builtin/pack-objects.c
daemon.c
gitweb/gitweb.perl
mergetools/meld
t/t5100-mailinfo.sh
t/t5100/embed-from.expect [new file with mode: 0644]
t/t5100/embed-from.in [new file with mode: 0644]
t/t5100/quoted-from.expect [new file with mode: 0644]
t/t5100/quoted-from.in [new file with mode: 0644]
t/t5310-pack-bitmaps.sh

diff --git a/Documentation/RelNotes/2.1.3.txt b/Documentation/RelNotes/2.1.3.txt
new file mode 100644 (file)
index 0000000..acc9ebb
--- /dev/null
@@ -0,0 +1,26 @@
+Git v2.1.3 Release Notes
+========================
+
+ * Some MUAs mangled a line in a message that begins with "From " to
+   ">From " when writing to a mailbox file and feeding such an input to
+   "git am" used to lose such a line.
+
+ * "git daemon" (with NO_IPV6 build configuration) used to incorrectly
+   use the hostname even when gethostbyname() reported that the given
+   hostname is not found.
+
+ * Newer versions of 'meld' breaks the auto-detection we use to see if
+   they are new enough to support the `--output` option.
+
+ * "git pack-objects" forgot to disable the codepath to generate
+   object recheability bitmap when it needs to split the resulting
+   pack.
+
+ * "gitweb" used deprecated CGI::startfrom, which was removed from
+   CGI.pm as of 4.04; use CGI::start_from instead.
+
+ * "git log" documentation had an example section marked up not
+   quite correctly, which passed AsciiDoc but failed with
+   AsciiDoctor.
+
+Also contains some documentation updates.
index c55c22a..382e12c 100644 (file)
@@ -1754,6 +1754,15 @@ mergetool.<tool>.trustExitCode::
        if the file has been updated, otherwise the user is prompted to
        indicate the success of the merge.
 
+mergetool.meld.hasOutput::
+       Older versions of `meld` do not support the `--output` option.
+       Git will attempt to detect whether `meld` supports `--output`
+       by inspecting the output of `meld --help`.  Configuring
+       `mergetool.meld.hasOutput` will make Git skip these checks and
+       use the configured value instead.  Setting `mergetool.meld.hasOutput`
+       to `true` tells Git to unconditionally use the `--output` option,
+       and `false` avoids using `--output`.
+
 mergetool.keepBackup::
        After performing a merge, the original file with conflict markers
        can be saved as a file with a `.orig` extension.  If this variable
index 3209083..e953ba4 100644 (file)
@@ -42,7 +42,7 @@ committer identity for the current user is used to find the
 GnuPG key for signing.         The configuration variable `gpg.program`
 is used to specify custom GnuPG binary.
 
-Tag objects (created with `-a`, `s`, or `-u`) are called "annotated"
+Tag objects (created with `-a`, `-s`, or `-u`) are called "annotated"
 tags; they contain a creation date, the tagger name and e-mail, a
 tagging message, and an optional GnuPG signature. Whereas a
 "lightweight" tag is simply a name for an object (usually a commit
index c6175d4..5627845 100644 (file)
@@ -43,9 +43,10 @@ unreleased) version of Git, that is available from the 'master'
 branch of the `git.git` repository.
 Documentation for older releases are available here:
 
-* link:v2.1.2/git.html[documentation for release 2.1.2]
+* link:v2.1.3/git.html[documentation for release 2.1.3]
 
 * release notes for
+  link:RelNotes/2.1.3.txt[2.1.3],
   link:RelNotes/2.1.2.txt[2.1.2],
   link:RelNotes/2.1.1.txt[2.1.1],
   link:RelNotes/2.1.0.txt[2.1].
index 85d6353..b87784d 100644 (file)
@@ -95,7 +95,7 @@ would show something like this:
 The author of fe6e0ee was Junio C Hamano, 23 hours ago
 The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
 
---------
+-------
 +
 The placeholders are:
 
index 14b866e..b0500c2 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.1.2
+DEF_VER=v2.1.3
 
 LF='
 '
index f2706be..192f48c 120000 (symlink)
--- a/RelNotes
+++ b/RelNotes
@@ -1 +1 @@
-Documentation/RelNotes/2.1.2.txt
\ No newline at end of file
+Documentation/RelNotes/2.1.3.txt
\ No newline at end of file
index cf11c8d..6a14d29 100644 (file)
@@ -288,6 +288,22 @@ static inline int cmp_header(const struct strbuf *line, const char *hdr)
                        line->buf[len] == ':' && isspace(line->buf[len + 1]);
 }
 
+static int is_format_patch_separator(const char *line, int len)
+{
+       static const char SAMPLE[] =
+               "From e6807f3efca28b30decfecb1732a56c7db1137ee Mon Sep 17 00:00:00 2001\n";
+       const char *cp;
+
+       if (len != strlen(SAMPLE))
+               return 0;
+       if (!skip_prefix(line, "From ", &cp))
+               return 0;
+       if (strspn(cp, "0123456789abcdef") != 40)
+               return 0;
+       cp += 40;
+       return !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) - (cp - line));
+}
+
 static int check_header(const struct strbuf *line,
                                struct strbuf *hdr_data[], int overwrite)
 {
@@ -329,7 +345,7 @@ static int check_header(const struct strbuf *line,
 
        /* for inbody stuff */
        if (starts_with(line->buf, ">From") && isspace(line->buf[5])) {
-               ret = 1; /* Should this return 0? */
+               ret = is_format_patch_separator(line->buf + 1, line->len - 1);
                goto check_header_out;
        }
        if (starts_with(line->buf, "[PATCH]") && isspace(line->buf[7])) {
index b59f5d8..3eb86e0 100644 (file)
@@ -812,6 +812,7 @@ static void write_pack_file(void)
                        fixup_pack_header_footer(fd, sha1, pack_tmp_name,
                                                 nr_written, sha1, offset);
                        close(fd);
+                       write_bitmap_index = 0;
                }
 
                if (!pack_to_stdout) {
index e6b51ed..4b02184 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -573,20 +573,21 @@ static void parse_host_arg(char *extra_args, int buflen)
                static char addrbuf[HOST_NAME_MAX + 1];
 
                hent = gethostbyname(hostname);
+               if (hent) {
+                       ap = hent->h_addr_list;
+                       memset(&sa, 0, sizeof sa);
+                       sa.sin_family = hent->h_addrtype;
+                       sa.sin_port = htons(0);
+                       memcpy(&sa.sin_addr, *ap, hent->h_length);
+
+                       inet_ntop(hent->h_addrtype, &sa.sin_addr,
+                                 addrbuf, sizeof(addrbuf));
 
-               ap = hent->h_addr_list;
-               memset(&sa, 0, sizeof sa);
-               sa.sin_family = hent->h_addrtype;
-               sa.sin_port = htons(0);
-               memcpy(&sa.sin_addr, *ap, hent->h_length);
-
-               inet_ntop(hent->h_addrtype, &sa.sin_addr,
-                         addrbuf, sizeof(addrbuf));
-
-               free(canon_hostname);
-               canon_hostname = xstrdup(hent->h_name);
-               free(ip_address);
-               ip_address = xstrdup(addrbuf);
+                       free(canon_hostname);
+                       canon_hostname = xstrdup(hent->h_name);
+                       free(ip_address);
+                       ip_address = xstrdup(addrbuf);
+               }
 #endif
        }
 }
@@ -834,7 +835,6 @@ static const char *ip2str(int family, struct sockaddr *sin, socklen_t len)
 static int setup_named_sock(char *listen_addr, int listen_port, struct socketlist *socklist)
 {
        int socknum = 0;
-       int maxfd = -1;
        char pbuf[NI_MAXSERV];
        struct addrinfo hints, *ai0, *ai;
        int gai;
@@ -902,9 +902,6 @@ static int setup_named_sock(char *listen_addr, int listen_port, struct socketlis
                ALLOC_GROW(socklist->list, socklist->nr + 1, socklist->alloc);
                socklist->list[socklist->nr++] = sockfd;
                socknum++;
-
-               if (maxfd < sockfd)
-                       maxfd = sockfd;
        }
 
        freeaddrinfo(ai0);
@@ -943,7 +940,7 @@ static int setup_named_sock(char *listen_addr, int listen_port, struct socketlis
        }
 
        if ( bind(sockfd, (struct sockaddr *)&sin, sizeof sin) < 0 ) {
-               logerror("Could not listen to %s: %s",
+               logerror("Could not bind to %s: %s",
                         ip2str(AF_INET, (struct sockaddr *)&sin, sizeof(sin)),
                         strerror(errno));
                close(sockfd);
index a9f57d6..ccf7516 100755 (executable)
@@ -4100,7 +4100,7 @@ sub print_search_form {
        if ($use_pathinfo) {
                $action .= "/".esc_url($project);
        }
-       print $cgi->startform(-method => "get", -action => $action) .
+       print $cgi->start_form(-method => "get", -action => $action) .
              "<div class=\"search\">\n" .
              (!$use_pathinfo &&
              $cgi->input({-name=>"p", -value=>$project, -type=>"hidden"}) . "\n") .
@@ -5510,7 +5510,7 @@ sub git_project_search_form {
        }
 
        print "<div class=\"projsearch\">\n";
-       print $cgi->startform(-method => 'get', -action => $my_uri) .
+       print $cgi->start_form(-method => 'get', -action => $my_uri) .
              $cgi->hidden(-name => 'a', -value => 'project_list')  . "\n";
        print $cgi->hidden(-name => 'pf', -value => $project_filter). "\n"
                if (defined $project_filter);
index cb672a5..83ebdfb 100644 (file)
@@ -18,13 +18,18 @@ merge_cmd () {
        check_unchanged
 }
 
-# Check whether 'meld --output <file>' is supported
+# Check whether we should use 'meld --output <file>'
 check_meld_for_output_version () {
        meld_path="$(git config mergetool.meld.path)"
        meld_path="${meld_path:-meld}"
 
-       if "$meld_path" --help 2>&1 | grep -e --output >/dev/null
+       if meld_has_output_option=$(git config --bool mergetool.meld.hasOutput)
        then
+               : use configured value
+       elif "$meld_path" --help 2>&1 |
+               grep -e '--output=' -e '\[OPTION\.\.\.\]' >/dev/null
+       then
+               : old ones mention --output and new ones just say OPTION...
                meld_has_output_option=true
        else
                meld_has_output_option=false
index 3e64a7a..9e1ad1c 100755 (executable)
@@ -89,4 +89,22 @@ test_expect_success 'mailinfo on from header without name works' '
 
 '
 
+test_expect_success 'mailinfo finds headers after embedded From line' '
+       mkdir embed-from &&
+       git mailsplit -oembed-from "$TEST_DIRECTORY"/t5100/embed-from.in &&
+       test_cmp "$TEST_DIRECTORY"/t5100/embed-from.in embed-from/0001 &&
+       git mailinfo embed-from/msg embed-from/patch \
+         <embed-from/0001 >embed-from/out &&
+       test_cmp "$TEST_DIRECTORY"/t5100/embed-from.expect embed-from/out
+'
+
+test_expect_success 'mailinfo on message with quoted >From' '
+       mkdir quoted-from &&
+       git mailsplit -oquoted-from "$TEST_DIRECTORY"/t5100/quoted-from.in &&
+       test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.in quoted-from/0001 &&
+       git mailinfo quoted-from/msg quoted-from/patch \
+         <quoted-from/0001 >quoted-from/out &&
+       test_cmp "$TEST_DIRECTORY"/t5100/quoted-from.expect quoted-from/msg
+'
+
 test_done
diff --git a/t/t5100/embed-from.expect b/t/t5100/embed-from.expect
new file mode 100644 (file)
index 0000000..06a3a38
--- /dev/null
@@ -0,0 +1,5 @@
+Author: Commit Author
+Email: commit@example.com
+Subject: patch subject
+Date: Sat, 13 Sep 2014 21:13:23 -0400 
+
diff --git a/t/t5100/embed-from.in b/t/t5100/embed-from.in
new file mode 100644 (file)
index 0000000..5f3f84e
--- /dev/null
@@ -0,0 +1,13 @@
+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
+From: Email Author <email@example.com>
+Date: Sun, 25 May 2008 00:38:18 -0700
+Subject: [PATCH] email subject
+
+>From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
+From: Commit Author <commit@example.com>
+Date: Sat, 13 Sep 2014 21:13:23 -0400
+Subject: patch subject
+
+patch body
+---
+patch
diff --git a/t/t5100/quoted-from.expect b/t/t5100/quoted-from.expect
new file mode 100644 (file)
index 0000000..8c9d48c
--- /dev/null
@@ -0,0 +1,3 @@
+>From the depths of history, we are stuck with the
+flaky mbox format.
+
diff --git a/t/t5100/quoted-from.in b/t/t5100/quoted-from.in
new file mode 100644 (file)
index 0000000..847e1c4
--- /dev/null
@@ -0,0 +1,10 @@
+From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
+From: Author Name <somebody@example.com>
+Date: Sun, 25 May 2008 00:38:18 -0700
+Subject: [PATCH] testing quoted >From
+
+>From the depths of history, we are stuck with the
+flaky mbox format.
+
+---
+patch
index 0580258..6003490 100755 (executable)
@@ -170,4 +170,13 @@ test_expect_success JGIT 'jgit can read our bitmaps' '
        )
 '
 
+test_expect_success 'splitting packs does not generate bogus bitmaps' '
+       test-genrandom foo $((1024 * 1024)) >rand &&
+       git add rand &&
+       git commit -m "commit with big file" &&
+       git -c pack.packSizeLimit=500k repack -adb &&
+       git init --bare no-bitmaps.git &&
+       git -C no-bitmaps.git fetch .. HEAD
+'
+
 test_done