aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-05-03 23:26:54 -0700
committerJunio C Hamano <junkio@cox.net>2007-05-03 23:26:54 -0700
commit9aae177a4adff326421e55c7c0f3138de15ce2c1 (patch)
treeca19b08ff373ea122f87c90d03d111b03a89921e
parent50acc58914bf02217e55fdd739a844f2bfc45410 (diff)
parente3ad95a8be82663d27cb501eaf9bad86a30f9cda (diff)
downloadgit-9aae177a4adff326421e55c7c0f3138de15ce2c1.tar.gz
git-9aae177a4adff326421e55c7c0f3138de15ce2c1.tar.xz
Merge branch 'maint'
* maint: gitweb: use decode_utf8 directly posix compatibility for t4200 Document 'opendiff' value in config.txt and git-mergetool.txt Allow PERL_PATH="/usr/bin/env perl" Make xstrndup common diff.c: fix "size cache" handling. http-fetch: Disable use of curl multi support for libcurl < 7.16.
-rw-r--r--Documentation/config.txt2
-rw-r--r--Documentation/git-mergetool.txt2
-rw-r--r--commit.c8
-rw-r--r--diff.c13
-rw-r--r--git-compat-util.h13
-rwxr-xr-xgitweb/gitweb.perl26
-rw-r--r--http.h2
-rw-r--r--perl/Makefile2
-rwxr-xr-xt/t4200-rerere.sh2
9 files changed, 35 insertions, 35 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index c257cdf52..24f9655fe 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 34288fe08..add01e855 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -25,7 +25,7 @@ OPTIONS
-t or --tool=<tool>::
Use the merge resolution program specified by <tool>.
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 f1ba972d9..aa7059c1c 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 9dfded766..7bbe7590b 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 2c84016ac..c08688c8f 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 cbd8d03e6..ba5cc43e5 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 @@ sub esc_html ($;%) {
my $str = shift;
my %opts = @_;
- $str = to_utf8($str);
+ $str = decode_utf8($str);
$str = $cgi->escapeHTML($str);
if ($opts{'-nbsp'}) {
$str =~ s/ /&nbsp;/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/ /&nbsp;/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 "<div class=\"page_path\">";
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 324fcf4f5..69b6b667d 100644
--- a/http.h
+++ b/http.h
@@ -6,7 +6,7 @@
#include <curl/curl.h>
#include <curl/easy.h>
-#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 17d004e5a..0d695fd2f 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 6ba63d717..c64ebbb2e 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"