diff options
-rw-r--r-- | Documentation/RelNotes-1.5.5.2.txt | 27 | ||||
-rw-r--r-- | Documentation/config.txt | 3 | ||||
-rw-r--r-- | Documentation/git-add.txt | 4 | ||||
-rw-r--r-- | Documentation/git-daemon.txt | 4 | ||||
-rw-r--r-- | Documentation/git-describe.txt | 7 | ||||
-rw-r--r-- | Documentation/git-filter-branch.txt | 4 | ||||
-rw-r--r-- | Documentation/git-repack.txt | 7 | ||||
-rw-r--r-- | Documentation/git-rev-parse.txt | 22 | ||||
-rw-r--r-- | Documentation/git-show.txt | 2 | ||||
-rw-r--r-- | Documentation/rev-list-options.txt | 2 | ||||
l--------- | RelNotes | 2 | ||||
-rw-r--r-- | builtin-commit.c | 2 | ||||
-rwxr-xr-x | builtin-fast-export.c | 6 | ||||
-rw-r--r-- | builtin-rev-parse.c | 18 | ||||
-rw-r--r-- | builtin-show-branch.c | 4 | ||||
-rwxr-xr-x | git-am.sh | 2 | ||||
-rwxr-xr-x | git-repack.sh | 1 | ||||
-rwxr-xr-x | git-send-email.perl | 45 | ||||
-rwxr-xr-x | t/t9001-send-email.sh | 59 | ||||
-rw-r--r-- | wt-status.h | 4 |
20 files changed, 182 insertions, 43 deletions
diff --git a/Documentation/RelNotes-1.5.5.2.txt b/Documentation/RelNotes-1.5.5.2.txt new file mode 100644 index 0000000000..391a7b02ea --- /dev/null +++ b/Documentation/RelNotes-1.5.5.2.txt @@ -0,0 +1,27 @@ +GIT v1.5.5.2 Release Notes +========================== + +Fixes since v1.5.5.1 +-------------------- + + * "git repack -n" was mistakenly made no-op earlier. + + * "git imap-send" wanted to always have imap.host even when use of + imap.tunnel made it unnecessary. + + * reflog syntax that uses time e.g. "HEAD@{10 seconds ago}:path" did not + stop parsing at the closing "}". + + * "git rev-parse --symbolic-full-name ^master^2" printed solitary "^", + but it should print nothing. + + * "git commit" did not detect when it failed to write tree objects. + + * "git fetch" sometimes transferred too many objects unnecessarily. + + * a path specification "a/b" in .gitattributes file should not match + "sub/a/b". + + * various gitweb fixes. + +Also comes with various documentation updates. diff --git a/Documentation/config.txt b/Documentation/config.txt index 04c01c5fdc..273b358069 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -415,7 +415,8 @@ branch.<name>.mergeoptions:: branch.<name>.rebase:: When true, rebase the branch <name> on top of the fetched branch, - instead of merging the default branch from the default remote. + instead of merging the default branch from the default remote when + "git pull" is run. *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] for details). diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 35e67a06e4..e2389e380b 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -71,7 +71,9 @@ OPTIONS the specified filepatterns before exiting. -u:: - Update only files that git already knows about. This is similar + Update only files that git already knows about, staging modified + content for commit and marking deleted files for removal. This + is similar to what "git commit -a" does in preparation for making a commit, except that the update is limited to paths specified on the command line. If no paths are specified, all tracked files in the diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index fd83bc7833..cf261dd40d 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -174,7 +174,7 @@ upload-pack:: upload-archive:: This serves `git-archive --remote`. It is disabled by default, but a repository can enable it by setting - `daemon.uploadarchive` configuration item to `true`. + `daemon.uploadarch` configuration item to `true`. receive-pack:: This serves `git-send-pack` clients, allowing anonymous @@ -257,7 +257,7 @@ selectively enable/disable services per repository:: ---------------------------------------------------------------- [daemon] uploadpack = false - uploadarchive = true + uploadarch = true ---------------------------------------------------------------- diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt index d9aa2f2980..69e1ab750d 100644 --- a/Documentation/git-describe.txt +++ b/Documentation/git-describe.txt @@ -13,9 +13,10 @@ SYNOPSIS DESCRIPTION ----------- The command finds the most recent tag that is reachable from a -commit, and if the commit itself is pointed at by the tag, shows -the tag. Otherwise, it suffixes the tag name with the number of -additional commits and the abbreviated object name of the commit. +commit. If the tag points to the commit, then only the tag is +shown. Otherwise, it suffixes the tag name with the number of +additional commits on top of the tagged object and the +abbreviated object name of the most recent commit. OPTIONS diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 6454e49bf2..4a530965ec 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -177,6 +177,10 @@ or copyright violation) from all commits: git filter-branch --tree-filter 'rm filename' HEAD ------------------------------------------------------- +However, if the file is absent from the tree of some commit, +a simple `rm filename` will fail for that tree and commit. +Thus you may instead want to use `rm -f filename` as the script. + A significantly faster version: -------------------------------------------------------------------------- diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt index 3d957492f8..d14ab5154f 100644 --- a/Documentation/git-repack.txt +++ b/Documentation/git-repack.txt @@ -55,8 +55,11 @@ OPTIONS linkgit:git-pack-objects[1]. -n:: - Do not update the server information with - `git update-server-info`. + Do not update the server information with + `git update-server-info`. This option skips + updating local catalog files needed to publish + this repository (or a direct copy of it) + over HTTP or FTP. See gitlink:git-update-server-info[1]. --window=[N], --depth=[N]:: These two options affect how the objects contained in the pack are diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 6513c2efe1..5981c79f6a 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -238,16 +238,18 @@ Here is an illustration, by Jon Loeliger. Both commit nodes B and C are parents of commit node A. Parent commits are ordered left-to-right. - G H I J - \ / \ / - D E F - \ | / \ - \ | / | - \|/ | - B C - \ / - \ / - A +........................................ +G H I J + \ / \ / + D E F + \ | / \ + \ | / | + \|/ | + B C + \ / + \ / + A +........................................ A = = A^0 B = A^ = A^1 = A~1 diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt index dccf0e20ec..29ed0acc62 100644 --- a/Documentation/git-show.txt +++ b/Documentation/git-show.txt @@ -79,8 +79,6 @@ Documentation ------------- Documentation by David Greaves, Petr Baudis and the git-list <git@vger.kernel.org>. -This manual page is a stub. You can help the git documentation by expanding it. - GIT --- Part of the linkgit:git[7] suite diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 2648a55085..9cd677105d 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -13,7 +13,7 @@ include::pretty-options.txt[] Synonym for `--date=relative`. ---date={relative,local,default,iso,rfc}:: +--date={relative,local,default,iso,rfc,short}:: Only takes effect for dates shown in human-readable format, such as when using "--pretty". @@ -1 +1 @@ -Documentation/RelNotes-1.5.5.1.txt
\ No newline at end of file +Documentation/RelNotes-1.5.5.2.txt
\ No newline at end of file diff --git a/builtin-commit.c b/builtin-commit.c index 52a05c20bb..e3564a526a 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -101,7 +101,7 @@ static struct option builtin_commit_options[] = { OPT_BOOLEAN('o', "only", &only, "commit only specified files"), OPT_BOOLEAN('n', "no-verify", &no_verify, "bypass pre-commit hook"), OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"), - OPT_BOOLEAN(0, "untracked-files", &untracked_files, "show all untracked files"), + OPT_BOOLEAN('u', "untracked-files", &untracked_files, "show all untracked files"), OPT_BOOLEAN(0, "allow-empty", &allow_empty, "ok to record an empty change"), OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"), diff --git a/builtin-fast-export.c b/builtin-fast-export.c index e1c56303e5..4ab93fcf78 100755 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -204,14 +204,10 @@ static void handle_commit(struct commit *commit, struct rev_info *rev) continue; if (i == 0) printf("from :%d\n", mark); - else if (i == 1) - printf("merge :%d", mark); else - printf(" :%d", mark); + printf("merge :%d\n", mark); i++; } - if (i > 1) - printf("\n"); log_tree_diff_flush(rev); rev->diffopt.output_format = saved_output_format; diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index 0351d54435..00b607824d 100644 --- a/builtin-rev-parse.c +++ b/builtin-rev-parse.c @@ -96,6 +96,14 @@ static void show(const char *arg) puts(arg); } +/* Like show(), but with a negation prefix according to type */ +static void show_with_type(int type, const char *arg) +{ + if (type != show_type) + putchar('^'); + show(arg); +} + /* Output a revision, only if filter allows it */ static void show_rev(int type, const unsigned char *sha1, const char *name) { @@ -104,8 +112,6 @@ static void show_rev(int type, const unsigned char *sha1, const char *name) def = NULL; revs_count++; - if (type != show_type) - putchar('^'); if (symbolic && name) { if (symbolic == SHOW_SYMBOLIC_FULL) { unsigned char discard[20]; @@ -122,20 +128,20 @@ static void show_rev(int type, const unsigned char *sha1, const char *name) */ break; case 1: /* happy */ - show(full); + show_with_type(type, full); break; default: /* ambiguous */ error("refname '%s' is ambiguous", name); break; } } else { - show(name); + show_with_type(type, name); } } else if (abbrev) - show(find_unique_abbrev(sha1, abbrev)); + show_with_type(type, find_unique_abbrev(sha1, abbrev)); else - show(sha1_to_hex(sha1)); + show_with_type(type, sha1_to_hex(sha1)); } /* Output a flag, only if filter allows it. */ diff --git a/builtin-show-branch.c b/builtin-show-branch.c index 019abd3527..a383323184 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -782,8 +782,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) has_head++; } if (!has_head) { - int pfxlen = strlen("refs/heads/"); - append_one_rev(head + pfxlen); + int offset = !prefixcmp(head, "refs/heads/") ? 11 : 0; + append_one_rev(head + offset); } } @@ -11,7 +11,7 @@ git-am [options] --skip -- d,dotest= (removed -- do not use) i,interactive run interactively -b,binary pass --allo-binary-replacement to git-apply +b,binary pass --allow-binary-replacement to git-apply 3,3way allow fall back on 3way merging if needed s,signoff add a Signed-off-by line to the commit message u,utf8 recode into utf8 (default) diff --git a/git-repack.sh b/git-repack.sh index e18eb3f5dc..501519ab68 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -11,6 +11,7 @@ a pack everything in a single pack A same as -a, and keep unreachable objects too d remove redundant packs, and run git-prune-packed f pass --no-reuse-delta to git-pack-objects +n do not run git-update-server-info q,quiet be quiet l pass --local to git-pack-objects Packing constraints diff --git a/git-send-email.perl b/git-send-email.perl index be4a20d7cd..c6bba47eb6 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -518,8 +518,30 @@ EOT open(C,"<",$compose_filename) or die "Failed to open $compose_filename : " . $!; + my $need_8bit_cte = file_has_nonascii($compose_filename); + my $in_body = 0; while(<C>) { next if m/^GIT: /; + if (!$in_body && /^\n$/) { + $in_body = 1; + if ($need_8bit_cte) { + print C2 "MIME-Version: 1.0\n", + "Content-Type: text/plain; ", + "charset=utf-8\n", + "Content-Transfer-Encoding: 8bit\n"; + } + } + if (!$in_body && /^MIME-Version:/i) { + $need_8bit_cte = 0; + } + if (!$in_body && /^Subject: ?(.*)/i) { + my $subject = $1; + $_ = "Subject: " . + ($subject =~ /[^[:ascii:]]/ ? + quote_rfc2047($subject) : + $subject) . + "\n"; + } print C2 $_; } close(C); @@ -610,6 +632,14 @@ sub unquote_rfc2047 { return wantarray ? ($_, $encoding) : $_; } +sub quote_rfc2047 { + local $_ = shift; + my $encoding = shift || 'utf-8'; + s/([^-a-zA-Z0-9!*+\/])/sprintf("=%02X", ord($1))/eg; + s/(.*)/=\?$encoding\?q\?$1\?=/; + return $_; +} + # use the simplest quoting being able to handle the recipient sub sanitize_address { @@ -627,13 +657,12 @@ sub sanitize_address # rfc2047 is needed if a non-ascii char is included if ($recipient_name =~ /[^[:ascii:]]/) { - $recipient_name =~ s/([^-a-zA-Z0-9!*+\/])/sprintf("=%02X", ord($1))/eg; - $recipient_name =~ s/(.*)/=\?utf-8\?q\?$1\?=/; + $recipient_name = quote_rfc2047($recipient_name); } # double quotes are needed if specials or CTLs are included elsif ($recipient_name =~ /[][()<>@,;:\\".\000-\037\177]/) { - $recipient_name =~ s/(["\\\r])/\\$1/; + $recipient_name =~ s/(["\\\r])/\\$1/g; $recipient_name = "\"$recipient_name\""; } @@ -956,3 +985,13 @@ sub validate_patch { } return undef; } + +sub file_has_nonascii { + my $fn = shift; + open(my $fh, '<', $fn) + or die "unable to open $fn: $!\n"; + while (my $line = <$fh>) { + return 1 if $line =~ /[^[:ascii:]]/; + } + return 0; +} diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index c0973b4e6e..a4bcd282b6 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -166,4 +166,63 @@ test_expect_success 'second message is patch' ' grep "Subject:.*Second" msgtxt2 ' +test_expect_success '--compose adds MIME for utf8 body' ' + clean_fake_sendmail && + (echo "#!/bin/sh" && + echo "echo utf8 body: àéìöú >>\$1" + ) >fake-editor-utf8 && + chmod +x fake-editor-utf8 && + echo y | \ + GIT_EDITOR=$(pwd)/fake-editor-utf8 \ + GIT_SEND_EMAIL_NOTTY=1 \ + git send-email \ + --compose --subject foo \ + --from="Example <nobody@example.com>" \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches && + grep "^utf8 body" msgtxt1 && + grep "^Content-Type: text/plain; charset=utf-8" msgtxt1 +' + +test_expect_success '--compose respects user mime type' ' + clean_fake_sendmail && + (echo "#!/bin/sh" && + echo "(echo MIME-Version: 1.0" + echo " echo Content-Type: text/plain\\; charset=iso-8859-1" + echo " echo Content-Transfer-Encoding: 8bit" + echo " echo Subject: foo" + echo " echo " + echo " echo utf8 body: àéìöú) >\$1" + ) >fake-editor-utf8-mime && + chmod +x fake-editor-utf8-mime && + echo y | \ + GIT_EDITOR=$(pwd)/fake-editor-utf8-mime \ + GIT_SEND_EMAIL_NOTTY=1 \ + git send-email \ + --compose --subject foo \ + --from="Example <nobody@example.com>" \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches && + grep "^utf8 body" msgtxt1 && + grep "^Content-Type: text/plain; charset=iso-8859-1" msgtxt1 && + ! grep "^Content-Type: text/plain; charset=utf-8" msgtxt1 +' + +test_expect_success '--compose adds MIME for utf8 subject' ' + clean_fake_sendmail && + echo y | \ + GIT_EDITOR=$(pwd)/fake-editor \ + GIT_SEND_EMAIL_NOTTY=1 \ + git send-email \ + --compose --subject utf8-sübjëct \ + --from="Example <nobody@example.com>" \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches && + grep "^fake edit" msgtxt1 && + grep "^Subject: =?utf-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1 +' + test_done diff --git a/wt-status.h b/wt-status.h index 02afaa60ee..7d61410b17 100644 --- a/wt-status.h +++ b/wt-status.h @@ -28,8 +28,8 @@ struct wt_status { }; int git_status_config(const char *var, const char *value); -int wt_status_use_color; -int wt_status_relative_paths; +extern int wt_status_use_color; +extern int wt_status_relative_paths; void wt_status_prepare(struct wt_status *s); void wt_status_print(struct wt_status *s); |