diff --git a/Documentation/config.txt b/Documentation/config.txt index c257cdf525..24f9655fef 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -520,7 +520,7 @@ merge.summary:: merge.tool:: Controls which merge resolution program is used by gitlink:git-mergetool[l]. Valid values are: "kdiff3", "tkdiff", - "meld", "xxdiff", "emerge", "vimdiff" + "meld", "xxdiff", "emerge", "vimdiff", and "opendiff" merge.verbosity:: Controls the amount of output shown by the recursive merge diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt index 34288fe08b..add01e855a 100644 --- a/Documentation/git-mergetool.txt +++ b/Documentation/git-mergetool.txt @@ -25,7 +25,7 @@ OPTIONS -t or --tool=:: Use the merge resolution program specified by . Valid merge tools are: - kdiff3, tkdiff, meld, xxdiff, emerge, and vimdiff. + kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff + If a merge resolution program is not specified, 'git mergetool' will use the configuration variable merge.tool. If the diff --git a/commit.c b/commit.c index f1ba972d9a..aa7059c1c6 100644 --- a/commit.c +++ b/commit.c @@ -718,14 +718,6 @@ static char *logmsg_reencode(const struct commit *commit, return out; } -static char *xstrndup(const char *text, int len) -{ - char *result = xmalloc(len + 1); - memcpy(result, text, len); - result[len] = '\0'; - return result; -} - static void fill_person(struct interp *table, const char *msg, int len) { int start, end, tz = 0; diff --git a/diff.c b/diff.c index 9dfded7664..7bbe7590b2 100644 --- a/diff.c +++ b/diff.c @@ -1572,14 +1572,15 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only) enum object_type type; struct sha1_size_cache *e; + if (size_only && use_size_cache && + (e = locate_size_cache(s->sha1, 1, 0)) != NULL) { + s->size = e->size; + return 0; + } + if (size_only) { - e = locate_size_cache(s->sha1, 1, 0); - if (e) { - s->size = e->size; - return 0; - } type = sha1_object_info(s->sha1, &s->size); - if (type < 0) + if (use_size_cache && 0 < type) locate_size_cache(s->sha1, 0, s->size); } else { diff --git a/git-compat-util.h b/git-compat-util.h index 2c84016ac9..c08688c8f3 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -197,6 +197,19 @@ static inline void *xmalloc(size_t size) return ret; } +static inline char *xstrndup(const char *str, size_t len) +{ + char *p; + + p = memchr(str, '\0', len); + if (p) + len = p - str; + p = xmalloc(len + 1); + memcpy(p, str, len); + p[len] = '\0'; + return p; +} + static inline void *xrealloc(void *ptr, size_t size) { void *ret = realloc(ptr, size); diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index cbd8d03e64..ba5cc43e5b 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -564,12 +564,6 @@ sub validate_refname { return $input; } -# very thin wrapper for decode("utf8", $str, Encode::FB_DEFAULT); -sub to_utf8 { - my $str = shift; - return decode("utf8", $str, Encode::FB_DEFAULT); -} - # quote unsafe chars, but keep the slash, even when it's not # correct, but quoted slashes look too horrible in bookmarks sub esc_param { @@ -594,7 +588,7 @@ ($;%) my $str = shift; my %opts = @_; - $str = to_utf8($str); + $str = decode_utf8($str); $str = $cgi->escapeHTML($str); if ($opts{'-nbsp'}) { $str =~ s/ / /g; @@ -608,7 +602,7 @@ sub esc_path { my $str = shift; my %opts = @_; - $str = to_utf8($str); + $str = decode_utf8($str); $str = $cgi->escapeHTML($str); if ($opts{'-nbsp'}) { $str =~ s/ / /g; @@ -891,7 +885,7 @@ sub format_subject_html { if (length($short) < length($long)) { return $cgi->a({-href => $href, -class => "list subject", - -title => to_utf8($long)}, + -title => decode_utf8($long)}, esc_html($short) . $extra); } else { return $cgi->a({-href => $href, -class => "list subject"}, @@ -1126,7 +1120,7 @@ sub git_get_projects_list { if (check_export_ok("$projectroot/$path")) { my $pr = { path => $path, - owner => to_utf8($owner), + owner => decode_utf8($owner), }; push @list, $pr; (my $forks_path = $path) =~ s/\.git$//; @@ -1156,7 +1150,7 @@ sub git_get_project_owner { $pr = unescape($pr); $ow = unescape($ow); if ($pr eq $project) { - $owner = to_utf8($ow); + $owner = decode_utf8($ow); last; } } @@ -1630,7 +1624,7 @@ sub get_file_owner { } my $owner = $gcos; $owner =~ s/[,;].*$//; - return to_utf8($owner); + return decode_utf8($owner); } ## ...................................................................... @@ -1713,7 +1707,7 @@ sub git_header_html { my $title = "$site_name"; if (defined $project) { - $title .= " - " . to_utf8($project); + $title .= " - " . decode_utf8($project); if (defined $action) { $title .= "/$action"; if (defined $file_name) { @@ -1986,7 +1980,7 @@ sub git_print_page_path { print "
"; print $cgi->a({-href => href(action=>"tree", hash_base=>$hb), - -title => 'tree root'}, to_utf8("[$project]")); + -title => 'tree root'}, decode_utf8("[$project]")); print " / "; if (defined $name) { my @dirname = split '/', $name; @@ -2604,7 +2598,7 @@ sub git_project_list_body { ($pr->{'age'}, $pr->{'age_string'}) = @aa; if (!defined $pr->{'descr'}) { my $descr = git_get_project_description($pr->{'path'}) || ""; - $pr->{'descr_long'} = to_utf8($descr); + $pr->{'descr_long'} = decode_utf8($descr); $pr->{'descr'} = chop_str($descr, 25, 5); } if (!defined $pr->{'owner'}) { @@ -3636,7 +3630,7 @@ sub git_snapshot { $hash = git_get_head_hash($project); } - my $filename = to_utf8(basename($project)) . "-$hash.tar.$suffix"; + my $filename = decode_utf8(basename($project)) . "-$hash.tar.$suffix"; print $cgi->header( -type => "application/$ctype", diff --git a/http.h b/http.h index 324fcf4f54..69b6b667d9 100644 --- a/http.h +++ b/http.h @@ -6,7 +6,7 @@ #include #include -#if LIBCURL_VERSION_NUM >= 0x070908 +#if LIBCURL_VERSION_NUM >= 0x071000 #define USE_CURL_MULTI #define DEFAULT_MAX_REQUESTS 5 #endif diff --git a/perl/Makefile b/perl/Makefile index 17d004e5a0..0d695fd2f3 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -33,7 +33,7 @@ $(makfile): ../GIT-CFLAGS Makefile echo ' echo $(instdir_SQ)' >> $@ else $(makfile): Makefile.PL ../GIT-CFLAGS - '$(PERL_PATH_SQ)' $< PREFIX='$(prefix_SQ)' + $(PERL_PATH) $< PREFIX='$(prefix_SQ)' endif # this is just added comfort for calling make directly in perl dir diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index 6ba63d7173..c64ebbb2e9 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -44,7 +44,7 @@ mkdir .git/rr-cache test_expect_failure 'conflicting merge' 'git pull . first' -sha1=$(sed -e 's/\t.*//' .git/rr-cache/MERGE_RR) +sha1=$(sed -e 's/ .*//' .git/rr-cache/MERGE_RR) rr=.git/rr-cache/$sha1 test_expect_success 'recorded preimage' "grep ======= $rr/preimage"