* [PATCH 3/5] gitweb: Add treediff view
From: Martin Koegler @ 2007-09-02 14:46 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Martin Koegler
In-Reply-To: <11887443693783-git-send-email-mkoegler@auto.tuwien.ac.at>
git_treediff supports comparing different trees. A tree can be specified
either as hash or as base hash and filename.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
gitweb/gitweb.perl | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 5f67d73..4081f51 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -549,6 +549,8 @@ my %actions = (
"tag" => \&git_tag,
"tags" => \&git_tags,
"tree" => \&git_tree,
+ "treediff" => \&git_treediff,
+ "treediff_plain" => \&git_treediff_plain,
"snapshot" => \&git_snapshot,
"object" => \&git_object,
# those below don't need $project
@@ -4962,6 +4964,120 @@ sub git_commitdiff_plain {
git_commitdiff('plain');
}
+sub git_treediff {
+ my $format = shift || 'html';
+ my $expires = '+1d';
+
+ # non-textual hash id's can be cached
+ if (defined $hash && $hash !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ } elsif (defined $hash_parent && $hash_parent !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ } elsif (defined $hash_base && $hash_base !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ } elsif (defined $hash_parent_base && $hash_parent_base !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ }
+
+ # we need to prepare $formats_nav before any parameter munging
+ my $formats_nav;
+ if ($format eq 'html') {
+ $formats_nav =
+ $cgi->a({-href => href(action=>"treediff_plain",
+ hash=>$hash, hash_parent=>$hash_parent,
+ hash_base=>$hash_base, hash_parent_base=>$hash_parent_base,
+ file_name=>$file_name, file_parent=>$file_parent)},
+ "raw");
+ }
+
+ if (!defined $hash) {
+ if (!defined $hash_base) {
+ die_error(undef,'tree parameter missing');
+ }
+ $hash = $hash_base;
+ $hash .= ":".$file_name if (defined $file_name);
+ }
+
+ if (!defined $hash_parent) {
+ if (!defined $hash_parent_base) {
+ die_error(undef,'tree parameter missing');
+ }
+ $hash_parent = $hash_parent_base;
+ $hash_parent .= ":".$file_parent if (defined $file_parent);
+ }
+
+ # read treediff
+ my $fd;
+ my @difftree;
+ if ($format eq 'html') {
+ open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
+ "--no-commit-id", "--patch-with-raw", "--full-index",
+ $hash_parent, $hash, "--"
+ or die_error(undef, "Open git-diff-tree failed");
+
+ while (my $line = <$fd>) {
+ chomp $line;
+ # empty line ends raw part of diff-tree output
+ last unless $line;
+ push @difftree, $line;
+ }
+
+ } elsif ($format eq 'plain') {
+ open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
+ '-p', $hash_parent, $hash, "--"
+ or die_error(undef, "Open git-diff-tree failed");
+
+ } else {
+ die_error(undef, "Unknown treediff format");
+ }
+
+ # write header
+ if ($format eq 'html') {
+ git_header_html(undef, $expires);
+ if (defined $hash_base && (my %co = parse_commit($hash_base))) {
+ git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
+ git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
+ } else {
+ print "<div class=\"page_nav\"><br/>$formats_nav<br/></div>\n";
+ print "<div class=\"title\">$hash vs $hash_parent</div>\n";
+ }
+ print "<div class=\"page_body\">\n";
+
+ } elsif ($format eq 'plain') {
+ my $filename = basename($project) . "-$hash-$hash_parent.patch";
+
+ print $cgi->header(
+ -type => 'text/plain',
+ -charset => 'utf-8',
+ -expires => $expires,
+ -content_disposition => 'inline; filename="' . "$filename" . '"');
+
+ print "X-Git-Url: " . $cgi->self_url() . "\n\n";
+ print "---\n\n";
+ }
+
+ # write patch
+ if ($format eq 'html') {
+ git_difftree_body(\@difftree, $file_parent, $file_name, $hash_base, $hash_parent_base);
+ print "<br/>\n";
+
+ git_patchset_body($fd, \@difftree, $file_parent, $file_name, $hash_base, $hash_parent_base);
+ close $fd;
+ print "</div>\n"; # class="page_body"
+ git_footer_html();
+
+ } elsif ($format eq 'plain') {
+ local $/ = undef;
+ print <$fd>;
+ close $fd
+ or print "Reading git-diff-tree failed\n";
+ }
+}
+
+sub git_treediff_plain {
+ git_treediff('plain');
+}
+
sub git_history {
if (!defined $hash_base) {
$hash_base = git_get_head_hash($project);
--
1.5.3.rc7.849.g2f5f
^ permalink raw reply related
* [PATCH 5/5] Show Difflinks in an other color
From: Martin Koegler @ 2007-09-02 14:46 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Martin Koegler
In-Reply-To: <11887443693825-git-send-email-mkoegler@auto.tuwien.ac.at>
Suggested by Petr Baudis
The style for the links was randomly selected.
No sign-off, as somebody else should select a suiteable style.
---
gitweb/gitweb.css | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 1b88879..ac15c0e 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -499,3 +499,7 @@ span.match {
div.binary {
font-style: italic;
}
+
+span.difflinks a {
+ color: #ff0000;
+}
--
1.5.3.rc7.849.g2f5f
^ permalink raw reply related
* [PATCH 1/5] gitweb: Support comparing blobs with different names
From: Martin Koegler @ 2007-09-02 14:46 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Martin Koegler
In-Reply-To: <11887443682216-git-send-email-mkoegler@auto.tuwien.ac.at>
Currently, blobdiff can only compare blobs with different file
names, if no hb/hpb parameters are present.
This patch adds support for comparing two blobs specified by any
combination of hb/f/h and hpb/fp/hp.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
gitweb/gitweb.perl | 148 +++++++++++++++++++---------------------------------
1 files changed, 53 insertions(+), 95 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b2bae1b..05bfb26 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4645,109 +4645,66 @@ sub git_blobdiff {
my $fd;
my @difftree;
my %diffinfo;
- my $expires;
-
- # preparing $fd and %diffinfo for git_patchset_body
- # new style URI
- if (defined $hash_base && defined $hash_parent_base) {
- if (defined $file_name) {
- # read raw output
- open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
- $hash_parent_base, $hash_base,
- "--", (defined $file_parent ? $file_parent : ()), $file_name
- or die_error(undef, "Open git-diff-tree failed");
- @difftree = map { chomp; $_ } <$fd>;
- close $fd
- or die_error(undef, "Reading git-diff-tree failed");
- @difftree
- or die_error('404 Not Found', "Blob diff not found");
-
- } elsif (defined $hash &&
- $hash =~ /[0-9a-fA-F]{40}/) {
- # try to find filename from $hash
-
- # read filtered raw output
- open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
- $hash_parent_base, $hash_base, "--"
- or die_error(undef, "Open git-diff-tree failed");
- @difftree =
- # ':100644 100644 03b21826... 3b93d5e7... M ls-files.c'
- # $hash == to_id
- grep { /^:[0-7]{6} [0-7]{6} [0-9a-fA-F]{40} $hash/ }
- map { chomp; $_ } <$fd>;
- close $fd
- or die_error(undef, "Reading git-diff-tree failed");
- @difftree
- or die_error('404 Not Found', "Blob diff not found");
+ my $expires = '+1d';
+ my ($from, $to);
- } else {
- die_error('404 Not Found', "Missing one of the blob diff parameters");
- }
-
- if (@difftree > 1) {
- die_error('404 Not Found', "Ambiguous blob diff specification");
- }
+ $file_parent ||= $file_name;
- %diffinfo = parse_difftree_raw_line($difftree[0]);
- $file_parent ||= $diffinfo{'from_file'} || $file_name || $diffinfo{'file'};
- $file_name ||= $diffinfo{'to_file'} || $diffinfo{'file'};
-
- $hash_parent ||= $diffinfo{'from_id'};
- $hash ||= $diffinfo{'to_id'};
-
- # non-textual hash id's can be cached
- if ($hash_base =~ m/^[0-9a-fA-F]{40}$/ &&
- $hash_parent_base =~ m/^[0-9a-fA-F]{40}$/) {
- $expires = '+1d';
- }
+ # non-textual hash id's can be cached
+ if (defined $hash && $hash !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ } elsif (defined $hash_parent && $hash_parent !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ } elsif (defined $hash_base && $hash_base !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ } elsif (defined $hash_parent_base && $hash_parent_base !~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = undef;
+ }
+
+ # if hash parameter is missing, read it from the commit.
+ if (defined $hash_base && defined $file_name && !defined $hash) {
+ $hash = git_get_hash_by_path($hash_base, $file_name);
+ }
- # open patch output
- open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
- '-p', ($format eq 'html' ? "--full-index" : ()),
- $hash_parent_base, $hash_base,
- "--", (defined $file_parent ? $file_parent : ()), $file_name
- or die_error(undef, "Open git-diff-tree failed");
+ if (defined $hash_parent_base && defined $file_parent && !defined $hash_parent) {
+ $hash_parent = git_get_hash_by_path($hash_parent_base, $file_parent);
+ }
+
+ if (!defined $hash || ! defined $hash_parent) {
+ die_error('404 Not Found', "Missing one of the blob diff parameters");
}
- # old/legacy style URI
- if (!%diffinfo && # if new style URI failed
- defined $hash && defined $hash_parent) {
- # fake git-diff-tree raw output
- $diffinfo{'from_mode'} = $diffinfo{'to_mode'} = "blob";
- $diffinfo{'from_id'} = $hash_parent;
- $diffinfo{'to_id'} = $hash;
- if (defined $file_name) {
- if (defined $file_parent) {
- $diffinfo{'status'} = '2';
- $diffinfo{'from_file'} = $file_parent;
- $diffinfo{'to_file'} = $file_name;
- } else { # assume not renamed
- $diffinfo{'status'} = '1';
- $diffinfo{'from_file'} = $file_name;
- $diffinfo{'to_file'} = $file_name;
- }
- } else { # no filename given
- $diffinfo{'status'} = '2';
- $diffinfo{'from_file'} = $hash_parent;
- $diffinfo{'to_file'} = $hash;
- }
+ if (defined $hash_base && defined $file_name) {
+ $to = $hash_base . ':' . $file_name;
+ } else {
+ $to = $hash;
+ }
- # non-textual hash id's can be cached
- if ($hash =~ m/^[0-9a-fA-F]{40}$/ &&
- $hash_parent =~ m/^[0-9a-fA-F]{40}$/) {
- $expires = '+1d';
- }
+ if (defined $hash_parent_base && defined $file_parent) {
+ $from = $hash_parent_base . ':' . $file_parent;
+ } else {
+ $from = $hash_parent;
+ }
- # open patch output
- open $fd, "-|", git_cmd(), "diff", @diff_opts,
- '-p', ($format eq 'html' ? "--full-index" : ()),
- $hash_parent, $hash, "--"
- or die_error(undef, "Open git-diff failed");
- } else {
- die_error('404 Not Found', "Missing one of the blob diff parameters")
- unless %diffinfo;
+ # fake git-diff-tree raw output
+ $diffinfo{'from_mode'} = $diffinfo{'to_mode'} = "blob";
+ $diffinfo{'from_id'} = $hash_parent;
+ $diffinfo{'to_id'} = $hash;
+ if (defined $file_name) {
+ $diffinfo{'status'} = '2';
+ $diffinfo{'from_file'} = $file_parent;
+ $diffinfo{'to_file'} = $file_name;
+ } else { # no filename given
+ $diffinfo{'status'} = '2';
+ $diffinfo{'from_file'} = $hash_parent;
+ $diffinfo{'to_file'} = $hash;
}
+ # open patch output
+ open $fd, "-|", git_cmd(), "diff", @diff_opts, '-p', "--full-index",
+ ($format eq 'html' ? "--raw" : ()), $from, $to, "--"
+ or die_error(undef, "Open git-diff failed");
+
# header
if ($format eq 'html') {
my $formats_nav =
@@ -4771,11 +4728,12 @@ sub git_blobdiff {
}
} elsif ($format eq 'plain') {
+ my $patch_file_name = $file_name || $hash;
print $cgi->header(
-type => 'text/plain',
-charset => 'utf-8',
-expires => $expires,
- -content_disposition => 'inline; filename="' . "$file_name" . '.patch"');
+ -content_disposition => 'inline; filename="' . "$patch_file_name" . '.patch"');
print "X-Git-Url: " . $cgi->self_url() . "\n\n";
--
1.5.3.rc7.849.g2f5f
^ permalink raw reply related
* [PATCH 2/5] gitweb: support filename prefix in git_patchset_body/git_difftree_body
From: Martin Koegler @ 2007-09-02 14:46 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Martin Koegler
In-Reply-To: <11887443692839-git-send-email-mkoegler@auto.tuwien.ac.at>
git_treediff supports comparing subdirectories. As the output of
git-difftree is missing the path to the compared directories,
the links in the output would be wrong.
The patch adds two new parameters to add the missing path prefix.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
gitweb/gitweb.perl | 88 +++++++++++++++++++++++++++++----------------------
1 files changed, 50 insertions(+), 38 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 05bfb26..5f67d73 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1173,10 +1173,10 @@ sub format_diff_from_to_header {
$cgi->a({-href=>href(action=>"blobdiff",
hash_parent=>$diffinfo->{'from_id'}[$i],
hash_parent_base=>$parents[$i],
- file_parent=>$from->{'file'}[$i],
+ file_parent=>$diffinfo->{'from_prefix'}.$from->{'file'}[$i],
hash=>$diffinfo->{'to_id'},
hash_base=>$hash,
- file_name=>$to->{'file'}),
+ file_name=>$diffinfo->{'to_prefix'}.$to->{'file'}),
-class=>"path",
-title=>"diff" . ($i+1)},
$i+1) .
@@ -1219,7 +1219,7 @@ sub format_diff_cc_simplified {
$result .= $cgi->a({-href => href(action=>"blob",
hash_base=>$hash,
hash=>$diffinfo->{'to_id'},
- file_name=>$diffinfo->{'to_file'}),
+ file_name=>$diffinfo->{'to_prefix'}.$diffinfo->{'to_file'}),
-class => "path"},
esc_path($diffinfo->{'to_file'}));
} else {
@@ -2027,7 +2027,7 @@ sub parse_from_to_diffinfo {
$from->{'href'}[$i] = href(action=>"blob",
hash_base=>$parents[$i],
hash=>$diffinfo->{'from_id'}[$i],
- file_name=>$from->{'file'}[$i]);
+ file_name=>$diffinfo->{'from_prefix'}.$from->{'file'}[$i]);
} else {
$from->{'href'}[$i] = undef;
}
@@ -2037,7 +2037,7 @@ sub parse_from_to_diffinfo {
if ($diffinfo->{'status'} ne "A") { # not new (added) file
$from->{'href'} = href(action=>"blob", hash_base=>$hash_parent,
hash=>$diffinfo->{'from_id'},
- file_name=>$from->{'file'});
+ file_name=>$diffinfo->{'from_prefix'}.$from->{'file'});
} else {
delete $from->{'href'};
}
@@ -2047,7 +2047,7 @@ sub parse_from_to_diffinfo {
if (!is_deleted($diffinfo)) { # file exists in result
$to->{'href'} = href(action=>"blob", hash_base=>$hash,
hash=>$diffinfo->{'to_id'},
- file_name=>$to->{'file'});
+ file_name=>$diffinfo->{'to_prefix'}.$to->{'file'});
} else {
delete $to->{'href'};
}
@@ -2795,9 +2795,13 @@ sub is_deleted {
}
sub git_difftree_body {
- my ($difftree, $hash, @parents) = @_;
+ my ($difftree, $from_prefix, $to_prefix, $hash, @parents) = @_;
my ($parent) = $parents[0];
my ($have_blame) = gitweb_check_feature('blame');
+
+ $from_prefix = !defined $from_prefix ? '' : $from_prefix.'/';
+ $to_prefix = !defined $to_prefix ? '' : $to_prefix . '/';
+
print "<div class=\"list_head\">\n";
if ($#{$difftree} > 10) {
print(($#{$difftree} + 1) . " files changed:\n");
@@ -2854,7 +2858,7 @@ sub git_difftree_body {
# file exists in the result (child) commit
print "<td>" .
$cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
- file_name=>$diff->{'to_file'},
+ file_name=>$to_prefix.$diff->{'to_file'},
hash_base=>$hash),
-class => "list"}, esc_path($diff->{'to_file'})) .
"</td>\n";
@@ -2891,7 +2895,7 @@ sub git_difftree_body {
$cgi->a({-href => href(action=>"blob",
hash_base=>$hash,
hash=>$from_hash,
- file_name=>$from_path)},
+ file_name=>$from_prefix.$from_path)},
"blob" . ($i+1)) .
" | </td>\n";
} else {
@@ -2905,8 +2909,8 @@ sub git_difftree_body {
hash_parent=>$from_hash,
hash_base=>$hash,
hash_parent_base=>$hash_parent,
- file_name=>$diff->{'to_file'},
- file_parent=>$from_path)},
+ file_name=>$to_prefix.$diff->{'to_file'},
+ file_parent=>$from_prefix.$from_path)},
"diff" . ($i+1)) .
" | </td>\n";
}
@@ -2916,14 +2920,14 @@ sub git_difftree_body {
if ($not_deleted) {
print $cgi->a({-href => href(action=>"blob",
hash=>$diff->{'to_id'},
- file_name=>$diff->{'to_file'},
+ file_name=>$to_prefix.$diff->{'to_file'},
hash_base=>$hash)},
"blob");
print " | " if ($has_history);
}
if ($has_history) {
print $cgi->a({-href => href(action=>"history",
- file_name=>$diff->{'to_file'},
+ file_name=>$to_prefix.$diff->{'to_file'},
hash_base=>$hash)},
"history");
}
@@ -2957,7 +2961,7 @@ sub git_difftree_body {
$mode_chng .= "]</span>";
print "<td>";
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
- hash_base=>$hash, file_name=>$diff->{'file'}),
+ hash_base=>$hash, file_name=>$to_prefix.$diff->{'file'}),
-class => "list"}, esc_path($diff->{'file'}));
print "</td>\n";
print "<td>$mode_chng</td>\n";
@@ -2969,7 +2973,7 @@ sub git_difftree_body {
print " | ";
}
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
- hash_base=>$hash, file_name=>$diff->{'file'})},
+ hash_base=>$hash, file_name=>$to_prefix.$diff->{'file'})},
"blob");
print "</td>\n";
@@ -2977,7 +2981,7 @@ sub git_difftree_body {
my $mode_chng = "<span class=\"file_status deleted\">[deleted $from_file_type]</span>";
print "<td>";
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'from_id'},
- hash_base=>$parent, file_name=>$diff->{'file'}),
+ hash_base=>$parent, file_name=>$from_prefix.$diff->{'file'}),
-class => "list"}, esc_path($diff->{'file'}));
print "</td>\n";
print "<td>$mode_chng</td>\n";
@@ -2989,15 +2993,15 @@ sub git_difftree_body {
print " | ";
}
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'from_id'},
- hash_base=>$parent, file_name=>$diff->{'file'})},
+ hash_base=>$parent, file_name=>$from_prefix.$diff->{'file'})},
"blob") . " | ";
if ($have_blame) {
print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
- file_name=>$diff->{'file'})},
+ file_name=>$from_prefix.$diff->{'file'})},
"blame") . " | ";
}
print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
- file_name=>$diff->{'file'})},
+ file_name=>$from_prefix.$diff->{'file'})},
"history");
print "</td>\n";
@@ -3019,7 +3023,7 @@ sub git_difftree_body {
}
print "<td>";
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
- hash_base=>$hash, file_name=>$diff->{'file'}),
+ hash_base=>$hash, file_name=>$to_prefix.$diff->{'file'}),
-class => "list"}, esc_path($diff->{'file'}));
print "</td>\n";
print "<td>$mode_chnge</td>\n";
@@ -3034,20 +3038,21 @@ sub git_difftree_body {
print $cgi->a({-href => href(action=>"blobdiff",
hash=>$diff->{'to_id'}, hash_parent=>$diff->{'from_id'},
hash_base=>$hash, hash_parent_base=>$parent,
- file_name=>$diff->{'file'})},
+ file_name=>$to_prefix.$diff->{'file'},
+ file_parent=>$from_prefix.$diff->{'file'})},
"diff") .
" | ";
}
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
- hash_base=>$hash, file_name=>$diff->{'file'})},
+ hash_base=>$hash, file_name=>$to_prefix.$diff->{'file'})},
"blob") . " | ";
if ($have_blame) {
print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
- file_name=>$diff->{'file'})},
+ file_name=>$to_prefix.$diff->{'file'})},
"blame") . " | ";
}
print $cgi->a({-href => href(action=>"history", hash_base=>$hash,
- file_name=>$diff->{'file'})},
+ file_name=>$to_prefix.$diff->{'file'})},
"history");
print "</td>\n";
@@ -3061,11 +3066,11 @@ sub git_difftree_body {
}
print "<td>" .
$cgi->a({-href => href(action=>"blob", hash_base=>$hash,
- hash=>$diff->{'to_id'}, file_name=>$diff->{'to_file'}),
+ hash=>$diff->{'to_id'}, file_name=>$to_prefix.$diff->{'to_file'}),
-class => "list"}, esc_path($diff->{'to_file'})) . "</td>\n" .
"<td><span class=\"file_status $nstatus\">[$nstatus from " .
$cgi->a({-href => href(action=>"blob", hash_base=>$parent,
- hash=>$diff->{'from_id'}, file_name=>$diff->{'from_file'}),
+ hash=>$diff->{'from_id'}, file_name=>$from_prefix.$diff->{'from_file'}),
-class => "list"}, esc_path($diff->{'from_file'})) .
" with " . (int $diff->{'similarity'}) . "% similarity$mode_chng]</span></td>\n" .
"<td class=\"link\">";
@@ -3079,20 +3084,20 @@ sub git_difftree_body {
print $cgi->a({-href => href(action=>"blobdiff",
hash=>$diff->{'to_id'}, hash_parent=>$diff->{'from_id'},
hash_base=>$hash, hash_parent_base=>$parent,
- file_name=>$diff->{'to_file'}, file_parent=>$diff->{'from_file'})},
+ file_name=>$to_prefix.$diff->{'to_file'}, file_parent=>$from_prefix.$diff->{'from_file'})},
"diff") .
" | ";
}
print $cgi->a({-href => href(action=>"blob", hash=>$diff->{'to_id'},
- hash_base=>$parent, file_name=>$diff->{'to_file'})},
+ hash_base=>$parent, file_name=>$to_prefix.$diff->{'to_file'})},
"blob") . " | ";
if ($have_blame) {
print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
- file_name=>$diff->{'to_file'})},
+ file_name=>$to_prefix.$diff->{'to_file'})},
"blame") . " | ";
}
print $cgi->a({-href => href(action=>"history", hash_base=>$hash,
- file_name=>$diff->{'to_file'})},
+ file_name=>$to_prefix.$diff->{'to_file'})},
"history");
print "</td>\n";
@@ -3104,7 +3109,7 @@ sub git_difftree_body {
}
sub git_patchset_body {
- my ($fd, $difftree, $hash, @hash_parents) = @_;
+ my ($fd, $difftree, $from_prefix, $to_prefix, $hash, @hash_parents) = @_;
my ($hash_parent) = $hash_parents[0];
my $patch_idx = 0;
@@ -3113,6 +3118,9 @@ sub git_patchset_body {
my $diffinfo;
my (%from, %to);
+ $from_prefix = !defined $from_prefix ? '' : $from_prefix.'/';
+ $to_prefix = !defined $to_prefix ? '' : $to_prefix . '/';
+
print "<div class=\"patchset\">\n";
# skip to first patch
@@ -3160,6 +3168,8 @@ sub git_patchset_body {
$diffinfo->{'to_id'} eq $to_id) {
# this is continuation of a split patch
print "<div class=\"patch cont\">\n";
+ $diffinfo->{'from_prefix'} = $from_prefix;
+ $diffinfo->{'to_prefix'} = $to_prefix;
} else {
# advance raw git-diff output if needed
$patch_idx++ if defined $diffinfo;
@@ -3191,6 +3201,8 @@ sub git_patchset_body {
}
} until (!defined $to_name || $to_name eq $diffinfo->{'to_file'} ||
$patch_idx > $#$difftree);
+ $diffinfo->{'from_prefix'} = $from_prefix;
+ $diffinfo->{'to_prefix'} = $to_prefix;
# modifies %from, %to hashes
parse_from_to_diffinfo($diffinfo, \%from, \%to, @hash_parents);
if ($diffinfo->{'nparents'}) {
@@ -3205,7 +3217,7 @@ sub git_patchset_body {
$from{'href'}[$i] = href(action=>"blob",
hash_base=>$hash_parents[$i],
hash=>$diffinfo->{'from_id'}[$i],
- file_name=>$from{'file'}[$i]);
+ file_name=>$from_prefix.$from{'file'}[$i]);
} else {
$from{'href'}[$i] = undef;
}
@@ -3215,7 +3227,7 @@ sub git_patchset_body {
if ($diffinfo->{'status'} ne "A") { # not new (added) file
$from{'href'} = href(action=>"blob", hash_base=>$hash_parent,
hash=>$diffinfo->{'from_id'},
- file_name=>$from{'file'});
+ file_name=>$from_prefix.$from{'file'});
} else {
delete $from{'href'};
}
@@ -3225,7 +3237,7 @@ sub git_patchset_body {
if (!is_deleted($diffinfo)) { # file exists in result
$to{'href'} = href(action=>"blob", hash_base=>$hash,
hash=>$diffinfo->{'to_id'},
- file_name=>$to{'file'});
+ file_name=>$to_prefix.$to{'file'});
} else {
delete $to{'href'};
}
@@ -4587,7 +4599,7 @@ sub git_commit {
git_print_log($co{'comment'});
print "</div>\n";
- git_difftree_body(\@difftree, $hash, @$parents);
+ git_difftree_body(\@difftree, undef, undef, $hash, @$parents);
git_footer_html();
}
@@ -4745,7 +4757,7 @@ sub git_blobdiff {
if ($format eq 'html') {
print "<div class=\"page_body\">\n";
- git_patchset_body($fd, [ \%diffinfo ], $hash_base, $hash_parent_base);
+ git_patchset_body($fd, [ \%diffinfo ], undef, undef, $hash_base, $hash_parent_base);
close $fd;
print "</div>\n"; # class="page_body"
@@ -4928,11 +4940,11 @@ TEXT
if ($format eq 'html') {
my $use_parents = !defined $hash_parent ||
$hash_parent eq '-c' || $hash_parent eq '--cc';
- git_difftree_body(\@difftree, $hash,
+ git_difftree_body(\@difftree, undef, undef, $hash,
$use_parents ? @{$co{'parents'}} : $hash_parent);
print "<br/>\n";
- git_patchset_body($fd, \@difftree, $hash,
+ git_patchset_body($fd, \@difftree, undef, undef, $hash,
$use_parents ? @{$co{'parents'}} : $hash_parent);
close $fd;
print "</div>\n"; # class="page_body"
--
1.5.3.rc7.849.g2f5f
^ permalink raw reply related
* [PATCH 4/5] gitweb: Selecting diffs in JavaScript
From: Martin Koegler @ 2007-09-02 14:46 UTC (permalink / raw)
To: Petr Baudis; +Cc: git, Martin Koegler
In-Reply-To: <11887443693173-git-send-email-mkoegler@auto.tuwien.ac.at>
The adds support for selecting arbitrary diffs, if the client browser supports
JavaScript.
It is no possible to hide/show all diff links.
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
Makefile | 6 +-
git-instaweb.sh | 7 +
gitweb/gitweb.js | 360 ++++++++++++++++++++++++++++++++++++++++++++++++++++
gitweb/gitweb.perl | 11 ++
4 files changed, 383 insertions(+), 1 deletions(-)
create mode 100644 gitweb/gitweb.js
diff --git a/Makefile b/Makefile
index 2decdfb..1582dfa 100644
--- a/Makefile
+++ b/Makefile
@@ -168,6 +168,7 @@ GITWEB_HOMETEXT = indextext.html
GITWEB_CSS = gitweb.css
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
+GITWEB_JS = gitweb.js
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =
@@ -817,13 +818,14 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
-e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
-e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
-e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
+ -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
-e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
-e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
$< >$@+ && \
chmod +x $@+ && \
mv $@+ $@
-git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
+git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@ -832,6 +834,8 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
+ -e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
+ -e '/@@GITWEB_JS@@/d' \
$@.sh > $@+ && \
chmod +x $@+ && \
mv $@+ $@
diff --git a/git-instaweb.sh b/git-instaweb.sh
index b79c6b6..960486e 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -227,8 +227,15 @@ gitweb_css () {
EOFGITWEB
}
+gitweb_js () {
+ cat > "$1" <<\EOFGITWEB
+@@GITWEB_JS@@
+EOFGITWEB
+}
+
gitweb_cgi $GIT_DIR/gitweb/gitweb.cgi
gitweb_css $GIT_DIR/gitweb/gitweb.css
+gitweb_js $GIT_DIR/gitweb/gitweb.js
case "$httpd" in
*lighttpd*)
diff --git a/gitweb/gitweb.js b/gitweb/gitweb.js
new file mode 100644
index 0000000..fd4178a
--- /dev/null
+++ b/gitweb/gitweb.js
@@ -0,0 +1,360 @@
+/* Javascript functions for gitweb
+
+ (C) 2007 Martin Koegler <mkoegler@auto.tuwien.ac.at>
+
+ This file is licensed under the GPL v2, or (at your option) any later version.
+*/
+
+function getCookie (name)
+{
+ var name = name + "=";
+ var c = document.cookie;
+ var p = c.indexOf (name);
+ if (p == -1)
+ return null;
+ c = c.substr (p + name.length, c.length);
+ p = c.indexOf (";");
+ if (p == -1)
+ return c;
+ else
+ return c.substr (0, p);
+}
+
+function insertAfter (elem, node)
+{
+ if (node.nextSibling)
+ node.parentNode.insertBefore (elem, node.nextSibling);
+ else
+ node.parentNode.appendChild (elem);
+}
+
+function createLink (href, linktext)
+{
+ var l = document.createElement ("a");
+ l.appendChild (document.createTextNode (linktext));
+ l.href = href;
+ return l;
+}
+
+function createLinkGroup (href1, basetxt, href2, difftxt)
+{
+ var l = document.createElement ("span");
+ l.className = 'difflinks';
+ l.appendChild (document.createTextNode (" ("));
+ l.appendChild (createLink (href1, basetxt));
+ l.appendChild (document.createTextNode (" | "));
+ l.appendChild (createLink (href2, difftxt));
+ l.appendChild (document.createTextNode (") "));
+ return l;
+}
+
+function GitRef ()
+{
+ this.t = null;
+ this.h = null;
+ this.hb = null;
+ this.f = null;
+ this.p = null;
+ this.ToRef = ToRef;
+}
+
+function ToRef ()
+{
+ var parts = new Array ();
+ if (this.f)
+ parts.push ("f=" + this.f);
+ if (this.h)
+ parts.push ("h=" + this.h);
+ if (this.hb)
+ parts.push ("hb=" + this.hb);
+ if (this.t)
+ parts.push ("t=" + this.t);
+ if (this.p)
+ parts.push ("p=" + this.p);
+ return parts.join ("@");
+}
+
+function splitGitRef (ref)
+{
+ var parts = ref.split ("@");
+ var res = new GitRef ();
+ var i;
+ for (i = 0; i < parts.length; i++)
+ {
+ var p = parts[i].split ("=");
+ res[p[0]] = p[1];
+ }
+ return res;
+}
+
+function GitURL (base)
+{
+ this.base = base;
+ this.p = null;
+ this.a = null;
+ this.f = null;
+ this.fp = null;
+ this.h = null;
+ this.hp = null;
+ this.hb = null;
+ this.hpb = null;
+ this.pg = null;
+ this.o = null;
+ this.s = null;
+ this.st = null;
+ this.ToURL = ToURL;
+ this.ToRef = UrlToRef;
+ this.ToDUrl = ToDUrl;
+}
+
+function ToURL ()
+{
+ var parts = new Array ();
+ if (this.p)
+ parts.push ("p=" + this.p);
+ if (this.a)
+ parts.push ("a=" + this.a);
+ if (this.f)
+ parts.push ("f=" + this.f);
+ if (this.fp)
+ parts.push ("fp=" + this.fp);
+ if (this.h)
+ parts.push ("h=" + this.h);
+ if (this.hp)
+ parts.push ("hp=" + this.hp);
+ if (this.hb)
+ parts.push ("hb=" + this.hb);
+ if (this.hpb)
+ parts.push ("hpb=" + this.hpb);
+ if (this.o)
+ parts.push ("o=" + this.o);
+ if (this.s)
+ parts.push ("s=" + this.s);
+ if (this.st)
+ parts.push ("st=" + this.st);
+ return this.base + "?" + parts.join (";");
+}
+
+function UrlToRef (type)
+{
+ var res = new GitRef;
+ res.f = this.f;
+ res.h = this.h;
+ res.hb = this.hb;
+ res.t = type;
+ res.p = this.p;
+ return res.ToRef ();
+}
+
+function ToDUrl (type)
+{
+ var res = new GitURL (this.base);
+ res.f = this.f;
+ res.h = this.h;
+ res.hb = this.hb;
+ res.p = this.p;
+ res.a = type;
+ return res.ToURL ();
+}
+
+function splitGitURL (url)
+{
+ var Urls = url.split ("?");
+ var res = new GitURL (Urls[0]);
+ if (Urls.length > 1)
+ {
+ var parts = Urls[1].split (";");
+ var i;
+ for (i = 0; i < parts.length; i++)
+ {
+ var p = parts[i].split ("=");
+ res[p[0]] = p[1];
+ }
+ }
+ return res;
+}
+
+function base (ref)
+{
+ document.cookie = "basename=" + ref;
+}
+
+function diff (url)
+{
+ var c = getCookie ("basename");
+ if (!c)
+ {
+ alert ("no diff base selected");
+ return;
+ }
+ c = splitGitRef (c);
+ url = splitGitURL (url);
+
+ if (c.p != url.p)
+ {
+ alert ("base object in an other repository");
+ return;
+ }
+
+ if (c.t == 'commit' && url.a == 'commit')
+ {
+ url.a = 'commitdiff';
+ if (!c.h || !url.h)
+ {
+ alert ("commit diff not possible");
+ return;
+ }
+ url.hb = null;
+ url.f = null;
+ url.hp = c.h;
+ document.location.href = url.ToURL ();
+ return;
+ }
+ if (c.t == 'blob' && url.a == 'blob')
+ {
+ url.a = 'blobdiff';
+ url.hp = c.h;
+ url.hpb = c.hb;
+ url.fp = c.f;
+ document.location.href = url.ToURL ();
+ return;
+ }
+ if (c.t == 'tree' && url.a == 'tree')
+ {
+ url.a = 'treediff';
+ url.hpb = c.hb;
+ url.hp = c.h;
+ url.fp = c.f;
+ document.location.href = url.ToURL ();
+ return;
+ }
+ if (c.t == 'commit' && url.a == 'tree')
+ {
+ url.a = 'treediff';
+ url.hpb = c.h;
+ url.hp = null;
+ url.fp = null;
+ document.location.href = url.ToURL ();
+ return;
+ }
+ if (c.t == 'tree' && url.a == 'commit')
+ {
+ url.a = 'treediff';
+ url.hpb = c.hb;
+ url.hp = c.h;
+ url.fp = c.f;
+ url.hb = url.h;
+ url.h = null;
+ document.location.href = url.ToURL ();
+ return;
+ }
+ alert ("diff not possible");
+}
+
+function GitAddLinks ()
+{
+ var links = document.getElementsByTagName ("a");
+ var i;
+
+ for (i = 0; i < links.length; i++)
+ {
+ var link = links[i];
+ var url = splitGitURL (link.href);
+ if (link.innerHTML == 'commit' || link.innerHTML == 'tag')
+ {
+ if (!url.h)
+ continue;
+ var l =
+ createLinkGroup ("javascript:base('" + url.ToRef ('commit') +
+ "')", "base",
+ "javascript:diff('" + url.ToDUrl ('commit') +
+ "')", "diff");
+ insertAfter (l, link);
+ }
+ if (link.innerHTML == 'blob')
+ {
+ if (!url.h && !(url.hb && url.f))
+ continue;
+ var l =
+ createLinkGroup ("javascript:base('" + url.ToRef ('blob') + "')",
+ "base",
+ "javascript:diff('" + url.ToDUrl ('blob') + "')",
+ "diff");
+ insertAfter (l, link);
+ }
+ if (link.innerHTML == 'tree')
+ {
+ if (!url.h && !(url.hb && url.f))
+ continue;
+ var l =
+ createLinkGroup ("javascript:base('" + url.ToRef ('tree') + "')",
+ "base",
+ "javascript:diff('" + url.ToDUrl ('tree') + "')",
+ "diff");
+ insertAfter (l, link);
+ }
+ }
+}
+
+function ShowHideLinks (action)
+{
+ var tags = document.getElementsByTagName ("span");
+
+ for (i = 0; i < tags.length; i++)
+ {
+ var tag = tags[i];
+ if (tag.className == 'difflinks')
+ {
+ if (action)
+ tag.style.display = 'inline';
+ else
+ tag.style.display = 'none';
+ }
+ }
+
+}
+
+var LinkState=-1;
+var saveonload;
+
+function GitShowLinks ()
+{
+ if (LinkState == -1)
+ {
+ GitAddLinks();
+ LinkState = 1;
+ document.cookie = "showdiff=1";
+ document.getElementById ('difflinks').innerHTML = 'hide difflinks';
+ }
+ else if (LinkState == 1)
+ {
+ ShowHideLinks (false);
+ LinkState = 0;
+ document.cookie = "showdiff=0";
+ document.getElementById ('difflinks').innerHTML = 'show difflinks';
+ }
+ else
+ {
+ ShowHideLinks (true);
+ LinkState = 1;
+ document.cookie = "showdiff=1";
+ document.getElementById ('difflinks').innerHTML = 'hide difflinks';
+ }
+}
+
+function GitAddLinkElement ()
+{
+ document.getElementById ('difflinkdiv').innerHTML =
+ ' | <a id="difflinks" href="javascript:GitShowLinks()">show difflinks</a>';
+ var show = getCookie ('showdiff');
+ if (show == '1')
+ {
+ saveonload = window.onload;
+ window.onload = function ()
+ {
+ if (saveonload)
+ saveonload();
+ GitShowLinks();
+ }
+ }
+}
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 4081f51..2531133 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -61,6 +61,8 @@ our $stylesheet = undef;
our $logo = "++GITWEB_LOGO++";
# URI of GIT favicon, assumed to be image/png type
our $favicon = "++GITWEB_FAVICON++";
+# URI of gitweb.js
+our $gitwebjs = "++GITWEB_JS++";
# URI and label (title) of GIT logo link
#our $logo_url = "http://www.kernel.org/pub/software/scm/git/docs/";
@@ -2313,6 +2315,10 @@ EOF
print qq(<link rel="shortcut icon" href="$favicon" type="image/png"/>\n);
}
+ if (defined $gitwebjs) {
+ print qq(<script src="$gitwebjs" type="text/javascript"></script>\n);
+ }
+
print "</head>\n" .
"<body>\n";
@@ -2449,6 +2455,11 @@ sub git_print_page_nav {
map { $_ eq $current ?
$_ : $cgi->a({-href => href(%{$arg{$_}})}, "$_")
} @navs);
+
+ if (defined $gitwebjs) {
+ print '<span id="difflinkdiv"></span><script type="text/javascript">GitAddLinkElement();</script>';
+ }
+
print "<br/>\n$extra<br/>\n" .
"</div>\n";
}
--
1.5.3.rc7.849.g2f5f
^ permalink raw reply related
* Stats in Git
From: Marius Storm-Olsen @ 2007-09-02 14:49 UTC (permalink / raw)
To: Git Mailing List
I was checking out the performance situation with Git on Windows, and
found out that the Posix stat functions on Windows are just obscenely
slow. We really can't use them, at least on in Git. So, I made a patch
for the MinGW version, which I'll post right after this mail.
However, while look at that whole stat'ing situation in git, I saw
that doing 'git status' actually stats all the files _thrice_!
Yup, that's not 1 time, or 2 times, but actually 3(!) times before
'git status' is content!
I know that git-status is a script, so I think this clearly indicates
that git-status is a prime candidate for a built-in ;-)
I haven't looked into details as to why it stats the files so many
times. I guess someone more experienced in Git core could give an
opinion, if by writing git-status as a builtin it would be possible to
only stat the files once. It would have a huge impact on Windows where
stats are inheritly much slower than on Linux.
By applying the diff below, you can see for yourself what happens when
you stat the repo created with Moe's script:
mkdir bummer
cd bummer
for ((i=0;i<100;i++)); do
mkdir $i && pushd $i;
for ((j=0;j<1000;j++)); do
echo "$j" >$j; done; popd;
done
$ git status 2>&1 | wc -l
300137
Fast on Linux now, but still quite slow on Windows..
--
.marius
diff --git a/git-compat-util.h b/git-compat-util.h
index ca0a597..6b6405c 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -369,4 +369,23 @@ static inline int strtoul_ui(char const *s, int base, unsigned int *result)
return 0;
}
+static inline int git_lstat(const char *file_name, struct stat *buf)
+{
+ fprintf(stderr, "lstat: %s\n", file_name);
+ return lstat(file_name, buf);
+}
+static inline int git_fstat(int fd, struct stat *buf)
+{
+ fprintf(stderr, "fstat: %d\n", fd);
+ return fstat(fd, buf);
+}
+static inline int git_stat(const char *file_name, struct stat *buf)
+{
+ fprintf(stderr, "stat: %s\n", file_name);
+ return stat(file_name, buf);
+}
+#define lstat(x,y) git_lstat(x,y)
+#define fstat(x,y) git_fstat(x,y)
+#define stat(x,y) git_stat(x,y)
+
#endif
^ permalink raw reply related
* [PATCH] Add a new lstat implementation based on Win32 API, and make stat use that implementation too.
From: Marius Storm-Olsen @ 2007-09-02 14:51 UTC (permalink / raw)
To: Git Mailing List; +Cc: Johannes Schindelin, Johannes Sixt
In-Reply-To: <46DACD93.9000509@trolltech.com>
This gives us a significant speedup when adding, committing and stat'ing files.
(Also, since Windows doesn't really handle symlinks, it's fine that stat just uses lstat)
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
---
The following patch will override the normal Posix implementation of stat and
lstat on Windows, and use normal Windows API to ensure we're stat'ing as fast
as possible. With this patch I get the performance increase to the far right.
Initially, I only replaced lstat, since that's what the MinGW port of Git had
implemented from before. But, since we don't really care about symlinks on
Windows, I decided to simply use the same implementation for stat as well. The
performance benefit is clearly indicated in the report below.
With normal lstat & stat lstat, based on Win32 lstat & stat, as Win32
------------------------- ------------------------- -------------------------
Command: git init Command: git init Command: git init
------------------------- ------------------------- -------------------------
real 0m0.047s real 0m0.047s real 0m0.078s
user 0m0.031s user 0m0.031s user 0m0.031s
sys 0m0.000s sys 0m0.000s sys 0m0.000s
------------------------- ------------------------- -------------------------
Command: git add . Command: git add . Command: git add .
------------------------- ------------------------- -------------------------
real 0m19.390s real 0m19.390s real 0m12.187s
user 0m0.015s user 0m0.015s user 0m0.015s
sys 0m0.030s sys 0m0.030s sys 0m0.015s
------------------------- ------------------------- -------------------------
Command: git commit -a... Command: git commit -a... Command: git commit -a...
------------------------- ------------------------- -------------------------
real 0m30.812s real 0m22.547s real 0m17.297s
user 0m0.015s user 0m0.031s user 0m0.015s
sys 0m0.000s sys 0m0.000s sys 0m0.015s
------------------------- ------------------------- -------------------------
3x Command: git-status 3x Command: git-status 3x Command: git-status
------------------------- ------------------------- -------------------------
real 0m11.860s real 0m5.360s real 0m5.344s
user 0m0.015s user 0m0.015s user 0m0.015s
sys 0m0.015s sys 0m0.015s sys 0m0.031s
real 0m11.703s real 0m5.312s real 0m5.390s
user 0m0.015s user 0m0.015s user 0m0.031s
sys 0m0.000s sys 0m0.000s sys 0m0.000s
real 0m11.672s real 0m5.359s real 0m5.344s
user 0m0.031s user 0m0.015s user 0m0.015s
sys 0m0.000s sys 0m0.015s sys 0m0.016s
------------------------- ------------------------- -------------------------
Command: git commit... Command: git commit... Command: git commit...
(single file) (single file) (single file)
------------------------- ------------------------- -------------------------
real 0m14.234s real 0m7.969s real 0m7.875s
user 0m0.015s user 0m0.015s user 0m0.015s
sys 0m0.000s sys 0m0.016s sys 0m0.000s
compat/mingw.c | 52 ++++++++++++++++++++++++++++++++++++++++++++--------
git-compat-util.h | 5 +++++
2 files changed, 49 insertions(+), 8 deletions(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 7711a3f..207378c 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -23,19 +23,52 @@ int fchmod(int fildes, mode_t mode)
return -1;
}
-int lstat(const char *file_name, struct stat *buf)
+static inline time_t filetime_to_time_t(const FILETIME *ft)
+{
+ long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime;
+ winTime -= 116444736000000000LL; /* Windows to Unix Epoch conversion */
+ winTime /= 10000000; /* Nano to seconds resolution */
+ return (time_t)winTime;
+}
+
+extern int _getdrive( void );
+int git_lstat(const char *file_name, struct stat *buf)
{
int namelen;
static char alt_name[PATH_MAX];
-
- if (!stat(file_name, buf))
+ char* ext;
+ WIN32_FILE_ATTRIBUTE_DATA fdata;
+
+ if (GetFileAttributesExA(file_name, GetFileExInfoStandard, &fdata)) {
+ int fMode = S_IREAD;
+ if (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ fMode |= S_IFDIR;
+ else {
+ fMode |= S_IFREG;
+ ext = strrchr(file_name, '.');
+ if (ext && (!_stricmp(ext, ".exe") ||
+ !_stricmp(ext, ".com") ||
+ !_stricmp(ext, ".bat") ||
+ !_stricmp(ext, ".cmd")))
+ fMode |= S_IEXEC;
+ }
+ if (!(fdata.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
+ fMode |= S_IWRITE;
+
+ buf->st_ino = 0;
+ buf->st_gid = 0;
+ buf->st_uid = 0;
+ buf->st_nlink = 1;
+ buf->st_mode = fMode;
+ buf->st_size = fdata.nFileSizeLow; /* Can't use nFileSizeHigh, since it's not a stat64 */
+ buf->st_dev = buf->st_rdev = (_getdrive() - 1);
+ buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime));
+ buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime));
+ buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime));
return 0;
+ }
+ errno = ENOENT;
- /* if file_name ended in a '/', Windows returned ENOENT;
- * try again without trailing slashes
- */
- if (errno != ENOENT)
- return -1;
namelen = strlen(file_name);
if (namelen && file_name[namelen-1] != '/')
return -1;
@@ -47,6 +80,9 @@ int lstat(const char *file_name, struct stat *buf)
alt_name[namelen] = 0;
return stat(alt_name, buf);
}
+int git_stat(const char *file_name, struct stat *buf) {
+ return git_lstat(file_name, buf);
+}
/* missing: link, mkstemp, fchmod, getuid (?), gettimeofday */
int socketpair(int d, int type, int protocol, int sv[2])
diff --git a/git-compat-util.h b/git-compat-util.h
index 1ba499f..de1f062 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -488,6 +488,11 @@ int mingw_rename(const char*, const char*);
extern void quote_argv(const char **dst, const char **src);
extern const char *parse_interpreter(const char *cmd);
+/* Make git on Windows use git_lstat and git_stat instead of lstat and stat */
+int git_lstat(const char *file_name, struct stat *buf);
+int git_stat(const char *file_name, struct stat *buf);
+#define lstat(x,y) git_lstat(x,y)
+#define stat(x,y) git_stat(x,y)
#endif /* __MINGW32__ */
#endif
--
mingw.v1.5.2.4.1311.g376df-dirty
^ permalink raw reply related
* Re: [PATCH] Add a new lstat implementation based on Win32 API, and make stat use that implementation too.
From: Marius Storm-Olsen @ 2007-09-02 14:57 UTC (permalink / raw)
Cc: Git Mailing List, Johannes Schindelin, Johannes Sixt
In-Reply-To: <46DACE0D.5070501@trolltech.com>
Sorry, should have added that this is a MinGW port patch only. And I
forgot to include the msysgit mailinglist, nice..
--
.marius
^ permalink raw reply
* Re: git-gui i18n status?
From: Michele Ballabio @ 2007-09-02 15:09 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
On Sunday 02 September 2007, Johannes Schindelin wrote:
> Then I'd like to prepare consolidated patches for the individual
> languages, attributed to the author where unique, and to Nanako for
> Japanese (mentioning help from Junio), and to Paolo (mentioning help
from
> Michele).
>
> Junio, Michele, is that attribution enough for you?
That's fine with me.
(Since I'm having problems with my MUA this message may break the thread
and I'm not CC'ing everyone but Johannes and the ML. Sorry.)
^ permalink raw reply
* Re: Buffer overflows
From: Reece Dunn @ 2007-09-02 15:11 UTC (permalink / raw)
To: Johan Herland, git, Junio C Hamano, Timo Sirainen, Linus Torvalds
In-Reply-To: <200709021542.31100.johan@herland.net>
On 02/09/07, Johan Herland <johan@herland.net> wrote:
> On Friday 31 August 2007, Junio C Hamano wrote:
> > The API needs to justify itself to convince the people who needs
> > to learn and adjust to that the benefit far outweighes deviation
> > from better known patterns, and I do not see that happening in
> > Timo's patch.
>
> So in general, git people seem to be saying that:
>
> 1. Yes, we agree that the C string library suX0rs badly.
>
> 2. There are more than 0 string manipulation bugs (e.g. buffer overflows) in
> git. The number may be small or large, but I have yet to see anyone claim
> it's _zero_.
>
> 3. Timo's patches (in their current form) are not the way to go, because of
> non-standard API, implementation problems, whatever...
>
> So why does the discussion end there? Lukas proposed an interesting
> alternative in "The Better String Library" (
> http://bstring.sourceforge.net/ ). Why has there been lots of bashing on
> Timo's efforts, but no critique of bstring? I'd be very keen to know what
> the git developers think of it. AFAICS, it seems to fulfill at least _some_
> of the problems people find in Timo's patches. Specifically, it claims:
>
> - High performance (better than the C string library)
> - Simple usage
Performing a brief look at the documentation, the bstring library
looks promising.
It looks like it has an allocate and grow internal buffers on demand
policy. This is similar to what the C++ std::basic_string does, as
well as the string helpers in the Boost version of Jam (written in C).
This hides the buffer management from the user of the library, rather
than obfuscating it like in Timo's patch.
The API defined in the documentation is well thought out and
extensive, moreso than in the efforts by Timo and others. It has the
traditional C API, along with other API found in other string
libraries (such as split and join). I am not sure how much of git
could make use of these, but they have the pontential to simplify some
areas of the codebase.
Looking at the documentation, it is clear that this is a well thought
out library, both from the problems/security issues of the C library
and to how it compares with other string libraries. As well as
covering buffer overflow, it also deals with things like integer
overflow.
They have also done performance tests comparing the bstring library to
the C API and C++ std::string. With the C API comparison, the library
performs about 10% slower for string assignment, but other areas don't
have a slowdown. In fact, string concatenation is _considerably_
improved, something that will help git performance. I suspect (but
have not verified) that the slowdown on assignment is due to buffer
allocation.
> I'd also say it's probably more widely used than Timo's patches.
Which is good, as this means that along with the tests in the library,
it will be more stable and less likely to be buggy than something that
is written from scratch.
> If the only response to Timo's highlighting of string manipulation problems
> in git, is for us to flame his patches and leave it at that, then I have no
> choice but to agree with him in that security does not seem to matter to
> us.
I would not like to see that happen. It seems that the bstring library
will help git in more ways than security, by improving string
concatenation performance and giving a richer string API without
sacrificing performance (except where noted) and code clarity.
It would be interesting to see how the 10% performance drop on string
assignment impacts git performance, when balanced with the drastic
(92x in the performance table) increase on string concatenation.
The only major issue that I can see with bstring is that it does not
have a wchar_t version, but git is using chars internally, so this is
not a problem for git.
- Reece
^ permalink raw reply
* Re: [ANNOUNCE] GIT 1.5.3
From: Nicolas Vilz @ 2007-09-02 15:12 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vodglr32i.fsf@gitster.siamese.dyndns.org>
On Sat, Sep 01, 2007 at 11:31:17PM -0700, Junio C Hamano wrote:
> - URL used for "git clone" and friends can specify nonstandard SSH port
> by using sh://host:port/path/to/repo syntax.
Sorry, but could this be a typo and should be
by using ssh://host:port/path/to/repo syntax.
^^^
Sincerly
Nicolas
^ permalink raw reply
* Re: Buffer overflows
From: David Kastrup @ 2007-09-02 15:19 UTC (permalink / raw)
To: Reece Dunn
Cc: Johan Herland, git, Junio C Hamano, Timo Sirainen, Linus Torvalds
In-Reply-To: <3f4fd2640709020811r4ea8f01fw775257859e26af29@mail.gmail.com>
"Reece Dunn" <msclrhd@googlemail.com> writes:
> Which is good, as this means that along with the tests in the
> library, it will be more stable and less likely to be buggy than
> something that is written from scratch.
Remember git's history.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply
* [PATCH] git-gui: remove dots in some UI strings
From: Michele Ballabio @ 2007-09-02 12:43 UTC (permalink / raw)
To: git, Shawn O. Pearce
Dots in a UI string usually mean that a dialog box will
appear waiting for further input. So this patch removes
unneeded dots for actions that do not require user's
input.
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
---
lib/remote.tcl | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/remote.tcl b/lib/remote.tcl
index cf9b9d5..99ec1b4 100644
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
@@ -159,7 +159,7 @@ proc populate_fetch_menu {} {
if {$enable} {
lappend prune_list $r
$m add command \
- -label "Fetch from $r..." \
+ -label "Fetch from $r" \
-command [list fetch_from $r]
}
}
@@ -169,7 +169,7 @@ proc populate_fetch_menu {} {
}
foreach r $prune_list {
$m add command \
- -label "Prune from $r..." \
+ -label "Prune from $r" \
-command [list prune_from $r]
}
}
@@ -203,7 +203,7 @@ proc populate_push_menu {} {
$m add separator
}
$m add command \
- -label "Push to $r..." \
+ -label "Push to $r" \
-command [list push_to $r]
incr fast_count
}
--
1.5.3.rc7
^ permalink raw reply related
* Re: git-gui i18n status?
From: Michele Ballabio @ 2007-09-02 14:17 UTC (permalink / raw)
To: Johannes Schindelin
Cc: Shawn O. Pearce, Christian Stimming, Miklos Vajna,
Nanako Shiraishi, Paolo Ciarrocchi, Xudong Guan,
Harri Ilari Tapio Liusvaara, Junio C Hamano, Irina Riesen, git
In-Reply-To: <Pine.LNX.4.64.0709020003480.28586@racer.site>
On Sunday 02 September 2007, Johannes Schindelin wrote:
> Then I'd like to prepare consolidated patches for the individual
> languages, attributed to the author where unique, and to Nanako for
> Japanese (mentioning help from Junio), and to Paolo (mentioning help from
> Michele).
>
> Junio, Michele, is that attribution enough for you?
That's fine with me.
^ permalink raw reply
* Re: [PATCH] Add a new lstat implementation based on Win32 API, and make stat use that implementation too.
From: Reece Dunn @ 2007-09-02 15:32 UTC (permalink / raw)
To: Marius Storm-Olsen, Git Mailing List, Johannes Schindelin,
Johannes Sixt
In-Reply-To: <46DACE0D.5070501@trolltech.com>
On 02/09/07, Marius Storm-Olsen <marius@trolltech.com> wrote:
> This gives us a significant speedup when adding, committing and stat'ing files.
> (Also, since Windows doesn't really handle symlinks, it's fine that stat just uses lstat)
>
> + if (ext && (!_stricmp(ext, ".exe") ||
> + !_stricmp(ext, ".com") ||
> + !_stricmp(ext, ".bat") ||
> + !_stricmp(ext, ".cmd")))
> + fMode |= S_IEXEC;
> + }
This breaks executable mode reporting for things like configure
scripts and other shell scripts that may, or may not, be executable.
Also, you may want to turn off the executable state for some of these
extensions (for example if com or cmd were not actually executable
files). This makes it impossible to manipulate git repositories
properly on the MinGW platform.
Would it be possible to use the git tree to manage the executable
state? That way, all files would not have their executable state set
by default on Windows. The problem with this is how then to set the
executable state? Having a git version of chmod may not be a good
idea, but then how else are you going to reliably and efficiently
modify the files permissions on Windows?
The rest of the patch looks good on a brief initial scan.
- Reece
^ permalink raw reply
* Re: Buffer overflows
From: Reece Dunn @ 2007-09-02 15:35 UTC (permalink / raw)
To: David Kastrup, Johan Herland, git, Junio C Hamano, Timo Sirainen,
"Linus Torvalds" <torvalds
In-Reply-To: <85veatqelm.fsf@lola.goethe.zz>
On 02/09/07, David Kastrup <dak@gnu.org> wrote:
> "Reece Dunn" <msclrhd@googlemail.com> writes:
>
> > Which is good, as this means that along with the tests in the
> > library, it will be more stable and less likely to be buggy than
> > something that is written from scratch.
>
> Remember git's history.
True!
- Reece
^ permalink raw reply
* Re: [PATCH] Add a new lstat implementation based on Win32 API, and make stat use that implementation too.
From: Marius Storm-Olsen @ 2007-09-02 16:09 UTC (permalink / raw)
To: Reece Dunn; +Cc: Git Mailing List, Johannes Schindelin, Johannes Sixt
In-Reply-To: <3f4fd2640709020832x656fa78djf29117690318ea48@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2936 bytes --]
Reece Dunn wrote:
> On 02/09/07, Marius Storm-Olsen <marius@trolltech.com> wrote:
>> This gives us a significant speedup when adding, committing and stat'ing files.
>> (Also, since Windows doesn't really handle symlinks, it's fine that stat just uses lstat)
>>
>> + if (ext && (!_stricmp(ext, ".exe") ||
>> + !_stricmp(ext, ".com") ||
>> + !_stricmp(ext, ".bat") ||
>> + !_stricmp(ext, ".cmd")))
>> + fMode |= S_IEXEC;
>> + }
>
> This breaks executable mode reporting for things like configure
> scripts and other shell scripts that may, or may not, be executable.
> Also, you may want to turn off the executable state for some of these
> extensions (for example if com or cmd were not actually executable
> files). This makes it impossible to manipulate git repositories
> properly on the MinGW platform.
Actually, you don't really need the EXEC bit for Git to work. I just
added it for completeness. (We _could_ remove that too, since it's
slowing us down slightly ;-)
Remember that Git isn't using MSys for its builtins, so MinGW Git
doesn't understand the MSys notion of executable files anyways.
The MinGW port actually peeks at the beginning of a file (ignoring exe
files), and sees if there's an interpreter there. If there is, it will
expand
git-foo args...
into
sh git-foo args...
and execute the command. So, it's not really affected by this change.
I haven't had any problems with this patch on my system, so could you
explain what you mean with 'this makes it impossible to manipulate git
repositories'?
> Would it be possible to use the git tree to manage the executable
> state? That way, all files would not have their executable state set
> by default on Windows. The problem with this is how then to set the
> executable state? Having a git version of chmod may not be a good
> idea, but then how else are you going to reliably and efficiently
> modify the files permissions on Windows?
The file-state-in-git-tree belongs in a different discussion. Have a
look at the '.gitignore, .gitattributes, .gitmodules, .gitprecious?,
.gitacls? etc.' and 'tracking perms/ownership [was: empty directories]'
threads. Permissions are not a trivial topic, since systems represent
them differently. This patch just tries to reflect the read, write and
execute permissions as normal Windows would; and it only cares about
file extensions (and the PE header, if it exists).
Also note that my patch totally ignores the Group & Others part of the
permission bits. Again, we're on Windows so we don't really care. We
_could_ make it reflect the ACLs in Windows, but then we'd have to make
it optional, since that's _really_ slow to 'stat'.
> The rest of the patch looks good on a brief initial scan.
Thanks
--
.marius
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]
^ permalink raw reply
* [PATCH 00/15] i18n support for git-gui
From: Johannes Schindelin @ 2007-09-02 16:23 UTC (permalink / raw)
To: Shawn O. Pearce, git
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2983 bytes --]
Hi,
to test, as usual call "make" in git-gui and use git-gui.sh. Or install
right away.
The shortlog:
Christian Stimming (6):
Mark strings for translation.
Makefile rules for translation catalog generation and installation.
Add glossary that can be converted into a po file for each language.
Add glossary translation template into git.
German translation for git-gui
German glossary for translation
Irina Riesen (1):
git-gui: initial version of russian translation
Johannes Schindelin (2):
Add po/git-gui.pot
Ignore po/*.msg
Junio C Hamano (1):
git-gui po/README: Guide to translators
Miklos Vajna (1):
Hungarian translation of git-gui
Paolo Ciarrocchi (1):
Italian translation of git-gui
Xudong Guan (2):
Initial Chinese translation for git-gui
git-gui: Added initial version of po/glossary/zh_cn.po
しらいしななこ (1):
Japanese translation of git-gui
And the diffstat:
Makefile | 21 +-
git-gui.sh | 265 ++++----
lib/blame.tcl | 10 +-
lib/branch_checkout.tcl | 16 +-
lib/branch_create.tcl | 38 +-
lib/branch_delete.tcl | 22 +-
lib/branch_rename.tcl | 22 +-
lib/browser.tcl | 22 +-
lib/checkout_op.tcl | 48 +-
lib/choose_rev.tcl | 16 +-
lib/commit.tcl | 52 +-
lib/console.tcl | 14 +-
lib/database.tcl | 28 +-
lib/diff.tcl | 16 +-
lib/error.tcl | 8 +-
lib/index.tcl | 23 +-
lib/merge.tcl | 60 +-
lib/option.tcl | 49 +-
lib/remote.tcl | 6 +-
lib/remote_branch_delete.tcl | 42 +-
lib/shortcut.tcl | 12 +-
lib/status_bar.tcl | 2 +-
lib/transport.tcl | 30 +-
po/.gitignore | 2 +
po/README | 205 ++++++
po/de.po | 1398 +++++++++++++++++++++++++++++++++++
po/git-gui.pot | 1264 ++++++++++++++++++++++++++++++++
po/glossary/Makefile | 9 +
po/glossary/de.po | 158 ++++
po/glossary/git-gui-glossary.pot | 152 ++++
po/glossary/git-gui-glossary.txt | 34 +
po/glossary/txt-to-pot.sh | 48 ++
po/glossary/zh_cn.po | 170 +++++
po/hu.po | 1422 ++++++++++++++++++++++++++++++++++++
po/it.po | 1393 +++++++++++++++++++++++++++++++++++
po/ja.po | 1381 +++++++++++++++++++++++++++++++++++
po/ru.po | 1480 ++++++++++++++++++++++++++++++++++++++
po/zh_cn.po | 1284 +++++++++++++++++++++++++++++++++
38 files changed, 10822 insertions(+), 400 deletions(-)
Have fun!
Ciao,
Dscho
^ permalink raw reply
* [PATCH 01/15] Mark strings for translation.
From: Johannes Schindelin @ 2007-09-02 16:25 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021719380.28586@racer.site>
The procedure [mc ...] will translate the strings through msgcat.
Strings must be enclosed in quotes, not in braces, because otherwise
xgettext cannot extract them properly, although on the Tcl side both
delimiters would work fine.
[jes: I merged the later patches to that end.]
Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
git-gui.sh | 265 +++++++++++++++++++++---------------------
lib/blame.tcl | 10 +-
lib/branch_checkout.tcl | 16 ++--
lib/branch_create.tcl | 38 +++---
lib/branch_delete.tcl | 22 ++--
lib/branch_rename.tcl | 22 ++--
lib/browser.tcl | 22 ++--
lib/checkout_op.tcl | 48 ++++----
lib/choose_rev.tcl | 16 ++--
lib/commit.tcl | 52 ++++----
lib/console.tcl | 14 +-
lib/database.tcl | 28 +++---
lib/diff.tcl | 16 ++--
lib/error.tcl | 8 +-
lib/index.tcl | 23 +++-
lib/merge.tcl | 60 +++++-----
lib/option.tcl | 49 ++++----
lib/remote.tcl | 6 +-
lib/remote_branch_delete.tcl | 42 +++----
lib/shortcut.tcl | 12 +-
lib/status_bar.tcl | 2 +-
lib/transport.tcl | 30 +++---
22 files changed, 403 insertions(+), 398 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 486d36e..913ba68 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -502,7 +502,7 @@ proc tk_optionMenu {w varName args} {
set _git [_which git]
if {$_git eq {}} {
catch {wm withdraw .}
- error_popup "Cannot find git in PATH."
+ error_popup [mc "Cannot find git in PATH."]
exit 1
}
@@ -529,7 +529,7 @@ if {![regsub {^git version } $_git_version {} _git_version]} {
-icon error \
-type ok \
-title "git-gui: fatal error" \
- -message "Cannot parse Git version string:\n\n$_git_version"
+ -message [append [mc "Cannot parse Git version string:"] "\n\n$_git_version"]
exit 1
}
@@ -546,14 +546,14 @@ if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
-type yesno \
-default no \
-title "[appname]: warning" \
- -message "Git version cannot be determined.
+ -message [mc "Git version cannot be determined.
-$_git claims it is version '$_real_git_version'.
+%s claims it is version '%s'.
-[appname] requires at least Git 1.5.0 or later.
+%s requires at least Git 1.5.0 or later.
-Assume '$_real_git_version' is version 1.5.0?
-"] eq {yes}} {
+Assume '%s' is version 1.5.0?
+" $_git $_real_git_version [appname] $_real_git_version]] eq {yes}} {
set _git_version 1.5.0
} else {
exit 1
@@ -711,7 +711,7 @@ if {[catch {
set _prefix [git rev-parse --show-prefix]
} err]} {
catch {wm withdraw .}
- error_popup "Cannot find the git directory:\n\n$err"
+ error_popup [append [mc "Cannot find the git directory:"] "\n\n$err"]
exit 1
}
if {![file isdirectory $_gitdir] && [is_Cygwin]} {
@@ -719,7 +719,7 @@ if {![file isdirectory $_gitdir] && [is_Cygwin]} {
}
if {![file isdirectory $_gitdir]} {
catch {wm withdraw .}
- error_popup "Git directory not found:\n\n$_gitdir"
+ error_popup [append [mc "Git directory not found:"] "\n\n$_gitdir"]
exit 1
}
if {$_prefix ne {}} {
@@ -733,12 +733,12 @@ if {$_prefix ne {}} {
} elseif {![is_enabled bare]} {
if {[lindex [file split $_gitdir] end] ne {.git}} {
catch {wm withdraw .}
- error_popup "Cannot use funny .git directory:\n\n$_gitdir"
+ error_popup [append [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
exit 1
}
if {[catch {cd [file dirname $_gitdir]} err]} {
catch {wm withdraw .}
- error_popup "No working directory [file dirname $_gitdir]:\n\n$err"
+ error_popup [append [mc "No working directory"] " [file dirname $_gitdir]:\n\n$err"]
exit 1
}
}
@@ -885,7 +885,7 @@ proc rescan {after {honor_trustmtime 1}} {
rescan_stage2 {} $after
} else {
set rescan_active 1
- ui_status {Refreshing file status...}
+ ui_status [mc "Refreshing file status..."]
set fd_rf [git_read update-index \
-q \
--unmerged \
@@ -922,7 +922,7 @@ proc rescan_stage2 {fd after} {
set buf_rlo {}
set rescan_active 3
- ui_status {Scanning for modified files ...}
+ ui_status [mc "Scanning for modified files ..."]
set fd_di [git_read diff-index --cached -z [PARENT]]
set fd_df [git_read diff-files -z]
set fd_lo [eval git_read ls-files --others -z $ls_others]
@@ -1088,7 +1088,7 @@ proc ui_status {msg} {
}
proc ui_ready {{test {}}} {
- $::main_status show {Ready.} $test
+ $::main_status show [mc "Ready."] $test
}
proc escape_path {path} {
@@ -1353,31 +1353,32 @@ set all_icons(O$ui_workdir) file_plain
set max_status_desc 0
foreach i {
- {__ "Unmodified"}
-
- {_M "Modified, not staged"}
- {M_ "Staged for commit"}
- {MM "Portions staged for commit"}
- {MD "Staged for commit, missing"}
-
- {_O "Untracked, not staged"}
- {A_ "Staged for commit"}
- {AM "Portions staged for commit"}
- {AD "Staged for commit, missing"}
-
- {_D "Missing"}
- {D_ "Staged for removal"}
- {DO "Staged for removal, still present"}
-
- {U_ "Requires merge resolution"}
- {UU "Requires merge resolution"}
- {UM "Requires merge resolution"}
- {UD "Requires merge resolution"}
+ {__ {mc "Unmodified"}}
+
+ {_M {mc "Modified, not staged"}}
+ {M_ {mc "Staged for commit"}}
+ {MM {mc "Portions staged for commit"}}
+ {MD {mc "Staged for commit, missing"}}
+
+ {_O {mc "Untracked, not staged"}}
+ {A_ {mc "Staged for commit"}}
+ {AM {mc "Portions staged for commit"}}
+ {AD {mc "Staged for commit, missing"}}
+
+ {_D {mc "Missing"}}
+ {D_ {mc "Staged for removal"}}
+ {DO {mc "Staged for removal, still present"}}
+
+ {U_ {mc "Requires merge resolution"}}
+ {UU {mc "Requires merge resolution"}}
+ {UM {mc "Requires merge resolution"}}
+ {UD {mc "Requires merge resolution"}}
} {
- if {$max_status_desc < [string length [lindex $i 1]]} {
- set max_status_desc [string length [lindex $i 1]]
+ set text [eval [lindex $i 1]]
+ if {$max_status_desc < [string length $text]} {
+ set max_status_desc [string length $text]
}
- set all_descs([lindex $i 0]) [lindex $i 1]
+ set all_descs([lindex $i 0]) $text
}
unset i
@@ -1416,7 +1417,7 @@ proc incr_font_size {font {amt 1}} {
##
## ui commands
-set starting_gitk_msg {Starting gitk... please wait...}
+set starting_gitk_msg [mc "Starting gitk... please wait..."]
proc do_gitk {revs} {
# -- Always start gitk through whatever we were loaded with. This
@@ -1425,7 +1426,7 @@ proc do_gitk {revs} {
set exe [file join [file dirname $::_git] gitk]
set cmd [list [info nameofexecutable] $exe]
if {! [file exists $exe]} {
- error_popup "Unable to start gitk:\n\n$exe does not exist"
+ error_popup [mc "Unable to start gitk:\n\n%s does not exist" $exe]
} else {
eval exec $cmd $revs &
ui_status $::starting_gitk_msg
@@ -1642,7 +1643,7 @@ proc apply_config {} {
font configure $font $cn $cv
}
} err]} {
- error_popup "Invalid font specified in gui.$name:\n\n$err"
+ error_popup [append [mc "Invalid font specified in gui.%s:" $name] "\n\n$err"]
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv
@@ -1667,8 +1668,8 @@ set default_config(gui.newbranchtemplate) {}
set default_config(gui.fontui) [font configure font_ui]
set default_config(gui.fontdiff) [font configure font_diff]
set font_descs {
- {fontui font_ui {Main Font}}
- {fontdiff font_diff {Diff/Console Font}}
+ {fontui font_ui {mc "Main Font"}}
+ {fontdiff font_diff {mc "Diff/Console Font"}}
}
load_config 0
apply_config
@@ -1682,18 +1683,18 @@ set ui_comm {}
# -- Menu Bar
#
menu .mbar -tearoff 0
-.mbar add cascade -label Repository -menu .mbar.repository
-.mbar add cascade -label Edit -menu .mbar.edit
+.mbar add cascade -label [mc Repository] -menu .mbar.repository
+.mbar add cascade -label [mc Edit] -menu .mbar.edit
if {[is_enabled branch]} {
- .mbar add cascade -label Branch -menu .mbar.branch
+ .mbar add cascade -label [mc Branch] -menu .mbar.branch
}
if {[is_enabled multicommit] || [is_enabled singlecommit]} {
- .mbar add cascade -label Commit -menu .mbar.commit
+ .mbar add cascade -label [mc Commit] -menu .mbar.commit
}
if {[is_enabled transport]} {
- .mbar add cascade -label Merge -menu .mbar.merge
- .mbar add cascade -label Fetch -menu .mbar.fetch
- .mbar add cascade -label Push -menu .mbar.push
+ .mbar add cascade -label [mc Merge] -menu .mbar.merge
+ .mbar add cascade -label [mc Fetch] -menu .mbar.fetch
+ .mbar add cascade -label [mc Push] -menu .mbar.push
}
. configure -menu .mbar
@@ -1702,87 +1703,87 @@ if {[is_enabled transport]} {
menu .mbar.repository
.mbar.repository add command \
- -label {Browse Current Branch's Files} \
+ -label [mc "Browse Current Branch's Files"] \
-command {browser::new $current_branch}
set ui_browse_current [.mbar.repository index last]
.mbar.repository add command \
- -label {Browse Branch Files...} \
+ -label [mc "Browse Branch Files..."] \
-command browser_open::dialog
.mbar.repository add separator
.mbar.repository add command \
- -label {Visualize Current Branch's History} \
+ -label [mc "Visualize Current Branch's History"] \
-command {do_gitk $current_branch}
set ui_visualize_current [.mbar.repository index last]
.mbar.repository add command \
- -label {Visualize All Branch History} \
+ -label [mc "Visualize All Branch History"] \
-command {do_gitk --all}
.mbar.repository add separator
proc current_branch_write {args} {
global current_branch
.mbar.repository entryconf $::ui_browse_current \
- -label "Browse $current_branch's Files"
+ -label [mc "Browse %s's Files" $current_branch]
.mbar.repository entryconf $::ui_visualize_current \
- -label "Visualize $current_branch's History"
+ -label [mc "Visualize %s's History" $current_branch]
}
trace add variable current_branch write current_branch_write
if {[is_enabled multicommit]} {
- .mbar.repository add command -label {Database Statistics} \
+ .mbar.repository add command -label [mc "Database Statistics"] \
-command do_stats
- .mbar.repository add command -label {Compress Database} \
+ .mbar.repository add command -label [mc "Compress Database"] \
-command do_gc
- .mbar.repository add command -label {Verify Database} \
+ .mbar.repository add command -label [mc "Verify Database"] \
-command do_fsck_objects
.mbar.repository add separator
if {[is_Cygwin]} {
.mbar.repository add command \
- -label {Create Desktop Icon} \
+ -label [mc "Create Desktop Icon"] \
-command do_cygwin_shortcut
} elseif {[is_Windows]} {
.mbar.repository add command \
- -label {Create Desktop Icon} \
+ -label [mc "Create Desktop Icon"] \
-command do_windows_shortcut
} elseif {[is_MacOSX]} {
.mbar.repository add command \
- -label {Create Desktop Icon} \
+ -label [mc "Create Desktop Icon"] \
-command do_macosx_app
}
}
-.mbar.repository add command -label Quit \
+.mbar.repository add command -label [mc Quit] \
-command do_quit \
-accelerator $M1T-Q
# -- Edit Menu
#
menu .mbar.edit
-.mbar.edit add command -label Undo \
+.mbar.edit add command -label [mc Undo] \
-command {catch {[focus] edit undo}} \
-accelerator $M1T-Z
-.mbar.edit add command -label Redo \
+.mbar.edit add command -label [mc Redo] \
-command {catch {[focus] edit redo}} \
-accelerator $M1T-Y
.mbar.edit add separator
-.mbar.edit add command -label Cut \
+.mbar.edit add command -label [mc Cut] \
-command {catch {tk_textCut [focus]}} \
-accelerator $M1T-X
-.mbar.edit add command -label Copy \
+.mbar.edit add command -label [mc Copy] \
-command {catch {tk_textCopy [focus]}} \
-accelerator $M1T-C
-.mbar.edit add command -label Paste \
+.mbar.edit add command -label [mc Paste] \
-command {catch {tk_textPaste [focus]; [focus] see insert}} \
-accelerator $M1T-V
-.mbar.edit add command -label Delete \
+.mbar.edit add command -label [mc Delete] \
-command {catch {[focus] delete sel.first sel.last}} \
-accelerator Del
.mbar.edit add separator
-.mbar.edit add command -label {Select All} \
+.mbar.edit add command -label [mc "Select All"] \
-command {catch {[focus] tag add sel 0.0 end}} \
-accelerator $M1T-A
@@ -1791,29 +1792,29 @@ menu .mbar.edit
if {[is_enabled branch]} {
menu .mbar.branch
- .mbar.branch add command -label {Create...} \
+ .mbar.branch add command -label [mc "Create..."] \
-command branch_create::dialog \
-accelerator $M1T-N
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
- .mbar.branch add command -label {Checkout...} \
+ .mbar.branch add command -label [mc "Checkout..."] \
-command branch_checkout::dialog \
-accelerator $M1T-O
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
- .mbar.branch add command -label {Rename...} \
+ .mbar.branch add command -label [mc "Rename..."] \
-command branch_rename::dialog
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
- .mbar.branch add command -label {Delete...} \
+ .mbar.branch add command -label [mc "Delete..."] \
-command branch_delete::dialog
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
- .mbar.branch add command -label {Reset...} \
+ .mbar.branch add command -label [mc "Reset..."] \
-command merge::reset_hard
lappend disable_on_lock [list .mbar.branch entryconf \
[.mbar.branch index last] -state]
@@ -1825,7 +1826,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
menu .mbar.commit
.mbar.commit add radiobutton \
- -label {New Commit} \
+ -label [mc "New Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value new
@@ -1833,7 +1834,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add radiobutton \
- -label {Amend Last Commit} \
+ -label [mc "Amend Last Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value amend
@@ -1842,40 +1843,40 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
.mbar.commit add separator
- .mbar.commit add command -label Rescan \
+ .mbar.commit add command -label [mc Rescan] \
-command do_rescan \
-accelerator F5
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
- .mbar.commit add command -label {Stage To Commit} \
+ .mbar.commit add command -label [mc "Stage To Commit"] \
-command do_add_selection
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
- .mbar.commit add command -label {Stage Changed Files To Commit} \
+ .mbar.commit add command -label [mc "Stage Changed Files To Commit"] \
-command do_add_all \
-accelerator $M1T-I
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
- .mbar.commit add command -label {Unstage From Commit} \
+ .mbar.commit add command -label [mc "Unstage From Commit"] \
-command do_unstage_selection
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
- .mbar.commit add command -label {Revert Changes} \
+ .mbar.commit add command -label [mc "Revert Changes"] \
-command do_revert_selection
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add separator
- .mbar.commit add command -label {Sign Off} \
+ .mbar.commit add command -label [mc "Sign Off"] \
-command do_signoff \
-accelerator $M1T-S
- .mbar.commit add command -label Commit \
+ .mbar.commit add command -label [mc Commit] \
-command do_commit \
-accelerator $M1T-Return
lappend disable_on_lock \
@@ -1886,12 +1887,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
#
if {[is_enabled branch]} {
menu .mbar.merge
- .mbar.merge add command -label {Local Merge...} \
+ .mbar.merge add command -label [mc "Local Merge..."] \
-command merge::dialog \
-accelerator $M1T-M
lappend disable_on_lock \
[list .mbar.merge entryconf [.mbar.merge index last] -state]
- .mbar.merge add command -label {Abort Merge...} \
+ .mbar.merge add command -label [mc "Abort Merge..."] \
-command merge::reset_hard
lappend disable_on_lock \
[list .mbar.merge entryconf [.mbar.merge index last] -state]
@@ -1903,38 +1904,38 @@ if {[is_enabled transport]} {
menu .mbar.fetch
menu .mbar.push
- .mbar.push add command -label {Push...} \
+ .mbar.push add command -label [mc "Push..."] \
-command do_push_anywhere \
-accelerator $M1T-P
- .mbar.push add command -label {Delete...} \
+ .mbar.push add command -label [mc "Delete..."] \
-command remote_branch_delete::dialog
}
if {[is_MacOSX]} {
# -- Apple Menu (Mac OS X only)
#
- .mbar add cascade -label Apple -menu .mbar.apple
+ .mbar add cascade -label [mc Apple] -menu .mbar.apple
menu .mbar.apple
- .mbar.apple add command -label "About [appname]" \
+ .mbar.apple add command -label [mc "About %s" [appname]] \
-command do_about
- .mbar.apple add command -label "Options..." \
+ .mbar.apple add command -label [mc "Options..."] \
-command do_options
} else {
# -- Edit Menu
#
.mbar.edit add separator
- .mbar.edit add command -label {Options...} \
+ .mbar.edit add command -label [mc "Options..."] \
-command do_options
}
# -- Help Menu
#
-.mbar add cascade -label Help -menu .mbar.help
+.mbar add cascade -label [mc Help] -menu .mbar.help
menu .mbar.help
if {![is_MacOSX]} {
- .mbar.help add command -label "About [appname]" \
+ .mbar.help add command -label [mc "About %s" [appname]] \
-command do_about
}
@@ -1971,7 +1972,7 @@ if {[file isfile $doc_path]} {
}
if {$browser ne {}} {
- .mbar.help add command -label {Online Documentation} \
+ .mbar.help add command -label [mc "Online Documentation"] \
-command [list exec $browser $doc_url &]
}
unset browser doc_path doc_url
@@ -2093,7 +2094,7 @@ frame .branch \
-borderwidth 1 \
-relief sunken
label .branch.l1 \
- -text {Current Branch:} \
+ -text [mc "Current Branch:"] \
-anchor w \
-justify left
label .branch.cb \
@@ -2114,7 +2115,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
# -- Index File List
#
frame .vpane.files.index -height 100 -width 200
-label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
+label .vpane.files.index.title -text [mc "Staged Changes (Will Be Committed)"] \
-background lightgreen
text $ui_index -background white -borderwidth 0 \
-width 20 -height 10 \
@@ -2134,7 +2135,7 @@ pack $ui_index -side left -fill both -expand 1
# -- Working Directory File List
#
frame .vpane.files.workdir -height 100 -width 200
-label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
+label .vpane.files.workdir.title -text [mc "Unstaged Changes (Will Not Be Committed)"] \
-background lightsalmon
text $ui_workdir -background white -borderwidth 0 \
-width 20 -height 10 \
@@ -2175,29 +2176,29 @@ label .vpane.lower.commarea.buttons.l -text {} \
pack .vpane.lower.commarea.buttons.l -side top -fill x
pack .vpane.lower.commarea.buttons -side left -fill y
-button .vpane.lower.commarea.buttons.rescan -text {Rescan} \
+button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
-command do_rescan
pack .vpane.lower.commarea.buttons.rescan -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.rescan conf -state}
-button .vpane.lower.commarea.buttons.incall -text {Stage Changed} \
+button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
-command do_add_all
pack .vpane.lower.commarea.buttons.incall -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.incall conf -state}
-button .vpane.lower.commarea.buttons.signoff -text {Sign Off} \
+button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
-command do_signoff
pack .vpane.lower.commarea.buttons.signoff -side top -fill x
-button .vpane.lower.commarea.buttons.commit -text {Commit} \
+button .vpane.lower.commarea.buttons.commit -text [mc Commit] \
-command do_commit
pack .vpane.lower.commarea.buttons.commit -side top -fill x
lappend disable_on_lock \
{.vpane.lower.commarea.buttons.commit conf -state}
-button .vpane.lower.commarea.buttons.push -text {Push} \
+button .vpane.lower.commarea.buttons.push -text [mc Push] \
-command do_push_anywhere
pack .vpane.lower.commarea.buttons.push -side top -fill x
@@ -2208,14 +2209,14 @@ frame .vpane.lower.commarea.buffer.header
set ui_comm .vpane.lower.commarea.buffer.t
set ui_coml .vpane.lower.commarea.buffer.header.l
radiobutton .vpane.lower.commarea.buffer.header.new \
- -text {New Commit} \
+ -text [mc "New Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value new
lappend disable_on_lock \
[list .vpane.lower.commarea.buffer.header.new conf -state]
radiobutton .vpane.lower.commarea.buffer.header.amend \
- -text {Amend Last Commit} \
+ -text [mc "Amend Last Commit"] \
-command do_select_commit_type \
-variable selected_commit_type \
-value amend
@@ -2227,12 +2228,12 @@ label $ui_coml \
proc trace_commit_type {varname args} {
global ui_coml commit_type
switch -glob -- $commit_type {
- initial {set txt {Initial Commit Message:}}
- amend {set txt {Amended Commit Message:}}
- amend-initial {set txt {Amended Initial Commit Message:}}
- amend-merge {set txt {Amended Merge Commit Message:}}
- merge {set txt {Merge Commit Message:}}
- * {set txt {Commit Message:}}
+ initial {set txt [mc "Initial Commit Message:"]}
+ amend {set txt [mc "Amended Commit Message:"]}
+ amend-initial {set txt [mc "Amended Initial Commit Message:"]}
+ amend-merge {set txt [mc "Amended Merge Commit Message:"]}
+ merge {set txt [mc "Merge Commit Message:"]}
+ * {set txt [mc "Commit Message:"]}
}
$ui_coml conf -text $txt
}
@@ -2261,23 +2262,23 @@ pack .vpane.lower.commarea.buffer -side left -fill y
set ctxm .vpane.lower.commarea.buffer.ctxm
menu $ctxm -tearoff 0
$ctxm add command \
- -label {Cut} \
+ -label [mc Cut] \
-command {tk_textCut $ui_comm}
$ctxm add command \
- -label {Copy} \
+ -label [mc Copy] \
-command {tk_textCopy $ui_comm}
$ctxm add command \
- -label {Paste} \
+ -label [mc Paste] \
-command {tk_textPaste $ui_comm}
$ctxm add command \
- -label {Delete} \
+ -label [mc Delete] \
-command {$ui_comm delete sel.first sel.last}
$ctxm add separator
$ctxm add command \
- -label {Select All} \
+ -label [mc "Select All"] \
-command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
$ctxm add command \
- -label {Copy All} \
+ -label [mc "Copy All"] \
-command {
$ui_comm tag add sel 0.0 end
tk_textCopy $ui_comm
@@ -2285,7 +2286,7 @@ $ctxm add command \
}
$ctxm add separator
$ctxm add command \
- -label {Sign Off} \
+ -label [mc "Sign Off"] \
-command do_signoff
bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
@@ -2301,7 +2302,7 @@ proc trace_current_diff_path {varname args} {
} else {
set p $current_diff_path
set s [mapdesc [lindex $file_states($p) 0] $p]
- set f {File:}
+ set f [mc "File:"]
set p [escape_path $p]
set o normal
}
@@ -2335,7 +2336,7 @@ pack .vpane.lower.diff.header.path -fill x
set ctxm .vpane.lower.diff.header.ctxm
menu $ctxm -tearoff 0
$ctxm add command \
- -label {Copy} \
+ -label [mc Copy] \
-command {
clipboard clear
clipboard append \
@@ -2403,19 +2404,19 @@ $ui_diff tag raise sel
set ctxm .vpane.lower.diff.body.ctxm
menu $ctxm -tearoff 0
$ctxm add command \
- -label {Refresh} \
+ -label [mc Refresh] \
-command reshow_diff
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
- -label {Copy} \
+ -label [mc Copy] \
-command {tk_textCopy $ui_diff}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
- -label {Select All} \
+ -label [mc "Select All"] \
-command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
- -label {Copy All} \
+ -label [mc "Copy All"] \
-command {
$ui_diff tag add sel 0.0 end
tk_textCopy $ui_diff
@@ -2424,36 +2425,36 @@ $ctxm add command \
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command \
- -label {Apply/Reverse Hunk} \
+ -label [mc "Apply/Reverse Hunk"] \
-command {apply_hunk $cursorX $cursorY}
set ui_diff_applyhunk [$ctxm index last]
lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
$ctxm add separator
$ctxm add command \
- -label {Decrease Font Size} \
+ -label [mc "Decrease Font Size"] \
-command {incr_font_size font_diff -1}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
- -label {Increase Font Size} \
+ -label [mc "Increase Font Size"] \
-command {incr_font_size font_diff 1}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command \
- -label {Show Less Context} \
+ -label [mc "Show Less Context"] \
-command {if {$repo_config(gui.diffcontext) >= 1} {
incr repo_config(gui.diffcontext) -1
reshow_diff
}}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
- -label {Show More Context} \
+ -label [mc "Show More Context"] \
-command {if {$repo_config(gui.diffcontext) < 99} {
incr repo_config(gui.diffcontext)
reshow_diff
}}
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
-$ctxm add command -label {Options...} \
+$ctxm add command -label [mc "Options..."] \
-command do_options
proc popup_diff_menu {ctxm x y X Y} {
global current_diff_path file_states
@@ -2461,7 +2462,7 @@ proc popup_diff_menu {ctxm x y X Y} {
set ::cursorY $y
if {$::ui_index eq $::current_diff_side} {
set s normal
- set l "Unstage Hunk From Commit"
+ set l [mc "Unstage Hunk From Commit"]
} else {
if {$current_diff_path eq {}
|| ![info exists file_states($current_diff_path)]
@@ -2470,7 +2471,7 @@ proc popup_diff_menu {ctxm x y X Y} {
} else {
set s normal
}
- set l "Stage Hunk For Commit"
+ set l [mc "Stage Hunk For Commit"]
}
if {$::is_3way_diff} {
set s disabled
@@ -2484,7 +2485,7 @@ bind_button3 $ui_diff [list popup_diff_menu $ctxm %x %y %X %Y]
#
set main_status [::status_bar::new .status]
pack .status -anchor w -side bottom -fill x
-$main_status show {Initializing...}
+$main_status show [mc "Initializing..."]
# -- Load geometry
#
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 9607284..b5fdad5 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -74,11 +74,11 @@ constructor new {i_commit i_path} {
set path $i_path
make_toplevel top w
- wm title $top "[appname] ([reponame]): File Viewer"
+ wm title $top [append "[appname] ([reponame]): " [mc "File Viewer"]]
frame $w.header -background gold
label $w.header.commit_l \
- -text {Commit:} \
+ -text [mc "Commit:"] \
-background gold \
-anchor w \
-justify left
@@ -101,7 +101,7 @@ constructor new {i_commit i_path} {
-anchor w \
-justify left
label $w.header.path_l \
- -text {File:} \
+ -text [mc "File:"] \
-background gold \
-anchor w \
-justify left
@@ -246,7 +246,7 @@ constructor new {i_commit i_path} {
menu $w.ctxm -tearoff 0
$w.ctxm add command \
- -label "Copy Commit" \
+ -label [mc "Copy Commit"] \
-command [cb _copycommit]
foreach i $w_columns {
@@ -366,7 +366,7 @@ method _load {jump} {
set amov_data [list [list]]
set asim_data [list [list]]
- $status show "Reading $commit:[escape_path $path]..."
+ $status show [mc "Reading %s..." "$commit:[escape_path $path]"]
$w_path conf -text [escape_path $path]
if {$commit eq {}} {
set fd [open $path r]
diff --git a/lib/branch_checkout.tcl b/lib/branch_checkout.tcl
index 72c45b4..6603703 100644
--- a/lib/branch_checkout.tcl
+++ b/lib/branch_checkout.tcl
@@ -11,37 +11,37 @@ field opt_detach 0; # force a detached head case?
constructor dialog {} {
make_toplevel top w
- wm title $top "[appname] ([reponame]): Checkout Branch"
+ wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- label $w.header -text {Checkout Branch} -font font_uibold
+ label $w.header -text [mc "Checkout Branch"] -font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.create -text Checkout \
+ button $w.buttons.create -text [mc Checkout] \
-default active \
-command [cb _checkout]
pack $w.buttons.create -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- set w_rev [::choose_rev::new $w.rev {Revision}]
+ set w_rev [::choose_rev::new $w.rev [mc Revision]]
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
- labelframe $w.options -text {Options}
+ labelframe $w.options -text [mc Options]
checkbutton $w.options.fetch \
- -text {Fetch Tracking Branch} \
+ -text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw
checkbutton $w.options.detach \
- -text {Detach From Local Branch} \
+ -text [mc "Detach From Local Branch"] \
-variable @opt_detach
pack $w.options.detach -anchor nw
diff --git a/lib/branch_create.tcl b/lib/branch_create.tcl
index def615d..53dfb4c 100644
--- a/lib/branch_create.tcl
+++ b/lib/branch_create.tcl
@@ -19,28 +19,28 @@ constructor dialog {} {
global repo_config
make_toplevel top w
- wm title $top "[appname] ([reponame]): Create Branch"
+ wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- label $w.header -text {Create New Branch} -font font_uibold
+ label $w.header -text [mc "Create New Branch"] -font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.create -text Create \
+ button $w.buttons.create -text [mc Create] \
-default active \
-command [cb _create]
pack $w.buttons.create -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- labelframe $w.desc -text {Branch Name}
+ labelframe $w.desc -text [mc "Branch Name"]
radiobutton $w.desc.name_r \
-anchor w \
- -text {Name:} \
+ -text [mc "Name:"] \
-value user \
-variable @name_type
set w_name $w.desc.name_t
@@ -55,7 +55,7 @@ constructor dialog {} {
radiobutton $w.desc.match_r \
-anchor w \
- -text {Match Tracking Branch Name} \
+ -text [mc "Match Tracking Branch Name"] \
-value match \
-variable @name_type
grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2
@@ -63,38 +63,38 @@ constructor dialog {} {
grid columnconfigure $w.desc 1 -weight 1
pack $w.desc -anchor nw -fill x -pady 5 -padx 5
- set w_rev [::choose_rev::new $w.rev {Starting Revision}]
+ set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
- labelframe $w.options -text {Options}
+ labelframe $w.options -text [mc Options]
frame $w.options.merge
- label $w.options.merge.l -text {Update Existing Branch:}
+ label $w.options.merge.l -text [mc "Update Existing Branch:"]
pack $w.options.merge.l -side left
radiobutton $w.options.merge.no \
- -text No \
+ -text [mc No] \
-value none \
-variable @opt_merge
pack $w.options.merge.no -side left
radiobutton $w.options.merge.ff \
- -text {Fast Forward Only} \
+ -text [mc "Fast Forward Only"] \
-value ff \
-variable @opt_merge
pack $w.options.merge.ff -side left
radiobutton $w.options.merge.reset \
- -text {Reset} \
+ -text [mc Reset] \
-value reset \
-variable @opt_merge
pack $w.options.merge.reset -side left
pack $w.options.merge -anchor nw
checkbutton $w.options.fetch \
- -text {Fetch Tracking Branch} \
+ -text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw
checkbutton $w.options.checkout \
- -text {Checkout After Creation} \
+ -text [mc "Checkout After Creation"] \
-variable @opt_checkout
pack $w.options.checkout -anchor nw
pack $w.options -anchor nw -fill x -pady 5 -padx 5
@@ -128,7 +128,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Please select a tracking branch."
+ -message [mc "Please select a tracking branch."]
return
}
if {![regsub ^refs/heads/ [lindex $spec 2] {} newbranch]} {
@@ -137,7 +137,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Tracking branch [$w get] is not a branch in the remote repository."
+ -message [mc "Tracking branch %s is not a branch in the remote repository." [$w get]]
return
}
}
@@ -150,7 +150,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Please supply a branch name."
+ -message [mc "Please supply a branch name."]
focus $w_name
return
}
@@ -161,7 +161,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "'$newbranch' is not an acceptable branch name."
+ -message [mc "'%s' is not an acceptable branch name." $newbranch]
focus $w_name
return
}
diff --git a/lib/branch_delete.tcl b/lib/branch_delete.tcl
index c7573c6..86c4f73 100644
--- a/lib/branch_delete.tcl
+++ b/lib/branch_delete.tcl
@@ -12,29 +12,29 @@ constructor dialog {} {
global current_branch
make_toplevel top w
- wm title $top "[appname] ([reponame]): Delete Branch"
+ wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- label $w.header -text {Delete Local Branch} -font font_uibold
+ label $w.header -text [mc "Delete Local Branch"] -font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
set w_delete $w.buttons.delete
button $w_delete \
- -text Delete \
+ -text [mc Delete] \
-default active \
-state disabled \
-command [cb _delete]
pack $w_delete -side right
button $w.buttons.cancel \
- -text {Cancel} \
+ -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- labelframe $w.list -text {Local Branches}
+ labelframe $w.list -text [mc "Local Branches"]
set w_heads $w.list.l
listbox $w_heads \
-height 10 \
@@ -49,9 +49,9 @@ constructor dialog {} {
set w_check [choose_rev::new \
$w.check \
- {Delete Only If Merged Into} \
+ [mc "Delete Only If Merged Into"] \
]
- $w_check none {Always (Do not perform merge test.)}
+ $w_check none [mc "Always (Do not perform merge test.)"]
pack $w.check -anchor nw -fill x -pady 5 -padx 5
foreach h [load_all_heads] {
@@ -100,7 +100,7 @@ method _delete {} {
lappend to_delete [list $b $o]
}
if {$not_merged ne {}} {
- set msg "The following branches are not completely merged into [$w_check get]:
+ set msg "[mc "The following branches are not completely merged into %s:" [$w_check get]]
- [join $not_merged "\n - "]"
tk_messageBox \
@@ -112,9 +112,7 @@ method _delete {} {
}
if {$to_delete eq {}} return
if {$check_cmt eq {}} {
- set msg {Recovering deleted branches is difficult.
-
-Delete the selected branches?}
+ set msg [mc "Recovering deleted branches is difficult. \n\n Delete the selected branches?"]
if {[tk_messageBox \
-icon warning \
-type yesno \
@@ -140,7 +138,7 @@ Delete the selected branches?}
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Failed to delete branches:\n$failed"
+ -message [mc "Failed to delete branches:\n%s" $failed]
}
destroy $w
diff --git a/lib/branch_rename.tcl b/lib/branch_rename.tcl
index 1cadc31..d6f040e 100644
--- a/lib/branch_rename.tcl
+++ b/lib/branch_rename.tcl
@@ -11,7 +11,7 @@ constructor dialog {} {
global current_branch
make_toplevel top w
- wm title $top "[appname] ([reponame]): Rename Branch"
+ wm title $top [append "[appname] ([reponame]): " [mc "Rename Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
@@ -19,24 +19,24 @@ constructor dialog {} {
set oldname $current_branch
set newname [get_config gui.newbranchtemplate]
- label $w.header -text {Rename Branch} -font font_uibold
+ label $w.header -text [mc "Rename Branch"] -font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.rename -text Rename \
+ button $w.buttons.rename -text [mc Rename] \
-default active \
-command [cb _rename]
pack $w.buttons.rename -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
frame $w.rename
- label $w.rename.oldname_l -text {Branch:}
+ label $w.rename.oldname_l -text [mc "Branch:"]
eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
- label $w.rename.newname_l -text {New Name:}
+ label $w.rename.newname_l -text [mc "New Name:"]
entry $w.rename.newname_t \
-borderwidth 1 \
-relief sunken \
@@ -72,7 +72,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Please select a branch to rename."
+ -message [mc "Please select a branch to rename."]
focus $w.rename.oldname_m
return
}
@@ -83,7 +83,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Please supply a branch name."
+ -message [mc "Please supply a branch name."]
focus $w.rename.newname_t
return
}
@@ -93,7 +93,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Branch '$newname' already exists."
+ -message [mc "Branch '%s' already exists." $newname]
focus $w.rename.newname_t
return
}
@@ -103,7 +103,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "We do not like '$newname' as a branch name."
+ -message [mc "'%s' is not an acceptable branch name." $newname]
focus $w.rename.newname_t
return
}
@@ -114,7 +114,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Failed to rename '$oldname'.\n\n$err"
+ -message [append [mc "Failed to rename '%s'." $oldname] "\n\n$err"]
return
}
diff --git a/lib/browser.tcl b/lib/browser.tcl
index 888db3c..9876229 100644
--- a/lib/browser.tcl
+++ b/lib/browser.tcl
@@ -14,7 +14,7 @@ field w
field browser_commit
field browser_path
field browser_files {}
-field browser_status {Starting...}
+field browser_status [mc "Starting..."]
field browser_stack {}
field browser_busy 1
@@ -23,7 +23,7 @@ field ls_buf {}; # Buffered record output from ls-tree
constructor new {commit {path {}}} {
global cursor_ptr M1B
make_toplevel top w
- wm title $top "[appname] ([reponame]): File Browser"
+ wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
set browser_commit $commit
set browser_path $browser_commit:$path
@@ -124,7 +124,7 @@ method _parent {} {
} else {
regsub {/[^/]+$} $browser_path {} browser_path
}
- set browser_status "Loading $browser_path..."
+ set browser_status [mc "Loading %s..." $browser_path]
_ls $this [lindex $parent 0] [lindex $parent 1]
}
}
@@ -141,7 +141,7 @@ method _enter {} {
tree {
set name [lindex $info 2]
set escn [escape_path $name]
- set browser_status "Loading $escn..."
+ set browser_status [mc "Loading %s..." $escn]
append browser_path $escn
_ls $this [lindex $info 1] $name
}
@@ -185,7 +185,7 @@ method _ls {tree_id {name {}}} {
-align center -padx 5 -pady 1 \
-name icon0 \
-image ::browser::img_parent
- $w insert end {[Up To Parent]}
+ $w insert end [mc "\[Up To Parent\]"]
lappend browser_files parent
}
lappend browser_stack [list $tree_id $name]
@@ -244,7 +244,7 @@ method _read {fd} {
if {[eof $fd]} {
close $fd
- set browser_status Ready.
+ set browser_status [mc "Ready."]
set browser_busy 0
set ls_buf {}
if {$n > 0} {
@@ -265,27 +265,27 @@ field w_rev ; # mega-widget to pick the initial revision
constructor dialog {} {
make_toplevel top w
- wm title $top "[appname] ([reponame]): Browse Branch Files"
+ wm title $top [append "[appname] ([reponame]): " [mc "Browse Branch Files"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
label $w.header \
- -text {Browse Branch Files} \
+ -text [mc "Browse Branch Files"] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.browse -text Browse \
+ button $w.buttons.browse -text [mc Browse] \
-default active \
-command [cb _open]
pack $w.buttons.browse -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- set w_rev [::choose_rev::new $w.rev {Revision}]
+ set w_rev [::choose_rev::new $w.rev [mc Revision]]
$w_rev bind_listbox <Double-Button-1> [cb _open]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
diff --git a/lib/checkout_op.tcl b/lib/checkout_op.tcl
index 170f737..b98c9cb 100644
--- a/lib/checkout_op.tcl
+++ b/lib/checkout_op.tcl
@@ -76,7 +76,7 @@ method run {} {
_toplevel $this {Refreshing Tracking Branch}
set w_cons [::console::embed \
$w.console \
- "Fetching $r_name from $remote"]
+ [mc "Fetching %s from %s" $r_name $remote]]
pack $w.console -fill both -expand 1
$w_cons exec $cmd [cb _finish_fetch]
@@ -137,7 +137,7 @@ method _finish_fetch {ok} {
destroy $w
set w {}
} else {
- button $w.close -text Close -command [list destroy $w]
+ button $w.close -text [mc Close] -command [list destroy $w]
pack $w.close -side bottom -anchor e -padx 10 -pady 10
}
@@ -166,7 +166,7 @@ method _update_ref {} {
# Assume it does not exist, and that is what the error was.
#
if {!$create} {
- _error $this "Branch '$newbranch' does not exist."
+ _error $this [mc "Branch '%s' does not exist." $newbranch]
return 0
}
@@ -176,7 +176,7 @@ method _update_ref {} {
# We were told to create it, but not do a merge.
# Bad. Name shouldn't have existed.
#
- _error $this "Branch '$newbranch' already exists."
+ _error $this [mc "Branch '%s' already exists." $newbranch]
return 0
} elseif {!$create && $merge_type eq {none}} {
# We aren't creating, it exists and we don't merge.
@@ -203,7 +203,7 @@ method _update_ref {} {
set new $cur
set new_hash $cur
} else {
- _error $this "Branch '$newbranch' already exists.\n\nIt cannot fast-forward to $new_expr.\nA merge is required."
+ _error $this [mc "Branch '%s' already exists.\n\nIt cannot fast-forward to %s.\nA merge is required." $newbranch $new_expr]
return 0
}
}
@@ -217,7 +217,7 @@ method _update_ref {} {
}
}
default {
- _error $this "Merge strategy '$merge_type' not supported."
+ _error $this [mc "Merge strategy '%s' not supported." $merge_type]
return 0
}
}
@@ -236,7 +236,7 @@ method _update_ref {} {
if {[catch {
git update-ref -m $reflog_msg $ref $new $cur
} err]} {
- _error $this "Failed to update '$newbranch'.\n\n$err"
+ _error $this [append [mc "Failed to update '%s'." $newbranch] "\n\n$err"]
return 0
}
}
@@ -248,7 +248,7 @@ method _checkout {} {
if {[lock_index checkout_op]} {
after idle [cb _start_checkout]
} else {
- _error $this "Staging area (index) is already locked."
+ _error $this [mc "Staging area (index) is already locked."]
delete_this
}
}
@@ -263,12 +263,12 @@ method _start_checkout {} {
&& $curType eq {normal}
&& $curHEAD eq $HEAD} {
} elseif {$commit_type ne $curType || $HEAD ne $curHEAD} {
- info_popup {Last scanned state does not match repository state.
+ info_popup [mc "Last scanned state does not match repository state.
Another Git program has modified this repository since the last scan. A rescan must be performed before the current branch can be changed.
The rescan will be automatically started now.
-}
+"]
unlock_index
rescan ui_ready
delete_this
@@ -350,12 +350,12 @@ method _readtree_wait {fd} {
if {[catch {close $fd}]} {
set err $readtree_d
regsub {^fatal: } $err {} err
- $::main_status stop "Aborted checkout of '[_name $this]' (file level merging is required)."
- warn_popup "File level merge required.
+ $::main_status stop [mc "Aborted checkout of '%s' (file level merging is required)." [_name $this]]
+ warn_popup [append [mc "File level merge required."] "
$err
-Staying on branch '$current_branch'."
+" [mc "Staying on branch '%s'." $current_branch]]
unlock_index
delete_this
return
@@ -426,9 +426,9 @@ method _after_readtree {} {
}
if {$is_detached} {
- info_popup "You are no longer on a local branch.
+ info_popup [mc "You are no longer on a local branch.
-If you wanted to be on a branch, create one now starting from 'This Detached Checkout'."
+If you wanted to be on a branch, create one now starting from 'This Detached Checkout'."]
}
# -- Update our repository state. If we were previously in
@@ -475,7 +475,7 @@ method _confirm_reset {cur} {
pack [label $w.msg1 \
-anchor w \
-justify left \
- -text "Resetting '$name' to $new_expr will lose the following commits:" \
+ -text [mc "Resetting '%s' to '%s' will lose the following commits:" $name $new_expr]\
] -anchor w
set list $w.list.l
@@ -497,21 +497,21 @@ method _confirm_reset {cur} {
pack [label $w.msg2 \
-anchor w \
-justify left \
- -text {Recovering lost commits may not be easy.} \
+ -text [mc "Recovering lost commits may not be easy."] \
]
pack [label $w.msg3 \
-anchor w \
-justify left \
- -text "Reset '$name'?" \
+ -text [mc "Reset '%s'?" $name] \
]
frame $w.buttons
button $w.buttons.visualize \
- -text Visualize \
+ -text [mc Visualize] \
-command $gitk
pack $w.buttons.visualize -side left
button $w.buttons.reset \
- -text Reset \
+ -text [mc Reset] \
-command "
set @reset_ok 1
destroy $w
@@ -519,7 +519,7 @@ method _confirm_reset {cur} {
pack $w.buttons.reset -side right
button $w.buttons.cancel \
-default active \
- -text Cancel \
+ -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -575,13 +575,13 @@ method _toplevel {title} {
}
method _fatal {err} {
- error_popup "Failed to set current branch.
+ error_popup [append [mc "Failed to set current branch.
This working directory is only partially switched. We successfully updated your files, but failed to update an internal Git file.
-This should not have occurred. [appname] will now close and give up.
+This should not have occurred. %s will now close and give up." [appname]] "
-$err"
+$err"]
exit 1
}
diff --git a/lib/choose_rev.tcl b/lib/choose_rev.tcl
index ec064b3..a58b752 100644
--- a/lib/choose_rev.tcl
+++ b/lib/choose_rev.tcl
@@ -50,14 +50,14 @@ constructor _new {path unmerged_only title} {
if {$is_detached} {
radiobutton $w.detachedhead_r \
-anchor w \
- -text {This Detached Checkout} \
+ -text [mc "This Detached Checkout"] \
-value HEAD \
-variable @revtype
grid $w.detachedhead_r -sticky we -padx {0 5} -columnspan 2
}
radiobutton $w.expr_r \
- -text {Revision Expression:} \
+ -text [mc "Revision Expression:"] \
-value expr \
-variable @revtype
entry $w.expr_t \
@@ -71,17 +71,17 @@ constructor _new {path unmerged_only title} {
frame $w.types
radiobutton $w.types.head_r \
- -text {Local Branch} \
+ -text [mc "Local Branch"] \
-value head \
-variable @revtype
pack $w.types.head_r -side left
radiobutton $w.types.trck_r \
- -text {Tracking Branch} \
+ -text [mc "Tracking Branch"] \
-value trck \
-variable @revtype
pack $w.types.trck_r -side left
radiobutton $w.types.tag_r \
- -text {Tag} \
+ -text [mc "Tag"] \
-value tag \
-variable @revtype
pack $w.types.tag_r -side left
@@ -314,7 +314,7 @@ method commit_or_die {} {
}
set top [winfo toplevel $w]
- set msg "Invalid revision: [get $this]\n\n$err"
+ set msg [append [mc "Invalid revision: %s" [get $this]] "\n\n$err"]
tk_messageBox \
-icon error \
-type ok \
@@ -335,7 +335,7 @@ method _expr {} {
if {$i ne {}} {
return [lindex $cur_specs $i 1]
} else {
- error "No revision selected."
+ error [mc "No revision selected."]
}
}
@@ -343,7 +343,7 @@ method _expr {} {
if {$c_expr ne {}} {
return $c_expr
} else {
- error "Revision expression is empty."
+ error [mc "Revision expression is empty."]
}
}
HEAD { return HEAD }
diff --git a/lib/commit.tcl b/lib/commit.tcl
index f857a2f..15489c6 100644
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
@@ -6,19 +6,19 @@ proc load_last_commit {} {
global repo_config
if {[llength $PARENT] == 0} {
- error_popup {There is nothing to amend.
+ error_popup [mc "There is nothing to amend.
You are about to create the initial commit. There is no commit before this to amend.
-}
+"]
return
}
repository_state curType curHEAD curMERGE_HEAD
if {$curType eq {merge}} {
- error_popup {Cannot amend while merging.
+ error_popup [mc "Cannot amend while merging.
You are currently in the middle of a merge that has not been fully completed. You cannot amend the prior commit unless you first abort the current merge activity.
-}
+"]
return
}
@@ -46,7 +46,7 @@ You are currently in the middle of a merge that has not been fully completed. Y
}
set msg [string trim $msg]
} err]} {
- error_popup "Error loading commit data for amend:\n\n$err"
+ error_popup [append [mc "Error loading commit data for amend:"] "\n\n$err"]
return
}
@@ -73,12 +73,12 @@ proc committer_ident {} {
if {$GIT_COMMITTER_IDENT eq {}} {
if {[catch {set me [git var GIT_COMMITTER_IDENT]} err]} {
- error_popup "Unable to obtain your identity:\n\n$err"
+ error_popup [append [mc "Unable to obtain your identity:"] "\n\n$err"]
return {}
}
if {![regexp {^(.*) [0-9]+ [-+0-9]+$} \
$me me GIT_COMMITTER_IDENT]} {
- error_popup "Invalid GIT_COMMITTER_IDENT:\n\n$me"
+ error_popup [append [mc "Invalid GIT_COMMITTER_IDENT:"] "\n\n$me"]
return {}
}
}
@@ -130,12 +130,12 @@ proc commit_tree {} {
&& $curType eq {normal}
&& $curHEAD eq $HEAD} {
} elseif {$commit_type ne $curType || $HEAD ne $curHEAD} {
- info_popup {Last scanned state does not match repository state.
+ info_popup [mc "Last scanned state does not match repository state.
Another Git program has modified this repository since the last scan. A rescan must be performed before another commit can be created.
The rescan will be automatically started now.
-}
+"]
unlock_index
rescan ui_ready
return
@@ -151,26 +151,26 @@ The rescan will be automatically started now.
D? -
M? {set files_ready 1}
U? {
- error_popup "Unmerged files cannot be committed.
+ error_popup [mc "Unmerged files cannot be committed.
-File [short_path $path] has merge conflicts. You must resolve them and stage the file before committing.
-"
+File %s has merge conflicts. You must resolve them and stage the file before committing.
+" [short_path $path]]
unlock_index
return
}
default {
- error_popup "Unknown file state [lindex $s 0] detected.
+ error_popup [mc "Unknown file state %s detected.
-File [short_path $path] cannot be committed by this program.
-"
+File %s cannot be committed by this program.
+" [lindex $s 0] [short_path $path]]
}
}
}
if {!$files_ready && ![string match *merge $curType]} {
- info_popup {No changes to commit.
+ info_popup [mc "No changes to commit.
You must stage at least 1 file before you can commit.
-}
+"]
unlock_index
return
}
@@ -180,14 +180,14 @@ You must stage at least 1 file before you can commit.
set msg [string trim [$ui_comm get 1.0 end]]
regsub -all -line {[ \t\r]+$} $msg {} msg
if {$msg eq {}} {
- error_popup {Please supply a commit message.
+ error_popup [mc "Please supply a commit message.
A good commit message has the following format:
- First line: Describe in one sentance what you did.
- Second line: Blank
- Remaining lines: Describe why this change is good.
-}
+"]
unlock_index
return
}
@@ -254,7 +254,7 @@ proc commit_committree {fd_wt curHEAD msg} {
gets $fd_wt tree_id
if {$tree_id eq {} || [catch {close $fd_wt} err]} {
- error_popup "write-tree failed:\n\n$err"
+ error_popup [append [mc "write-tree failed:"] "\n\n$err"]
ui_status {Commit failed.}
unlock_index
return
@@ -276,14 +276,14 @@ proc commit_committree {fd_wt curHEAD msg} {
}
if {$tree_id eq $old_tree} {
- info_popup {No changes to commit.
+ info_popup [mc "No changes to commit.
No files were modified by this commit and it was not a merge commit.
A rescan will be automatically started now.
-}
+"]
unlock_index
- rescan {ui_status {No changes to commit.}}
+ rescan {ui_status [mc "No changes to commit."]}
return
}
}
@@ -314,7 +314,7 @@ A rescan will be automatically started now.
}
lappend cmd <$msg_p
if {[catch {set cmt_id [eval git $cmd]} err]} {
- error_popup "commit-tree failed:\n\n$err"
+ error_popup [append [mc "commit-tree failed:"] "\n\n$err"]
ui_status {Commit failed.}
unlock_index
return
@@ -336,7 +336,7 @@ A rescan will be automatically started now.
if {[catch {
git update-ref -m $reflogm HEAD $cmt_id $curHEAD
} err]} {
- error_popup "update-ref failed:\n\n$err"
+ error_popup [append [mc "update-ref failed:"] "\n\n$err"]
ui_status {Commit failed.}
unlock_index
return
@@ -427,5 +427,5 @@ A rescan will be automatically started now.
display_all_files
unlock_index
reshow_diff
- ui_status "Created commit [string range $cmt_id 0 7]: $subject"
+ ui_status [mc "Created commit %s: %s" [string range $cmt_id 0 7] $subject]
}
diff --git a/lib/console.tcl b/lib/console.tcl
index 6f718fb..e5f9ba4 100644
--- a/lib/console.tcl
+++ b/lib/console.tcl
@@ -52,7 +52,7 @@ method _init {} {
-state disabled \
-xscrollcommand [list $w.m.sbx set] \
-yscrollcommand [list $w.m.sby set]
- label $w.m.s -text {Working... please wait...} \
+ label $w.m.s -text [mc "Working... please wait..."] \
-anchor w \
-justify left \
-font font_uibold
@@ -66,11 +66,11 @@ method _init {} {
pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
menu $w.ctxm -tearoff 0
- $w.ctxm add command -label "Copy" \
+ $w.ctxm add command -label [mc "Copy"] \
-command "tk_textCopy $w.m.t"
- $w.ctxm add command -label "Select All" \
+ $w.ctxm add command -label [mc "Select All"] \
-command "focus $w.m.t;$w.m.t tag add sel 0.0 end"
- $w.ctxm add command -label "Copy All" \
+ $w.ctxm add command -label [mc "Copy All"] \
-command "
$w.m.t tag add sel 0.0 end
tk_textCopy $w.m.t
@@ -78,7 +78,7 @@ method _init {} {
"
if {$is_toplevel} {
- button $w.ok -text {Close} \
+ button $w.ok -text [mc "Close"] \
-state disabled \
-command [list destroy $w]
pack $w.ok -side bottom -anchor e -pady 10 -padx 10
@@ -181,7 +181,7 @@ method insert {txt} {
method done {ok} {
if {$ok} {
if {[winfo exists $w.m.s]} {
- $w.m.s conf -background green -text {Success}
+ $w.m.s conf -background green -text [mc "Success"]
if {$is_toplevel} {
$w.ok conf -state normal
focus $w.ok
@@ -191,7 +191,7 @@ method done {ok} {
if {![winfo exists $w.m.s]} {
_init $this
}
- $w.m.s conf -background red -text {Error: Command Failed}
+ $w.m.s conf -background red -text [mc "Error: Command Failed"]
if {$is_toplevel} {
$w.ok conf -state normal
focus $w.ok
diff --git a/lib/database.tcl b/lib/database.tcl
index 0657cc2..118b1b2 100644
--- a/lib/database.tcl
+++ b/lib/database.tcl
@@ -24,14 +24,14 @@ proc do_stats {} {
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
- label $w.header -text {Database Statistics}
+ label $w.header -text [mc "Database Statistics"]
pack $w.header -side top -fill x
frame $w.buttons -border 1
- button $w.buttons.close -text Close \
+ button $w.buttons.close -text [mc Close] \
-default active \
-command [list destroy $w]
- button $w.buttons.gc -text {Compress Database} \
+ button $w.buttons.gc -text [mc "Compress Database"] \
-default normal \
-command "destroy $w;do_gc"
pack $w.buttons.close -side right
@@ -40,16 +40,16 @@ proc do_stats {} {
frame $w.stat -borderwidth 1 -relief solid
foreach s {
- {count {Number of loose objects}}
- {size {Disk space used by loose objects} { KiB}}
- {in-pack {Number of packed objects}}
- {packs {Number of packs}}
- {size-pack {Disk space used by packed objects} { KiB}}
- {prune-packable {Packed objects waiting for pruning}}
- {garbage {Garbage files}}
+ {count {mc "Number of loose objects"}}
+ {size {mc "Disk space used by loose objects"} { KiB}}
+ {in-pack {mc "Number of packed objects"}}
+ {packs {mc "Number of packs"}}
+ {size-pack {mc "Disk space used by packed objects"} { KiB}}
+ {prune-packable {mc "Packed objects waiting for pruning"}}
+ {garbage {mc "Garbage files"}}
} {
set name [lindex $s 0]
- set label [lindex $s 1]
+ set label [eval [lindex $s 1]]
if {[catch {set value $stats($name)}]} continue
if {[llength $s] > 2} {
set value "$value[lindex $s 2]"
@@ -64,12 +64,12 @@ proc do_stats {} {
bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [list destroy $w]
- wm title $w "[appname] ([reponame]): Database Statistics"
+ wm title $w [append "[appname] ([reponame]): " [mc "Database Statistics"]]
tkwait window $w
}
proc do_gc {} {
- set w [console::new {gc} {Compressing the object database}]
+ set w [console::new {gc} [mc "Compressing the object database"]]
console::chain $w {
{exec git pack-refs --prune}
{exec git reflog expire --all}
@@ -80,7 +80,7 @@ proc do_gc {} {
proc do_fsck_objects {} {
set w [console::new {fsck-objects} \
- {Verifying the object database with fsck-objects}]
+ [mc "Verifying the object database with fsck-objects"]]
set cmd [list git fsck-objects]
lappend cmd --full
lappend cmd --cache
diff --git a/lib/diff.tcl b/lib/diff.tcl
index e09e125..b1129d5 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -39,13 +39,13 @@ proc handle_empty_diff {} {
set s $file_states($path)
if {[lindex $s 0] ne {_M}} return
- info_popup "No differences detected.
+ info_popup [mc "No differences detected.
-[short_path $path] has no changes.
+%s has no changes.
The modification date of this file was updated by another application, but the content within the file was not changed.
-A rescan will be automatically started to find other files which may have the same state."
+A rescan will be automatically started to find other files which may have the same state." [short_path $path]]
clear_diff
display_file $path __
@@ -94,7 +94,7 @@ proc show_diff {path w {lno {}}} {
set diff_active 0
unlock_index
ui_status "Unable to display [escape_path $path]"
- error_popup "Error loading file:\n\n$err"
+ error_popup [append [mc "Error loading file:"] "\n\n$err"]
return
}
$ui_diff conf -state normal
@@ -159,7 +159,7 @@ proc show_diff {path w {lno {}}} {
set diff_active 0
unlock_index
ui_status "Unable to display [escape_path $path]"
- error_popup "Error loading diff:\n\n$err"
+ error_popup [append [mc "Error loading diff:"] "\n\n$err"]
return
}
@@ -275,14 +275,14 @@ proc apply_hunk {x y} {
set apply_cmd {apply --cached --whitespace=nowarn}
set mi [lindex $file_states($current_diff_path) 0]
if {$current_diff_side eq $ui_index} {
- set mode unstage
+ set failed_msg [mc "Failed to unstage selected hunk."]
lappend apply_cmd --reverse
if {[string index $mi 0] ne {M}} {
unlock_index
return
}
} else {
- set mode stage
+ set failed_msg [mc "Failed to stage selected hunk."]
if {[string index $mi 1] ne {M}} {
unlock_index
return
@@ -307,7 +307,7 @@ proc apply_hunk {x y} {
puts -nonewline $p $current_diff_header
puts -nonewline $p [$ui_diff get $s_lno $e_lno]
close $p} err]} {
- error_popup "Failed to $mode selected hunk.\n\n$err"
+ error_popup [append $failed_msg "\n\n$err"]
unlock_index
return
}
diff --git a/lib/error.tcl b/lib/error.tcl
index 16a2218..13565b7 100644
--- a/lib/error.tcl
+++ b/lib/error.tcl
@@ -9,7 +9,7 @@ proc error_popup {msg} {
set cmd [list tk_messageBox \
-icon error \
-type ok \
- -title "$title: error" \
+ -title [append "$title: " [mc "error"]] \
-message $msg]
if {[winfo ismapped .]} {
lappend cmd -parent .
@@ -25,7 +25,7 @@ proc warn_popup {msg} {
set cmd [list tk_messageBox \
-icon warning \
-type ok \
- -title "$title: warning" \
+ -title [append "$title: " [mc "warning"]] \
-message $msg]
if {[winfo ismapped .]} {
lappend cmd -parent .
@@ -78,7 +78,7 @@ proc hook_failed_popup {hook msg} {
-font font_diff \
-yscrollcommand [list $w.m.sby set]
label $w.m.l2 \
- -text {You must correct the above errors before committing.} \
+ -text [mc "You must correct the above errors before committing."] \
-anchor w \
-justify left \
-font font_uibold
@@ -99,6 +99,6 @@ proc hook_failed_popup {hook msg} {
bind $w <Visibility> "grab $w; focus $w"
bind $w <Key-Return> "destroy $w"
- wm title $w "[appname] ([reponame]): error"
+ wm title $w [append "[appname] ([reponame]): " [mc "error"]]
tkwait window $w
}
diff --git a/lib/index.tcl b/lib/index.tcl
index f47f929..b3f5e17 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -345,26 +345,35 @@ proc revert_helper {txt paths} {
}
}
+
+ # Split question between singular and plural cases, because
+ # such distinction is needed in some languages. Previously, the
+ # code used "Revert changes in" for both, but that can't work
+ # in languages where 'in' must be combined with word from
+ # rest of string (in diffrent way for both cases of course).
+ #
+ # FIXME: Unfortunately, even that isn't enough in some languages
+ # as they have quite complex plural-form rules. Unfortunately,
+ # msgcat doesn't seem to support that kind of string translation.
+ #
set n [llength $pathList]
if {$n == 0} {
unlock_index
return
} elseif {$n == 1} {
- set s "[short_path [lindex $pathList]]"
+ set query [mc "Revert changes in file %s?" [short_path [lindex $pathList]]]
} else {
- set s "these $n files"
+ set query [mc "Revert changes in these %i files?" $n]
}
set reply [tk_dialog \
.confirm_revert \
"[appname] ([reponame])" \
- "Revert changes in $s?
-
-Any unstaged changes will be permanently lost by the revert." \
+ [mc "Any unstaged changes will be permanently lost by the revert."] \
question \
1 \
- {Do Nothing} \
- {Revert Changes} \
+ [mc "Do Nothing"] \
+ [mc "Revert Changes"] \
]
if {$reply == 1} {
checkout_index \
diff --git a/lib/merge.tcl b/lib/merge.tcl
index 0e50919..63e1427 100644
--- a/lib/merge.tcl
+++ b/lib/merge.tcl
@@ -10,10 +10,10 @@ method _can_merge {} {
global HEAD commit_type file_states
if {[string match amend* $commit_type]} {
- info_popup {Cannot merge while amending.
+ info_popup [mc "Cannot merge while amending.
You must finish amending this commit before starting any type of merge.
-}
+"]
return 0
}
@@ -24,12 +24,12 @@ You must finish amending this commit before starting any type of merge.
#
repository_state curType curHEAD curMERGE_HEAD
if {$commit_type ne $curType || $HEAD ne $curHEAD} {
- info_popup {Last scanned state does not match repository state.
+ info_popup [mc "Last scanned state does not match repository state.
Another Git program has modified this repository since the last scan. A rescan must be performed before a merge can be performed.
The rescan will be automatically started now.
-}
+"]
unlock_index
rescan ui_ready
return 0
@@ -41,22 +41,22 @@ The rescan will be automatically started now.
continue; # and pray it works!
}
U? {
- error_popup "You are in the middle of a conflicted merge.
+ error_popup [mc "You are in the middle of a conflicted merge.
-File [short_path $path] has merge conflicts.
+File %s has merge conflicts.
You must resolve them, stage the file, and commit to complete the current merge. Only then can you begin another merge.
-"
+" [short_path $path]]
unlock_index
return 0
}
?? {
- error_popup "You are in the middle of a change.
+ error_popup [mc "You are in the middle of a change.
-File [short_path $path] is modified.
+File %s is modified.
You should complete the current commit before starting a merge. Doing so will help you abort a failed merge, should the need arise.
-"
+" [short_path $path]]
unlock_index
return 0
}
@@ -103,7 +103,7 @@ method _start {} {
regsub {^[^:@]*@} $remote {} remote
}
set branch [lindex $spec 2]
- set stitle "$branch of $remote"
+ set stitle [mc "%s of %s" $branch $remote]
}
regsub ^refs/heads/ $branch {} branch
puts $fh "$cmit\t\tbranch '$branch' of $remote"
@@ -116,9 +116,9 @@ method _start {} {
lappend cmd HEAD
lappend cmd $name
- set msg "Merging $current_branch and $stitle"
+ set msg [mc "Merging %s and %s" $current_branch $stitle]
ui_status "$msg..."
- set cons [console::new "Merge" "merge $stitle"]
+ set cons [console::new [mc "Merge"] "merge $stitle"]
console::exec $cons $cmd [cb _finish $cons]
wm protocol $w WM_DELETE_WINDOW {}
@@ -128,9 +128,9 @@ method _start {} {
method _finish {cons ok} {
console::done $cons $ok
if {$ok} {
- set msg {Merge completed successfully.}
+ set msg [mc "Merge completed successfully."]
} else {
- set msg {Merge failed. Conflict resolution is required.}
+ set msg [mc "Merge failed. Conflict resolution is required."]
}
unlock_index
rescan [list ui_status $msg]
@@ -147,7 +147,7 @@ constructor dialog {} {
}
make_toplevel top w
- wm title $top "[appname] ([reponame]): Merge"
+ wm title $top [append "[appname] ([reponame]): " [mc "Merge"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
@@ -155,26 +155,26 @@ constructor dialog {} {
set _start [cb _start]
label $w.header \
- -text "Merge Into $current_branch" \
+ -text [mc "Merge Into %s" $current_branch] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.visualize \
- -text Visualize \
+ -text [mc Visualize] \
-command [cb _visualize]
pack $w.buttons.visualize -side left
button $w.buttons.merge \
- -text Merge \
+ -text [mc Merge] \
-command $_start
pack $w.buttons.merge -side right
button $w.buttons.cancel \
- -text {Cancel} \
+ -text [mc "Cancel"] \
-command [cb _cancel]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- set w_rev [::choose_rev::new_unmerged $w.rev {Revision To Merge}]
+ set w_rev [::choose_rev::new_unmerged $w.rev [mc "Revision To Merge"]]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
bind $w <$M1B-Key-Return> $_start
@@ -209,34 +209,34 @@ proc reset_hard {} {
global HEAD commit_type file_states
if {[string match amend* $commit_type]} {
- info_popup {Cannot abort while amending.
+ info_popup [mc "Cannot abort while amending.
You must finish amending this commit.
-}
+"]
return
}
if {![lock_index abort]} return
if {[string match *merge* $commit_type]} {
- set op_question "Abort merge?
+ set op_question [mc "Abort merge?
Aborting the current merge will cause *ALL* uncommitted changes to be lost.
-Continue with aborting the current merge?"
+Continue with aborting the current merge?"]
} else {
- set op_question "Reset changes?
+ set op_question [mc "Reset changes?
Resetting the changes will cause *ALL* uncommitted changes to be lost.
-Continue with resetting the current changes?"
+Continue with resetting the current changes?"]
}
if {[ask_popup $op_question] eq {yes}} {
set fd [git_read --stderr read-tree --reset -u -v HEAD]
fconfigure $fd -blocking 0 -translation binary
fileevent $fd readable [namespace code [list _reset_wait $fd]]
- $::main_status start {Aborting} {files reset}
+ $::main_status start [mc "Aborting"] {files reset}
} else {
unlock_index
}
@@ -263,9 +263,9 @@ proc _reset_wait {fd} {
catch {file delete [gitdir GITGUI_MSG]}
if {$fail} {
- warn_popup "Abort failed.\n\n$err"
+ warn_popup "[mc "Abort failed."]\n\n$err"
}
- rescan {ui_status {Abort completed. Ready.}}
+ rescan {ui_status [mc "Abort completed. Ready."]}
} else {
fconfigure $fd -blocking 0
}
diff --git a/lib/option.tcl b/lib/option.tcl
index aa9f783..31c7d47 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -62,7 +62,7 @@ proc do_about {} {
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
- label $w.header -text "About [appname]" \
+ label $w.header -text [mc "About %s" [appname]] \
-font font_uibold
pack $w.header -side top -fill x
@@ -74,8 +74,7 @@ proc do_about {} {
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
label $w.desc \
- -text "git-gui - a graphical user interface for Git.
-$copyright" \
+ -text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
-padx 5 -pady 5 \
-justify left \
-anchor w \
@@ -157,48 +156,48 @@ proc do_options {} {
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
- label $w.header -text "Options" \
+ label $w.header -text [mc "Options"] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.restore -text {Restore Defaults} \
+ button $w.buttons.restore -text [mc "Restore Defaults"] \
-default normal \
-command do_restore_defaults
pack $w.buttons.restore -side left
- button $w.buttons.save -text Save \
+ button $w.buttons.save -text [mc Save] \
-default active \
-command [list do_save_config $w]
pack $w.buttons.save -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc "Cancel"] \
-default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- labelframe $w.repo -text "[reponame] Repository"
- labelframe $w.global -text {Global (All Repositories)}
+ labelframe $w.repo -text [mc "%s Repository" [reponame]]
+ labelframe $w.global -text [mc "Global (All Repositories)"]
pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5
pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
set optid 0
foreach option {
- {t user.name {User Name}}
- {t user.email {Email Address}}
-
- {b merge.summary {Summarize Merge Commits}}
- {i-1..5 merge.verbosity {Merge Verbosity}}
- {b merge.diffstat {Show Diffstat After Merge}}
-
- {b gui.trustmtime {Trust File Modification Timestamps}}
- {b gui.pruneduringfetch {Prune Tracking Branches During Fetch}}
- {b gui.matchtrackingbranch {Match Tracking Branches}}
- {i-0..99 gui.diffcontext {Number of Diff Context Lines}}
- {t gui.newbranchtemplate {New Branch Name Template}}
+ {t user.name {mc "User Name"}}
+ {t user.email {mc "Email Address"}}
+
+ {b merge.summary {mc "Summarize Merge Commits"}}
+ {i-1..5 merge.verbosity {mc "Merge Verbosity"}}
+ {b merge.diffstat {mc "Show Diffstat After Merge"}}
+
+ {b gui.trustmtime {mc "Trust File Modification Timestamps"}}
+ {b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
+ {b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
+ {i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
+ {t gui.newbranchtemplate {mc "New Branch Name Template"}}
} {
set type [lindex $option 0]
set name [lindex $option 1]
- set text [lindex $option 2]
+ set text [eval [lindex $option 2]]
incr optid
foreach f {repo global} {
switch -glob -- $type {
@@ -246,7 +245,7 @@ proc do_options {} {
foreach option $font_descs {
set name [lindex $option 0]
set font [lindex $option 1]
- set text [lindex $option 2]
+ set text [eval [lindex $option 2]]
set global_config_new(gui.$font^^family) \
[font configure $font -family]
@@ -272,7 +271,7 @@ proc do_options {} {
bind $w <Visibility> "grab $w; focus $w.buttons.save"
bind $w <Key-Escape> "destroy $w"
bind $w <Key-Return> [list do_save_config $w]
- wm title $w "[appname] ([reponame]): Options"
+ wm title $w [append "[appname] ([reponame]): " [mc "Options"]]
tkwait window $w
}
@@ -303,7 +302,7 @@ proc do_restore_defaults {} {
proc do_save_config {w} {
if {[catch {save_config} err]} {
- error_popup "Failed to completely save options:\n\n$err"
+ error_popup [append [mc "Failed to completely save options:"] "\n\n$err"]
}
reshow_diff
destroy $w
diff --git a/lib/remote.tcl b/lib/remote.tcl
index cf9b9d5..62bfe8f 100644
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
@@ -159,7 +159,7 @@ proc populate_fetch_menu {} {
if {$enable} {
lappend prune_list $r
$m add command \
- -label "Fetch from $r..." \
+ -label [mc "Fetch from %s..." $r] \
-command [list fetch_from $r]
}
}
@@ -169,7 +169,7 @@ proc populate_fetch_menu {} {
}
foreach r $prune_list {
$m add command \
- -label "Prune from $r..." \
+ -label [mc "Prune from %s..." $r] \
-command [list prune_from $r]
}
}
@@ -203,7 +203,7 @@ proc populate_push_menu {} {
$m add separator
}
$m add command \
- -label "Push to $r..." \
+ -label [mc "Push to %s..." $r] \
-command [list push_to $r]
incr fast_count
}
diff --git a/lib/remote_branch_delete.tcl b/lib/remote_branch_delete.tcl
index c88a360..06b5eab 100644
--- a/lib/remote_branch_delete.tcl
+++ b/lib/remote_branch_delete.tcl
@@ -26,28 +26,28 @@ constructor dialog {} {
global all_remotes M1B
make_toplevel top w
- wm title $top "[appname] ([reponame]): Delete Remote Branch"
+ wm title $top [append "[appname] ([reponame]): " [mc "Delete Remote Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}
- label $w.header -text {Delete Remote Branch} -font font_uibold
+ label $w.header -text [mc "Delete Remote Branch"] -font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.delete -text Delete \
+ button $w.buttons.delete -text [mc Delete] \
-default active \
-command [cb _delete]
pack $w.buttons.delete -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc "Cancel"] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- labelframe $w.dest -text {From Repository}
+ labelframe $w.dest -text [mc "From Repository"]
if {$all_remotes ne {}} {
radiobutton $w.dest.remote_r \
- -text {Remote:} \
+ -text [mc "Remote:"] \
-value remote \
-variable @urltype
eval tk_optionMenu $w.dest.remote_m @remote $all_remotes
@@ -63,7 +63,7 @@ constructor dialog {} {
set urltype url
}
radiobutton $w.dest.url_r \
- -text {Arbitrary URL:} \
+ -text [mc "Arbitrary URL:"] \
-value url \
-variable @urltype
entry $w.dest.url_t \
@@ -81,7 +81,7 @@ constructor dialog {} {
grid columnconfigure $w.dest 1 -weight 1
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
- labelframe $w.heads -text {Branches}
+ labelframe $w.heads -text [mc "Branches"]
listbox $w.heads.l \
-height 10 \
-width 70 \
@@ -96,7 +96,7 @@ constructor dialog {} {
-anchor w \
-justify left
button $w.heads.footer.rescan \
- -text {Rescan} \
+ -text [mc "Rescan"] \
-command [cb _rescan]
pack $w.heads.footer.status -side left -fill x
pack $w.heads.footer.rescan -side right
@@ -106,9 +106,9 @@ constructor dialog {} {
pack $w.heads.l -side left -fill both -expand 1
pack $w.heads -fill both -expand 1 -pady 5 -padx 5
- labelframe $w.validate -text {Delete Only If}
+ labelframe $w.validate -text [mc "Delete Only If"]
radiobutton $w.validate.head_r \
- -text {Merged Into:} \
+ -text [mc "Merged Into:"] \
-value head \
-variable @checktype
set head_m [tk_optionMenu $w.validate.head_m @check_head {}]
@@ -116,7 +116,7 @@ constructor dialog {} {
trace add variable @check_head write [cb _write_check_head]
grid $w.validate.head_r $w.validate.head_m -sticky w
radiobutton $w.validate.always_r \
- -text {Always (Do not perform merge checks)} \
+ -text [mc "Always (Do not perform merge checks)"] \
-value always \
-variable @checktype
grid $w.validate.always_r -columnspan 2 -sticky w
@@ -149,7 +149,7 @@ method _delete {} {
-type ok \
-title [wm title $w] \
-parent $w \
- -message "A branch is required for 'Merged Into'."
+ -message [mc "A branch is required for 'Merged Into'."]
return
}
set crev $full_cache("$cache\nrefs/heads/$check_head")
@@ -186,9 +186,7 @@ method _delete {} {
- [join $not_merged "\n - "]"
if {$need_fetch} {
- append msg "
-
-One or more of the merge tests failed because you have not fetched the necessary commits. Try fetching from $uri first."
+ append msg "\n\n" [mc "One or more of the merge tests failed because you have not fetched the necessary commits. Try fetching from %s first." $uri]
}
tk_messageBox \
@@ -206,7 +204,7 @@ One or more of the merge tests failed because you have not fetched the necessary
-type ok \
-title [wm title $w] \
-parent $w \
- -message "Please select one or more branches to delete."
+ -message [mc "Please select one or more branches to delete."]
return
}
@@ -215,9 +213,9 @@ One or more of the merge tests failed because you have not fetched the necessary
-type yesno \
-title [wm title $w] \
-parent $w \
- -message {Recovering deleted branches is difficult.
+ -message [mc "Recovering deleted branches is difficult.
-Delete the selected branches?}] ne yes} {
+Delete the selected branches?"]] ne yes} {
return
}
@@ -225,7 +223,7 @@ Delete the selected branches?}] ne yes} {
set cons [console::new \
"push $uri" \
- "Deleting branches from $uri"]
+ [mc "Deleting branches from %s" $uri]]
console::exec $cons $push_cmd
}
@@ -285,12 +283,12 @@ method _load {cache uri} {
$w.heads.l conf -state disabled
set head_list [list]
set full_list [list]
- set status {No repository selected.}
+ set status [mc "No repository selected."]
return
}
if {[catch {set x $cached($cache)}]} {
- set status "Scanning $uri..."
+ set status [mc "Scanning %s..." $uri]
$w.heads.l conf -state disabled
set head_list [list]
set full_list [list]
diff --git a/lib/shortcut.tcl b/lib/shortcut.tcl
index c36be2f..d0e63a3 100644
--- a/lib/shortcut.tcl
+++ b/lib/shortcut.tcl
@@ -6,7 +6,7 @@ proc do_windows_shortcut {} {
set fn [tk_getSaveFile \
-parent . \
- -title "[appname] ([reponame]): Create Desktop Icon" \
+ -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
-initialfile "Git [reponame].bat"]
if {$fn != {}} {
if {[file extension $fn] ne {.bat}} {
@@ -23,7 +23,7 @@ proc do_windows_shortcut {} {
puts $fd " \"[file normalize $argv0]\""
close $fd
} err]} {
- error_popup "Cannot write script:\n\n$err"
+ error_popup [append [mc "Cannot write script:"] "\n\n$err"]
}
}
}
@@ -42,7 +42,7 @@ proc do_cygwin_shortcut {} {
}
set fn [tk_getSaveFile \
-parent . \
- -title "[appname] ([reponame]): Create Desktop Icon" \
+ -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
-initialdir $desktop \
-initialfile "Git [reponame].bat"]
if {$fn != {}} {
@@ -71,7 +71,7 @@ proc do_cygwin_shortcut {} {
puts $fd " &\""
close $fd
} err]} {
- error_popup "Cannot write script:\n\n$err"
+ error_popup [append [mc "Cannot write script:"] "\n\n$err"]
}
}
}
@@ -81,7 +81,7 @@ proc do_macosx_app {} {
set fn [tk_getSaveFile \
-parent . \
- -title "[appname] ([reponame]): Create Desktop Icon" \
+ -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
-initialdir [file join $env(HOME) Desktop] \
-initialfile "Git [reponame].app"]
if {$fn != {}} {
@@ -146,7 +146,7 @@ proc do_macosx_app {} {
file attributes $exe -permissions u+x,g+x,o+x
} err]} {
- error_popup "Cannot write icon:\n\n$err"
+ error_popup [append [mc "Cannot write icon:"] "\n\n$err"]
}
}
}
diff --git a/lib/status_bar.tcl b/lib/status_bar.tcl
index 72a8fe1..769ef81 100644
--- a/lib/status_bar.tcl
+++ b/lib/status_bar.tcl
@@ -55,7 +55,7 @@ method update {have total} {
set pdone [expr {100 * $have / $total}]
}
- set status [format "%s ... %i of %i %s (%2i%%)" \
+ set status [mc "%s ... %i of %i %s (%2i%%)" \
$prefix $have $total $units $pdone]
$w_c coords bar 0 0 $pdone 20
}
diff --git a/lib/transport.tcl b/lib/transport.tcl
index 3a22bd4..1c7baef 100644
--- a/lib/transport.tcl
+++ b/lib/transport.tcl
@@ -4,7 +4,7 @@
proc fetch_from {remote} {
set w [console::new \
"fetch $remote" \
- "Fetching new changes from $remote"]
+ [mc "Fetching new changes from %s" $remote]]
set cmds [list]
lappend cmds [list exec git fetch $remote]
if {[is_config_true gui.pruneduringfetch]} {
@@ -16,14 +16,14 @@ proc fetch_from {remote} {
proc prune_from {remote} {
set w [console::new \
"remote prune $remote" \
- "Pruning tracking branches deleted from $remote"]
+ [mc "Pruning tracking branches deleted from %s" $remote]]
console::exec $w [list git remote prune $remote]
}
proc push_to {remote} {
set w [console::new \
"push $remote" \
- "Pushing changes to $remote"]
+ [mc "Pushing changes to %s" $remote]]
set cmd [list git push]
lappend cmd -v
lappend cmd $remote
@@ -65,7 +65,7 @@ proc start_push_anywhere_action {w} {
set cons [console::new \
"push $r_url" \
- "Pushing $cnt $unit to $r_url"]
+ [mc "Pushing %s %s to %s" $cnt $unit $r_url]]
console::exec $cons $cmd
destroy $w
}
@@ -81,21 +81,21 @@ proc do_push_anywhere {} {
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
- label $w.header -text {Push Branches} -font font_uibold
+ label $w.header -text [mc "Push Branches"] -font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
- button $w.buttons.create -text Push \
+ button $w.buttons.create -text [mc Push] \
-default active \
-command [list start_push_anywhere_action $w]
pack $w.buttons.create -side right
- button $w.buttons.cancel -text {Cancel} \
+ button $w.buttons.cancel -text [mc "Cancel"] \
-default normal \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
- labelframe $w.source -text {Source Branches}
+ labelframe $w.source -text [mc "Source Branches"]
listbox $w.source.l \
-height 10 \
-width 70 \
@@ -112,10 +112,10 @@ proc do_push_anywhere {} {
pack $w.source.l -side left -fill both -expand 1
pack $w.source -fill both -expand 1 -pady 5 -padx 5
- labelframe $w.dest -text {Destination Repository}
+ labelframe $w.dest -text [mc "Destination Repository"]
if {$all_remotes ne {}} {
radiobutton $w.dest.remote_r \
- -text {Remote:} \
+ -text [mc "Remote:"] \
-value remote \
-variable push_urltype
eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes
@@ -130,7 +130,7 @@ proc do_push_anywhere {} {
set push_urltype url
}
radiobutton $w.dest.url_r \
- -text {Arbitrary URL:} \
+ -text [mc "Arbitrary URL:"] \
-value url \
-variable push_urltype
entry $w.dest.url_t \
@@ -150,13 +150,13 @@ proc do_push_anywhere {} {
grid columnconfigure $w.dest 1 -weight 1
pack $w.dest -anchor nw -fill x -pady 5 -padx 5
- labelframe $w.options -text {Transfer Options}
+ labelframe $w.options -text [mc "Transfer Options"]
checkbutton $w.options.thin \
- -text {Use thin pack (for slow network connections)} \
+ -text [mc "Use thin pack (for slow network connections)"] \
-variable push_thin
grid $w.options.thin -columnspan 2 -sticky w
checkbutton $w.options.tags \
- -text {Include tags} \
+ -text [mc "Include tags"] \
-variable push_tags
grid $w.options.tags -columnspan 2 -sticky w
grid columnconfigure $w.options 1 -weight 1
@@ -169,6 +169,6 @@ proc do_push_anywhere {} {
bind $w <Visibility> "grab $w; focus $w.buttons.create"
bind $w <Key-Escape> "destroy $w"
bind $w <Key-Return> [list start_push_anywhere_action $w]
- wm title $w "[appname] ([reponame]): Push"
+ wm title $w [append "[appname] ([reponame]): " [mc "Push"]]
tkwait window $w
}
--
1.5.3.2.g46909
^ permalink raw reply related
* [PATCH 02/15] Makefile rules for translation catalog generation and installation.
From: Johannes Schindelin @ 2007-09-02 16:25 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021719380.28586@racer.site>
[jes: with fixes by the i18n team.]
Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Makefile | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 1bac6fe..559e65e 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,21 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(GITGUI_BUILT_INS): git-gui
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
+XGETTEXT ?= xgettext
+msgsdir ?= $(libdir)/msgs
+msgsdir_SQ = $(subst ','\'',$(msgsdir))
+PO_TEMPLATE = po/git-gui.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
+ $(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
+update-po:: $(PO_TEMPLATE)
+ $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
+$(ALL_MSGFILES): %.msg : %.po
+ @echo Generating catalog $@
+ msgfmt --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
+
lib/tclIndex: $(ALL_LIBFILES)
$(QUIET_INDEX)if echo \
$(foreach p,$(PRELOAD_FILES),source $p\;) \
@@ -136,7 +151,7 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
echo 1>$@ "$$VARS"; \
fi
-all:: $(ALL_PROGRAMS) lib/tclIndex
+all:: $(ALL_PROGRAMS) lib/tclIndex $(ALL_MSGFILES)
install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -145,13 +160,15 @@ install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
+ $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+ $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
dist-version:
@mkdir -p $(TARDIR)
@echo $(GITGUI_VERSION) > $(TARDIR)/version
clean::
- rm -f $(ALL_PROGRAMS) lib/tclIndex
+ rm -f $(ALL_PROGRAMS) lib/tclIndex po/*.msg
rm -f GIT-VERSION-FILE GIT-GUI-VARS
.PHONY: all install dist-version clean
--
1.5.3.2.g46909
^ permalink raw reply related
* [PATCH 02/15] Makefile rules for translation catalog generation and installation.
From: Johannes Schindelin @ 2007-09-02 16:26 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021719380.28586@racer.site>
From: Christian Stimming <stimming@tuhh.de>
[jes: with fixes by the i18n team.]
Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Makefile | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 1bac6fe..559e65e 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,21 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(GITGUI_BUILT_INS): git-gui
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
+XGETTEXT ?= xgettext
+msgsdir ?= $(libdir)/msgs
+msgsdir_SQ = $(subst ','\'',$(msgsdir))
+PO_TEMPLATE = po/git-gui.pot
+ALL_POFILES = $(wildcard po/*.po)
+ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
+
+$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
+ $(XGETTEXT) -kmc -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
+update-po:: $(PO_TEMPLATE)
+ $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
+$(ALL_MSGFILES): %.msg : %.po
+ @echo Generating catalog $@
+ msgfmt --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
+
lib/tclIndex: $(ALL_LIBFILES)
$(QUIET_INDEX)if echo \
$(foreach p,$(PRELOAD_FILES),source $p\;) \
@@ -136,7 +151,7 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
echo 1>$@ "$$VARS"; \
fi
-all:: $(ALL_PROGRAMS) lib/tclIndex
+all:: $(ALL_PROGRAMS) lib/tclIndex $(ALL_MSGFILES)
install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -145,13 +160,15 @@ install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
+ $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+ $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
dist-version:
@mkdir -p $(TARDIR)
@echo $(GITGUI_VERSION) > $(TARDIR)/version
clean::
- rm -f $(ALL_PROGRAMS) lib/tclIndex
+ rm -f $(ALL_PROGRAMS) lib/tclIndex po/*.msg
rm -f GIT-VERSION-FILE GIT-GUI-VARS
.PHONY: all install dist-version clean
--
1.5.3.2.g46909
^ permalink raw reply related
* Re: [PATCH 01/15] Mark strings for translation.
From: Johannes Schindelin @ 2007-09-02 16:28 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021724440.28586@racer.site>
Hi,
oops... this patch is
From: Christian Stimming <stimming@tuhh.de>
Sorry,
Dscho
^ permalink raw reply
* [PATCH 03/15] git-gui po/README: Guide to translators
From: Johannes Schindelin @ 2007-09-02 16:30 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021719380.28586@racer.site>
From: Junio C Hamano <gitster@pobox.com>
This short note is to help a translation contributor to help us
localizing git-gui message files by covering the basics.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
po/README | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 205 insertions(+), 0 deletions(-)
create mode 100644 po/README
diff --git a/po/README b/po/README
new file mode 100644
index 0000000..af5dfad
--- /dev/null
+++ b/po/README
@@ -0,0 +1,205 @@
+Localizing git-gui for your language
+====================================
+
+This short note is to help you, who reads and writes English and your
+own language, help us getting git-gui localized for more languages. It
+does not try to be a comprehensive manual of GNU gettext, which is the
+i18n framework we use, but tries to help you get started by covering the
+basics and how it is used in this project.
+
+1. Getting started.
+
+You would first need to have a working "git". Your distribution may
+have it as "git-core" package (do not get "GNU Interactive Tools" --
+that is a different "git"). You would also need GNU gettext toolchain
+to test the resulting translation out. Although you can work on message
+translation files with a regular text editor, it is a good idea to have
+specialized so-called "po file editors" (e.g. emacs po-mode, KBabel,
+poedit, GTranslator --- any of them would work well). Please install
+them.
+
+You would then need to clone the git-gui internationalization project
+repository, so that you can work on it:
+
+ $ git clone mob@repo.or.cz:/srv/git/git-gui/git-gui-i18n.git/
+ $ cd git-gui-i18n
+ $ git checkout --track -b mob origin/mob
+ $ git config remote.origin.push mob
+
+The "git checkout" command creates a 'mob' branch from upstream's
+corresponding branch and makes it your current branch. You will be
+working on this branch.
+
+The "git config" command records in your repository configuration file
+that you would push "mob" branch to the upstream when you say "git
+push".
+
+
+2. Starting a new language.
+
+In the git-gui-i18n directory is a po/ subdirectory. It has a
+handful files whose names end with ".po". Is there a file that has
+messages in your language?
+
+If you do not know what your language should be named, you need to find
+it. This currently follows ISO 639-1 two letter codes:
+
+ http://www.loc.gov/standards/iso639-2/php/code_list.php
+
+For example, if you are preparing a translation for Afrikaans, the
+language code is "af". If there already is a translation for your
+language, you do not have to perform any step in this section, but keep
+reading, because we are covering the basics.
+
+If you did not find your language, you would need to start one yourself.
+Copy po/git-gui.pot file to po/af.po (replace "af" with the code for
+your language). Edit the first several lines to match existing *.po
+files to make it clear this is a translation table for git-gui project,
+and you are the primary translator. The result of your editing would
+look something like this:
+
+ # Translation of git-gui to Afrikaans
+ # Copyright (C) 2007 Shawn Pearce
+ # This file is distributed under the same license as the git-gui package.
+ # YOUR NAME <YOUR@E-MAIL.ADDRESS>, 2007.
+ #
+ #, fuzzy
+ msgid ""
+ msgstr ""
+ "Project-Id-Version: git-gui\n"
+ "Report-Msgid-Bugs-To: \n"
+ "POT-Creation-Date: 2007-07-24 22:19+0300\n"
+ "PO-Revision-Date: 2007-07-25 18:00+0900\n"
+ "Last-Translator: YOUR NAME <YOUR@E-MAIL.ADDRESS>\n"
+ "Language-Team: Afrikaans\n"
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+
+You will find many pairs of a "msgid" line followed by a "msgstr" line.
+These pairs define how messages in git-gui application are translated to
+your language. Your primarily job is to fill in the empty double quote
+pairs on msgstr lines with the translation of the strings on their
+matching msgid lines. A few tips:
+
+ - Control characters, such as newlines, are written in backslash
+ sequence similar to string literals in the C programming language.
+ When the string given on a msgid line has such a backslash sequence,
+ you would typically want to have corresponding ones in the string on
+ your msgstr line.
+
+ - Often the messages being translated are format strings given to
+ "printf()"-like functions. Make sure "%s", "%d", and "%%" in your
+ translated messages match the original.
+
+ When you have to change the order of words, you can add "<number>\$"
+ between '%' and the conversion ('s', 'd', etc.) to say "<number>-th
+ parameter to the format string is used at this point". For example,
+ if the original message is like this:
+
+ "Length is %d, Weight is %d"
+
+ and if for whatever reason your translation needs to say weight first
+ and then length, you can say something like:
+
+ "WEIGHT IS %2\$d, LENGTH IS %1\$d"
+
+ The reason you need a backslash before dollar sign is because
+ this is a double quoted string in Tcl language, and without
+ it the letter introduces a variable interpolation, which you
+ do not want here.
+
+ - A long message can be split across multiple lines by ending the
+ string with a double quote, and starting another string on the next
+ line with another double quote. They will be concatenated in the
+ result. For example:
+
+ #: lib/remote_branch_delete.tcl:189
+ #, tcl-format
+ msgid ""
+ "One or more of the merge tests failed because you have not fetched the "
+ "necessary commits. Try fetching from %s first."
+ msgstr ""
+ "HERE YOU WILL WRITE YOUR TRANSLATION OF THE ABOVE LONG "
+ "MESSAGE IN YOUR LANGUAGE."
+
+You can test your translation by running "make install", which would
+create po/af.msg file and installs the result, and then running the
+resulting git-gui under your locale:
+
+ $ make install
+ $ LANG=af git-gui
+
+There is a trick to test your translation without first installing, if
+you prefer. First, create this symbolic link in the source tree:
+
+ $ ln -s ../po lib/msgs
+
+After setting up such a symbolic link, you can:
+
+ $ make
+ $ LANG=af ./git-gui.sh
+
+When you are satisfied with your translation, commit your changes, and
+push it back to the 'mob' branch:
+
+ $ edit po/af.po
+ ... be sure to update Last-Translator: and
+ ... PO-Revision-Date: lines.
+ $ git add po/af.po
+ $ git commit -m 'Started Afrikaans translation.'
+ $ git push
+
+
+3. Updating your translation.
+
+There may already be a translation for your language, and you may want
+to contribute an update. This may be because you would want to improve
+the translation of existing messages, or because the git-gui software
+itself was updated and there are new messages that need translation.
+
+In any case, make sure you are up-to-date before starting your work:
+
+ $ git pull
+
+In the former case, you will edit po/af.po (again, replace "af" with
+your language code), and after testing and updating the Last-Translator:
+and PO-Revision-Date: lines, "add/commit/push" as in the previous
+section.
+
+By comparing "POT-Creation-Date:" line in po/git-gui.pot file and
+po/af.po file, you can tell if there are new messages that need to be
+translated. You would need the GNU gettext package to perform this
+step.
+
+ $ msgmerge -U po/af.po po/git-gui.pot
+
+[NEEDSWORK: who is responsible for updating po/git-gui.pot file by
+running xgettext? IIRC, Christian recommended against running it
+nilly-willy because it can become a source of unnecessary merge
+conflicts. Perhaps we should mention something like "
+
+The po/git-gui.pot file is updated by the internationalization
+coordinator from time to time. You _could_ update it yourself, but
+translators are discouraged from doing so because we would want all
+language teams to be working off of the same version of git-gui.pot.
+
+" here?]
+
+This updates po/af.po (again, replace "af" with your language
+code) so that it contains msgid lines (i.e. the original) that
+your translation did not have before. There are a few things to
+watch out for:
+
+ - The original text in English of an older message you already
+ translated might have been changed. You will notice a comment line
+ that begins with "#, fuzzy" in front of such a message. msgmerge
+ tool made its best effort to match your old translation with the
+ message from the updated software, but you may find cases that it
+ matched your old translated message to a new msgid and the pairing
+ does not make any sense -- you would need to fix them, and then
+ remove the "#, fuzzy" line from the message (your fixed translation
+ of the message will not be used before you remove the marker).
+
+ - New messages added to the software will have msgstr lines with empty
+ strings. You would need to translate them.
--
1.5.3.2.g46909
^ permalink raw reply related
* [PATCH 04/15] Add po/git-gui.pot
From: Johannes Schindelin @ 2007-09-02 16:31 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021719380.28586@racer.site>
Usually, generated files are not part of the tracked content in
a project. However, translators may lack the tools to generate
git-gui.pot. Besides, it is possible that a contributor does
not even check out the repository, but gets this file via gitweb.
Pointed out by Junio.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
po/git-gui.pot | 1264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1264 insertions(+), 0 deletions(-)
create mode 100644 po/git-gui.pot
diff --git a/po/git-gui.pot b/po/git-gui.pot
new file mode 100644
index 0000000..991efea
--- /dev/null
+++ b/po/git-gui.pot
@@ -0,0 +1,1264 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-08-11 17:28+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: git-gui.sh:531
+msgid "Cannot find git in PATH."
+msgstr ""
+
+#: git-gui.sh:550
+msgid "Cannot parse Git version string:"
+msgstr ""
+
+#: git-gui.sh:567
+#, tcl-format
+msgid ""
+"Git version cannot be determined.\n"
+"\n"
+"%s claims it is version '%s'.\n"
+"\n"
+"%s requires at least Git 1.5.0 or later.\n"
+"\n"
+"Assume '%s' is version 1.5.0?\n"
+msgstr ""
+
+#: git-gui.sh:689
+msgid "Cannot find the git directory:"
+msgstr ""
+
+#: git-gui.sh:697
+msgid "Git directory not found:"
+msgstr ""
+
+#: git-gui.sh:703
+msgid "Cannot use funny .git directory:"
+msgstr ""
+
+#: git-gui.sh:708
+msgid "No working directory"
+msgstr ""
+
+#: git-gui.sh:854
+msgid "Refreshing file status..."
+msgstr ""
+
+#: git-gui.sh:891
+msgid "Scanning for modified files ..."
+msgstr ""
+
+#: git-gui.sh:1057 lib/browser.tcl:247
+msgid "Ready."
+msgstr ""
+
+#: git-gui.sh:1322
+msgid "Unmodified"
+msgstr ""
+
+#: git-gui.sh:1324
+msgid "Modified, not staged"
+msgstr ""
+
+#: git-gui.sh:1325 git-gui.sh:1330
+msgid "Staged for commit"
+msgstr ""
+
+#: git-gui.sh:1326 git-gui.sh:1331
+msgid "Portions staged for commit"
+msgstr ""
+
+#: git-gui.sh:1327 git-gui.sh:1332
+msgid "Staged for commit, missing"
+msgstr ""
+
+#: git-gui.sh:1329
+msgid "Untracked, not staged"
+msgstr ""
+
+#: git-gui.sh:1334
+msgid "Missing"
+msgstr ""
+
+#: git-gui.sh:1335
+msgid "Staged for removal"
+msgstr ""
+
+#: git-gui.sh:1336
+msgid "Staged for removal, still present"
+msgstr ""
+
+#: git-gui.sh:1338 git-gui.sh:1339 git-gui.sh:1340 git-gui.sh:1341
+msgid "Requires merge resolution"
+msgstr ""
+
+#: git-gui.sh:1383
+msgid "Starting gitk... please wait..."
+msgstr ""
+
+#: git-gui.sh:1392
+#, tcl-format
+msgid ""
+"Unable to start gitk:\n"
+"\n"
+"%s does not exist"
+msgstr ""
+
+#: git-gui.sh:1609
+#, tcl-format
+msgid "Invalid font specified in gui.%s:"
+msgstr ""
+
+#: git-gui.sh:1634
+msgid "Main Font"
+msgstr ""
+
+#: git-gui.sh:1635
+msgid "Diff/Console Font"
+msgstr ""
+
+#: git-gui.sh:1649
+msgid "Repository"
+msgstr ""
+
+#: git-gui.sh:1650
+msgid "Edit"
+msgstr ""
+
+#: git-gui.sh:1652
+msgid "Branch"
+msgstr ""
+
+#: git-gui.sh:1655 git-gui.sh:1842 git-gui.sh:2152
+msgid "Commit"
+msgstr ""
+
+#: git-gui.sh:1658 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168
+msgid "Merge"
+msgstr ""
+
+#: git-gui.sh:1659
+msgid "Fetch"
+msgstr ""
+
+#: git-gui.sh:1660 git-gui.sh:2158 lib/transport.tcl:88 lib/transport.tcl:172
+msgid "Push"
+msgstr ""
+
+#: git-gui.sh:1669
+msgid "Browse Current Branch's Files"
+msgstr ""
+
+#: git-gui.sh:1673
+msgid "Browse Branch Files..."
+msgstr ""
+
+#: git-gui.sh:1678
+msgid "Visualize Current Branch's History"
+msgstr ""
+
+#: git-gui.sh:1682
+msgid "Visualize All Branch History"
+msgstr ""
+
+#: git-gui.sh:1689
+#, tcl-format
+msgid "Browse %s's Files"
+msgstr ""
+
+#: git-gui.sh:1691
+#, tcl-format
+msgid "Visualize %s's History"
+msgstr ""
+
+#: git-gui.sh:1696 lib/database.tcl:27 lib/database.tcl:67
+msgid "Database Statistics"
+msgstr ""
+
+#: git-gui.sh:1699 lib/database.tcl:34
+msgid "Compress Database"
+msgstr ""
+
+#: git-gui.sh:1702
+msgid "Verify Database"
+msgstr ""
+
+#: git-gui.sh:1709 git-gui.sh:1713 git-gui.sh:1717 lib/shortcut.tcl:9
+#: lib/shortcut.tcl:45 lib/shortcut.tcl:84
+msgid "Create Desktop Icon"
+msgstr ""
+
+#: git-gui.sh:1722
+msgid "Quit"
+msgstr ""
+
+#: git-gui.sh:1729
+msgid "Undo"
+msgstr ""
+
+#: git-gui.sh:1732
+msgid "Redo"
+msgstr ""
+
+#: git-gui.sh:1736 git-gui.sh:2222
+msgid "Cut"
+msgstr ""
+
+#: git-gui.sh:1739 git-gui.sh:2225 git-gui.sh:2296 git-gui.sh:2368
+#: lib/console.tcl:69
+msgid "Copy"
+msgstr ""
+
+#: git-gui.sh:1742 git-gui.sh:2228
+msgid "Paste"
+msgstr ""
+
+#: git-gui.sh:1745 git-gui.sh:2231 lib/branch_delete.tcl:26
+#: lib/remote_branch_delete.tcl:38
+msgid "Delete"
+msgstr ""
+
+#: git-gui.sh:1749 git-gui.sh:2235 git-gui.sh:2372 lib/console.tcl:71
+msgid "Select All"
+msgstr ""
+
+#: git-gui.sh:1758
+msgid "Create..."
+msgstr ""
+
+#: git-gui.sh:1764
+msgid "Checkout..."
+msgstr ""
+
+#: git-gui.sh:1770
+msgid "Rename..."
+msgstr ""
+
+#: git-gui.sh:1775 git-gui.sh:1873
+msgid "Delete..."
+msgstr ""
+
+#: git-gui.sh:1780
+msgid "Reset..."
+msgstr ""
+
+#: git-gui.sh:1792 git-gui.sh:2169
+msgid "New Commit"
+msgstr ""
+
+#: git-gui.sh:1800 git-gui.sh:2176
+msgid "Amend Last Commit"
+msgstr ""
+
+#: git-gui.sh:1809 git-gui.sh:2136 lib/remote_branch_delete.tcl:99
+msgid "Rescan"
+msgstr ""
+
+#: git-gui.sh:1815
+msgid "Stage To Commit"
+msgstr ""
+
+#: git-gui.sh:1820
+msgid "Stage Changed Files To Commit"
+msgstr ""
+
+#: git-gui.sh:1826
+msgid "Unstage From Commit"
+msgstr ""
+
+#: git-gui.sh:1831 lib/index.tcl:376
+msgid "Revert Changes"
+msgstr ""
+
+#: git-gui.sh:1838 git-gui.sh:2148 git-gui.sh:2246
+msgid "Sign Off"
+msgstr ""
+
+#: git-gui.sh:1853
+msgid "Local Merge..."
+msgstr ""
+
+#: git-gui.sh:1858
+msgid "Abort Merge..."
+msgstr ""
+
+#: git-gui.sh:1870
+msgid "Push..."
+msgstr ""
+
+#: git-gui.sh:1880
+msgid "Apple"
+msgstr ""
+
+#: git-gui.sh:1883 git-gui.sh:1901 lib/option.tcl:65
+#, tcl-format
+msgid "About %s"
+msgstr ""
+
+#: git-gui.sh:1885 git-gui.sh:1891 git-gui.sh:2414
+msgid "Options..."
+msgstr ""
+
+#: git-gui.sh:1897
+msgid "Help"
+msgstr ""
+
+#: git-gui.sh:1938
+msgid "Online Documentation"
+msgstr ""
+
+#: git-gui.sh:2054
+msgid "Current Branch:"
+msgstr ""
+
+#: git-gui.sh:2075
+msgid "Staged Changes (Will Be Committed)"
+msgstr ""
+
+#: git-gui.sh:2095
+msgid "Unstaged Changes (Will Not Be Committed)"
+msgstr ""
+
+#: git-gui.sh:2142
+msgid "Stage Changed"
+msgstr ""
+
+#: git-gui.sh:2188
+msgid "Initial Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2189
+msgid "Amended Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2190
+msgid "Amended Initial Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2191
+msgid "Amended Merge Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2192
+msgid "Merge Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2193
+msgid "Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2238 git-gui.sh:2376 lib/console.tcl:73
+msgid "Copy All"
+msgstr ""
+
+#: git-gui.sh:2262 lib/blame.tcl:104
+msgid "File:"
+msgstr ""
+
+#: git-gui.sh:2364
+msgid "Refresh"
+msgstr ""
+
+#: git-gui.sh:2385
+msgid "Apply/Reverse Hunk"
+msgstr ""
+
+#: git-gui.sh:2391
+msgid "Decrease Font Size"
+msgstr ""
+
+#: git-gui.sh:2395
+msgid "Increase Font Size"
+msgstr ""
+
+#: git-gui.sh:2400
+msgid "Show Less Context"
+msgstr ""
+
+#: git-gui.sh:2407
+msgid "Show More Context"
+msgstr ""
+
+#: git-gui.sh:2422
+msgid "Unstage Hunk From Commit"
+msgstr ""
+
+#: git-gui.sh:2426 git-gui.sh:2430
+msgid "Stage Hunk For Commit"
+msgstr ""
+
+#: git-gui.sh:2440
+msgid "Initializing..."
+msgstr ""
+
+#: lib/blame.tcl:77
+msgid "File Viewer"
+msgstr ""
+
+#: lib/blame.tcl:81
+msgid "Commit:"
+msgstr ""
+
+#: lib/blame.tcl:249
+msgid "Copy Commit"
+msgstr ""
+
+#: lib/blame.tcl:369
+#, tcl-format
+msgid "Reading %s..."
+msgstr ""
+
+#: lib/branch_checkout.tcl:14 lib/branch_checkout.tcl:19
+msgid "Checkout Branch"
+msgstr ""
+
+#: lib/branch_checkout.tcl:23
+msgid "Checkout"
+msgstr ""
+
+#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35
+#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:283
+#: lib/checkout_op.tcl:522 lib/merge.tcl:172 lib/option.tcl:172
+#: lib/remote_branch_delete.tcl:42 lib/transport.tcl:92
+msgid "Cancel"
+msgstr ""
+
+#: lib/branch_checkout.tcl:32 lib/browser.tcl:288
+msgid "Revision"
+msgstr ""
+
+#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:159
+#: lib/option.tcl:274
+msgid "Options"
+msgstr ""
+
+#: lib/branch_checkout.tcl:39 lib/branch_create.tcl:92
+msgid "Fetch Tracking Branch"
+msgstr ""
+
+#: lib/branch_checkout.tcl:44
+msgid "Detach From Local Branch"
+msgstr ""
+
+#: lib/branch_create.tcl:22
+msgid "Create Branch"
+msgstr ""
+
+#: lib/branch_create.tcl:27
+msgid "Create New Branch"
+msgstr ""
+
+#: lib/branch_create.tcl:31
+msgid "Create"
+msgstr ""
+
+#: lib/branch_create.tcl:40
+msgid "Branch Name"
+msgstr ""
+
+#: lib/branch_create.tcl:43
+msgid "Name:"
+msgstr ""
+
+#: lib/branch_create.tcl:58
+msgid "Match Tracking Branch Name"
+msgstr ""
+
+#: lib/branch_create.tcl:66
+msgid "Starting Revision"
+msgstr ""
+
+#: lib/branch_create.tcl:72
+msgid "Update Existing Branch:"
+msgstr ""
+
+#: lib/branch_create.tcl:75
+msgid "No"
+msgstr ""
+
+#: lib/branch_create.tcl:80
+msgid "Fast Forward Only"
+msgstr ""
+
+#: lib/branch_create.tcl:85 lib/checkout_op.tcl:514
+msgid "Reset"
+msgstr ""
+
+#: lib/branch_create.tcl:97
+msgid "Checkout After Creation"
+msgstr ""
+
+#: lib/branch_create.tcl:131
+msgid "Please select a tracking branch."
+msgstr ""
+
+#: lib/branch_create.tcl:140
+#, tcl-format
+msgid "Tracking branch %s is not a branch in the remote repository."
+msgstr ""
+
+#: lib/branch_create.tcl:153 lib/branch_rename.tcl:86
+msgid "Please supply a branch name."
+msgstr ""
+
+#: lib/branch_create.tcl:164 lib/branch_rename.tcl:106
+#, tcl-format
+msgid "'%s' is not an acceptable branch name."
+msgstr ""
+
+#: lib/branch_delete.tcl:15
+msgid "Delete Branch"
+msgstr ""
+
+#: lib/branch_delete.tcl:20
+msgid "Delete Local Branch"
+msgstr ""
+
+#: lib/branch_delete.tcl:37
+msgid "Local Branches"
+msgstr ""
+
+#: lib/branch_delete.tcl:52
+msgid "Delete Only If Merged Into"
+msgstr ""
+
+#: lib/branch_delete.tcl:54
+msgid "Always (Do not perform merge test.)"
+msgstr ""
+
+#: lib/branch_delete.tcl:103
+#, tcl-format
+msgid "The following branches are not completely merged into %s:"
+msgstr ""
+
+#: lib/branch_delete.tcl:115
+msgid ""
+"Recovering deleted branches is difficult. \n"
+"\n"
+" Delete the selected branches?"
+msgstr ""
+
+#: lib/branch_delete.tcl:141
+#, tcl-format
+msgid ""
+"Failed to delete branches:\n"
+"%s"
+msgstr ""
+
+#: lib/branch_rename.tcl:14 lib/branch_rename.tcl:22
+msgid "Rename Branch"
+msgstr ""
+
+#: lib/branch_rename.tcl:26
+msgid "Rename"
+msgstr ""
+
+#: lib/branch_rename.tcl:36
+msgid "Branch:"
+msgstr ""
+
+#: lib/branch_rename.tcl:39
+msgid "New Name:"
+msgstr ""
+
+#: lib/branch_rename.tcl:75
+msgid "Please select a branch to rename."
+msgstr ""
+
+#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:179
+#, tcl-format
+msgid "Branch '%s' already exists."
+msgstr ""
+
+#: lib/branch_rename.tcl:117
+#, tcl-format
+msgid "Failed to rename '%s'."
+msgstr ""
+
+#: lib/browser.tcl:17
+msgid "Starting..."
+msgstr ""
+
+#: lib/browser.tcl:26
+msgid "File Browser"
+msgstr ""
+
+#: lib/browser.tcl:127 lib/browser.tcl:144
+#, tcl-format
+msgid "Loading %s..."
+msgstr ""
+
+#: lib/browser.tcl:188
+msgid "[Up To Parent]"
+msgstr ""
+
+#: lib/browser.tcl:268 lib/browser.tcl:274
+msgid "Browse Branch Files"
+msgstr ""
+
+#: lib/browser.tcl:279
+msgid "Browse"
+msgstr ""
+
+#: lib/checkout_op.tcl:79
+#, tcl-format
+msgid "Fetching %s from %s"
+msgstr ""
+
+#: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31
+msgid "Close"
+msgstr ""
+
+#: lib/checkout_op.tcl:169
+#, tcl-format
+msgid "Branch '%s' does not exist."
+msgstr ""
+
+#: lib/checkout_op.tcl:206
+#, tcl-format
+msgid ""
+"Branch '%s' already exists.\n"
+"\n"
+"It cannot fast-forward to %s.\n"
+"A merge is required."
+msgstr ""
+
+#: lib/checkout_op.tcl:220
+#, tcl-format
+msgid "Merge strategy '%s' not supported."
+msgstr ""
+
+#: lib/checkout_op.tcl:239
+#, tcl-format
+msgid "Failed to update '%s'."
+msgstr ""
+
+#: lib/checkout_op.tcl:251
+msgid "Staging area (index) is already locked."
+msgstr ""
+
+#: lib/checkout_op.tcl:266
+msgid ""
+"Last scanned state does not match repository state.\n"
+"\n"
+"Another Git program has modified this repository since the last scan. A "
+"rescan must be performed before the current branch can be changed.\n"
+"\n"
+"The rescan will be automatically started now.\n"
+msgstr ""
+
+#: lib/checkout_op.tcl:353
+#, tcl-format
+msgid "Aborted checkout of '%s' (file level merging is required)."
+msgstr ""
+
+#: lib/checkout_op.tcl:354
+msgid "File level merge required."
+msgstr ""
+
+#: lib/checkout_op.tcl:358
+#, tcl-format
+msgid "Staying on branch '%s'."
+msgstr ""
+
+#: lib/checkout_op.tcl:429
+msgid ""
+"You are no longer on a local branch.\n"
+"\n"
+"If you wanted to be on a branch, create one now starting from 'This Detached "
+"Checkout'."
+msgstr ""
+
+#: lib/checkout_op.tcl:478
+#, tcl-format
+msgid "Resetting '%s' to '%s' will lose the following commits:"
+msgstr ""
+
+#: lib/checkout_op.tcl:500
+msgid "Recovering lost commits may not be easy."
+msgstr ""
+
+#: lib/checkout_op.tcl:505
+#, tcl-format
+msgid "Reset '%s'?"
+msgstr ""
+
+#: lib/checkout_op.tcl:510 lib/merge.tcl:164
+msgid "Visualize"
+msgstr ""
+
+#: lib/checkout_op.tcl:578
+#, tcl-format
+msgid ""
+"Failed to set current branch.\n"
+"\n"
+"This working directory is only partially switched. We successfully updated "
+"your files, but failed to update an internal Git file.\n"
+"\n"
+"This should not have occurred. %s will now close and give up."
+msgstr ""
+
+#: lib/choose_rev.tcl:53
+msgid "This Detached Checkout"
+msgstr ""
+
+#: lib/choose_rev.tcl:60
+msgid "Revision Expression:"
+msgstr ""
+
+#: lib/choose_rev.tcl:74
+msgid "Local Branch"
+msgstr ""
+
+#: lib/choose_rev.tcl:79
+msgid "Tracking Branch"
+msgstr ""
+
+#: lib/choose_rev.tcl:84
+msgid "Tag"
+msgstr ""
+
+#: lib/choose_rev.tcl:317
+#, tcl-format
+msgid "Invalid revision: %s"
+msgstr ""
+
+#: lib/choose_rev.tcl:338
+msgid "No revision selected."
+msgstr ""
+
+#: lib/choose_rev.tcl:346
+msgid "Revision expression is empty."
+msgstr ""
+
+#: lib/commit.tcl:9
+msgid ""
+"There is nothing to amend.\n"
+"\n"
+"You are about to create the initial commit. There is no commit before this "
+"to amend.\n"
+msgstr ""
+
+#: lib/commit.tcl:18
+msgid ""
+"Cannot amend while merging.\n"
+"\n"
+"You are currently in the middle of a merge that has not been fully "
+"completed. You cannot amend the prior commit unless you first abort the "
+"current merge activity.\n"
+msgstr ""
+
+#: lib/commit.tcl:49
+msgid "Error loading commit data for amend:"
+msgstr ""
+
+#: lib/commit.tcl:76
+msgid "Unable to obtain your identity:"
+msgstr ""
+
+#: lib/commit.tcl:81
+msgid "Invalid GIT_COMMITTER_IDENT:"
+msgstr ""
+
+#: lib/commit.tcl:133
+msgid ""
+"Last scanned state does not match repository state.\n"
+"\n"
+"Another Git program has modified this repository since the last scan. A "
+"rescan must be performed before another commit can be created.\n"
+"\n"
+"The rescan will be automatically started now.\n"
+msgstr ""
+
+#: lib/commit.tcl:154
+#, tcl-format
+msgid ""
+"Unmerged files cannot be committed.\n"
+"\n"
+"File %s has merge conflicts. You must resolve them and stage the file "
+"before committing.\n"
+msgstr ""
+
+#: lib/commit.tcl:162
+#, tcl-format
+msgid ""
+"Unknown file state %s detected.\n"
+"\n"
+"File %s cannot be committed by this program.\n"
+msgstr ""
+
+#: lib/commit.tcl:170
+msgid ""
+"No changes to commit.\n"
+"\n"
+"You must stage at least 1 file before you can commit.\n"
+msgstr ""
+
+#: lib/commit.tcl:183
+msgid ""
+"Please supply a commit message.\n"
+"\n"
+"A good commit message has the following format:\n"
+"\n"
+"- First line: Describe in one sentance what you did.\n"
+"- Second line: Blank\n"
+"- Remaining lines: Describe why this change is good.\n"
+msgstr ""
+
+#: lib/commit.tcl:257
+msgid "write-tree failed:"
+msgstr ""
+
+#: lib/commit.tcl:279
+msgid ""
+"No changes to commit.\n"
+"\n"
+"No files were modified by this commit and it was not a merge commit.\n"
+"\n"
+"A rescan will be automatically started now.\n"
+msgstr ""
+
+#: lib/commit.tcl:286
+msgid "No changes to commit."
+msgstr ""
+
+#: lib/commit.tcl:317
+msgid "commit-tree failed:"
+msgstr ""
+
+#: lib/commit.tcl:339
+msgid "update-ref failed:"
+msgstr ""
+
+#: lib/commit.tcl:430
+#, tcl-format
+msgid "Created commit %s: %s"
+msgstr ""
+
+#: lib/console.tcl:55
+msgid "Working... please wait..."
+msgstr ""
+
+#: lib/console.tcl:184
+msgid "Success"
+msgstr ""
+
+#: lib/console.tcl:194
+msgid "Error: Command Failed"
+msgstr ""
+
+#: lib/database.tcl:43
+msgid "Number of loose objects"
+msgstr ""
+
+#: lib/database.tcl:44
+msgid "Disk space used by loose objects"
+msgstr ""
+
+#: lib/database.tcl:45
+msgid "Number of packed objects"
+msgstr ""
+
+#: lib/database.tcl:46
+msgid "Number of packs"
+msgstr ""
+
+#: lib/database.tcl:47
+msgid "Disk space used by packed objects"
+msgstr ""
+
+#: lib/database.tcl:48
+msgid "Packed objects waiting for pruning"
+msgstr ""
+
+#: lib/database.tcl:49
+msgid "Garbage files"
+msgstr ""
+
+#: lib/database.tcl:72
+msgid "Compressing the object database"
+msgstr ""
+
+#: lib/database.tcl:83
+msgid "Verifying the object database with fsck-objects"
+msgstr ""
+
+#: lib/diff.tcl:42
+#, tcl-format
+msgid ""
+"No differences detected.\n"
+"\n"
+"%s has no changes.\n"
+"\n"
+"The modification date of this file was updated by another application, but "
+"the content within the file was not changed.\n"
+"\n"
+"A rescan will be automatically started to find other files which may have "
+"the same state."
+msgstr ""
+
+#: lib/diff.tcl:97
+msgid "Error loading file:"
+msgstr ""
+
+#: lib/diff.tcl:162
+msgid "Error loading diff:"
+msgstr ""
+
+#: lib/diff.tcl:278
+msgid "Failed to unstage selected hunk."
+msgstr ""
+
+#: lib/diff.tcl:285
+msgid "Failed to stage selected hunk."
+msgstr ""
+
+#: lib/error.tcl:12 lib/error.tcl:102
+msgid "error"
+msgstr ""
+
+#: lib/error.tcl:28
+msgid "warning"
+msgstr ""
+
+#: lib/error.tcl:81
+msgid "You must correct the above errors before committing."
+msgstr ""
+
+#: lib/index.tcl:364
+#, tcl-format
+msgid "Revert changes in file %s?"
+msgstr ""
+
+#: lib/index.tcl:366
+#, tcl-format
+msgid "Revert changes in these %i files?"
+msgstr ""
+
+#: lib/index.tcl:372
+msgid "Any unstaged changes will be permanently lost by the revert."
+msgstr ""
+
+#: lib/index.tcl:375
+msgid "Do Nothing"
+msgstr ""
+
+#: lib/merge.tcl:13
+msgid ""
+"Cannot merge while amending.\n"
+"\n"
+"You must finish amending this commit before starting any type of merge.\n"
+msgstr ""
+
+#: lib/merge.tcl:27
+msgid ""
+"Last scanned state does not match repository state.\n"
+"\n"
+"Another Git program has modified this repository since the last scan. A "
+"rescan must be performed before a merge can be performed.\n"
+"\n"
+"The rescan will be automatically started now.\n"
+msgstr ""
+
+#: lib/merge.tcl:44
+#, tcl-format
+msgid ""
+"You are in the middle of a conflicted merge.\n"
+"\n"
+"File %s has merge conflicts.\n"
+"\n"
+"You must resolve them, stage the file, and commit to complete the current "
+"merge. Only then can you begin another merge.\n"
+msgstr ""
+
+#: lib/merge.tcl:54
+#, tcl-format
+msgid ""
+"You are in the middle of a change.\n"
+"\n"
+"File %s is modified.\n"
+"\n"
+"You should complete the current commit before starting a merge. Doing so "
+"will help you abort a failed merge, should the need arise.\n"
+msgstr ""
+
+#: lib/merge.tcl:106
+#, tcl-format
+msgid "%s of %s"
+msgstr ""
+
+#: lib/merge.tcl:119
+#, tcl-format
+msgid "Merging %s and %s"
+msgstr ""
+
+#: lib/merge.tcl:131
+msgid "Merge completed successfully."
+msgstr ""
+
+#: lib/merge.tcl:133
+msgid "Merge failed. Conflict resolution is required."
+msgstr ""
+
+#: lib/merge.tcl:158
+#, tcl-format
+msgid "Merge Into %s"
+msgstr ""
+
+#: lib/merge.tcl:177
+msgid "Revision To Merge"
+msgstr ""
+
+#: lib/merge.tcl:212
+msgid ""
+"Cannot abort while amending.\n"
+"\n"
+"You must finish amending this commit.\n"
+msgstr ""
+
+#: lib/merge.tcl:222
+msgid ""
+"Abort merge?\n"
+"\n"
+"Aborting the current merge will cause *ALL* uncommitted changes to be lost.\n"
+"\n"
+"Continue with aborting the current merge?"
+msgstr ""
+
+#: lib/merge.tcl:228
+msgid ""
+"Reset changes?\n"
+"\n"
+"Resetting the changes will cause *ALL* uncommitted changes to be lost.\n"
+"\n"
+"Continue with resetting the current changes?"
+msgstr ""
+
+#: lib/merge.tcl:239
+msgid "Aborting"
+msgstr ""
+
+#: lib/merge.tcl:266
+msgid "Abort failed."
+msgstr ""
+
+#: lib/merge.tcl:268
+msgid "Abort completed. Ready."
+msgstr ""
+
+#: lib/option.tcl:77
+msgid "git-gui - a graphical user interface for Git."
+msgstr ""
+
+#: lib/option.tcl:164
+msgid "Restore Defaults"
+msgstr ""
+
+#: lib/option.tcl:168
+msgid "Save"
+msgstr ""
+
+#: lib/option.tcl:178
+#, tcl-format
+msgid "%s Repository"
+msgstr ""
+
+#: lib/option.tcl:179
+msgid "Global (All Repositories)"
+msgstr ""
+
+#: lib/option.tcl:185
+msgid "User Name"
+msgstr ""
+
+#: lib/option.tcl:186
+msgid "Email Address"
+msgstr ""
+
+#: lib/option.tcl:188
+msgid "Summarize Merge Commits"
+msgstr ""
+
+#: lib/option.tcl:189
+msgid "Merge Verbosity"
+msgstr ""
+
+#: lib/option.tcl:190
+msgid "Show Diffstat After Merge"
+msgstr ""
+
+#: lib/option.tcl:192
+msgid "Trust File Modification Timestamps"
+msgstr ""
+
+#: lib/option.tcl:193
+msgid "Prune Tracking Branches During Fetch"
+msgstr ""
+
+#: lib/option.tcl:194
+msgid "Match Tracking Branches"
+msgstr ""
+
+#: lib/option.tcl:195
+msgid "Number of Diff Context Lines"
+msgstr ""
+
+#: lib/option.tcl:196
+msgid "New Branch Name Template"
+msgstr ""
+
+#: lib/option.tcl:305
+msgid "Failed to completely save options:"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34
+msgid "Delete Remote Branch"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:47
+msgid "From Repository"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:50 lib/transport.tcl:118
+msgid "Remote:"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:66 lib/transport.tcl:133
+msgid "Arbitrary URL:"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:84
+msgid "Branches"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:109
+msgid "Delete Only If"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:111
+msgid "Merged Into:"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:119
+msgid "Always (Do not perform merge checks)"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:152
+msgid "A branch is required for 'Merged Into'."
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:189
+#, tcl-format
+msgid ""
+"One or more of the merge tests failed because you have not fetched the "
+"necessary commits. Try fetching from %s first."
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:207
+msgid "Please select one or more branches to delete."
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:216
+msgid ""
+"Recovering deleted branches is difficult.\n"
+"\n"
+"Delete the selected branches?"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:226
+#, tcl-format
+msgid "Deleting branches from %s"
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:286
+msgid "No repository selected."
+msgstr ""
+
+#: lib/remote_branch_delete.tcl:291
+#, tcl-format
+msgid "Scanning %s..."
+msgstr ""
+
+#: lib/remote.tcl:162
+#, tcl-format
+msgid "Fetch from %s..."
+msgstr ""
+
+#: lib/remote.tcl:172
+#, tcl-format
+msgid "Prune from %s..."
+msgstr ""
+
+#: lib/remote.tcl:206
+#, tcl-format
+msgid "Push to %s..."
+msgstr ""
+
+#: lib/shortcut.tcl:26 lib/shortcut.tcl:74
+msgid "Cannot write script:"
+msgstr ""
+
+#: lib/shortcut.tcl:149
+msgid "Cannot write icon:"
+msgstr ""
+
+#: lib/status_bar.tcl:58
+#, tcl-format
+msgid "%s ... %i of %i %s (%2i%%)"
+msgstr ""
+
+#: lib/transport.tcl:7
+#, tcl-format
+msgid "Fetching new changes from %s"
+msgstr ""
+
+#: lib/transport.tcl:19
+#, tcl-format
+msgid "Pruning tracking branches deleted from %s"
+msgstr ""
+
+#: lib/transport.tcl:26
+#, tcl-format
+msgid "Pushing changes to %s"
+msgstr ""
+
+#: lib/transport.tcl:68
+#, tcl-format
+msgid "Pushing %s %s to %s"
+msgstr ""
+
+#: lib/transport.tcl:84
+msgid "Push Branches"
+msgstr ""
+
+#: lib/transport.tcl:98
+msgid "Source Branches"
+msgstr ""
+
+#: lib/transport.tcl:115
+msgid "Destination Repository"
+msgstr ""
+
+#: lib/transport.tcl:153
+msgid "Transfer Options"
+msgstr ""
+
+#: lib/transport.tcl:155
+msgid "Use thin pack (for slow network connections)"
+msgstr ""
+
+#: lib/transport.tcl:159
+msgid "Include tags"
+msgstr ""
--
1.5.3.2.g46909
^ permalink raw reply related
* [PATCH 05/15] Ignore po/*.msg
From: Johannes Schindelin @ 2007-09-02 16:31 UTC (permalink / raw)
To: Shawn O. Pearce, git
In-Reply-To: <Pine.LNX.4.64.0709021719380.28586@racer.site>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
po/.gitignore | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 po/.gitignore
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..a89cf44
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,2 @@
+*.msg
+*~
--
1.5.3.2.g46909
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox