Skip to content

Commit

Permalink
Merge tag 'v2.1.3' into merge/v2.1.3
Browse files Browse the repository at this point in the history
Git 2.1.3

# -----BEGIN PGP SIGNATURE-----
# Version: GnuPG v1
#
# iQIcBAABAgAGBQJUUSiJAAoJELC16IaWr+bLdkYP/0yx+KQPKwKBtPzFNRu508er
# /EKikvFc6SJ/n3SdmQb2yI291hAta/Bt2A5D07Z6xUDjrU/I/4csIwwR1gLJVEl6
# a7VBKjbulC9mvPAWrnHW8Cy7rSC5bX9XNVvFekGFv4VukmlrFluLB8Ztszvv566w
# Imlbk5a/8CMcuCngsVweNZIW11hvX6Xy8I3mZnJIAc0AaEn1+TiSAqqbWxB8FlkI
# lavOCG9wWDsjs4lg30fXDU39JjuJf1Cl1ZanTsuMAOaJtr4pjqlZ7GOCMxz9SW50
# vBi+lxSrmvzKdtdK+I+nSjVmUXM9vFD9lUpgZzOFJi0yC8YlSpX1ipsu4AsYG+7E
# jWFH3Do+lO5YPHTyEUmlf172EDyf/7ufeH9X9Wt5zfAyHN7csm9YHps9xSWXfzik
# dcqJstFzh43wM8lz4RpL9NJIxtkmJlXAXJ61wmmJxssY5e1yEDEJwo6LbRRQ3yU/
# HSzOV/SDW2UlqMnmtgKzdWeQfMeE5D4XHcP5boH+SuknwmLW4WMNycGkLtMQmDk5
# yzLCdLFWOFn4Tuz1hEHKyCwc+n+7iG101UUfpupSh5Pa3REUrg7HiThMhOw0n75r
# hbeIgNTMS+xKpY6aKe7CZ63N1eLd9kiVdNqidQYPeT4SDW+bUuh4o0UqzbzqRPOJ
# IWzYMLPQxiotNiINRwT+
# =kqUm
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Oct 29 13:48:57 2014 EDT
# gpg:                using RSA key B0B5E88696AFE6CB
# gpg: Can't check signature: No public key
  • Loading branch information
jjuran committed May 1, 2024
2 parents 8991abc + 49c3e92 commit 030c5c5
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 28 deletions.
26 changes: 26 additions & 0 deletions Documentation/RelNotes/2.1.3.txt
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 9 additions & 0 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-tag.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
2 changes: 1 addition & 1 deletion Documentation/pretty-formats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=v2.1.2
DEF_VER=v2.1.3

LF='
'
Expand Down
2 changes: 1 addition & 1 deletion RelNotes
18 changes: 17 additions & 1 deletion builtin/mailinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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])) {
Expand Down
1 change: 1 addition & 0 deletions builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,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) {
Expand Down
33 changes: 15 additions & 18 deletions daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -842,7 +843,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;
Expand Down Expand Up @@ -910,9 +910,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);
Expand Down Expand Up @@ -951,7 +948,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);
Expand Down
4 changes: 2 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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") .
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 7 additions & 2 deletions mergetools/meld
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions t/t5100-mailinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions t/t5100/embed-from.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Author: Commit Author
Email: [email protected]
Subject: patch subject
Date: Sat, 13 Sep 2014 21:13:23 -0400

13 changes: 13 additions & 0 deletions t/t5100/embed-from.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
From: Email Author <[email protected]>
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 <[email protected]>
Date: Sat, 13 Sep 2014 21:13:23 -0400
Subject: patch subject

patch body
---
patch
3 changes: 3 additions & 0 deletions t/t5100/quoted-from.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
>From the depths of history, we are stuck with the
flaky mbox format.

10 changes: 10 additions & 0 deletions t/t5100/quoted-from.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
From 1234567890123456789012345678901234567890 Mon Sep 17 00:00:00 2001
From: Author Name <[email protected]>
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
9 changes: 9 additions & 0 deletions t/t5310-pack-bitmaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 030c5c5

Please sign in to comment.