Git development
 help / color / mirror / Atom feed
* Re: [Q] what to do when waitpid() returns ECHILD under signal(SIGCHLD, SIG_IGN)?
From: Edgar Toernig @ 2006-06-20 16:09 UTC (permalink / raw)
  To: git
In-Reply-To: <7vwtbc7ll6.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
>
> Somebody I met last week in Japan reported that the socks client
> he uses to cross the firewall to connect to git:// port from his
> company environment seems to do signal(SIGCHLD, SIG_IGN) before
> spawning git.

Similar problems occasionally happen with SIGPIPE.  There are apps[1]
that spawn processes with SIGPIPE set to SIG_IGN giving unexpected
results, i.e. child processes that still try to produce output
(getting EPIPE on every printf, but who checks printf errors?) even
if the pipe-reader (e.g. their parent) is long gone.

Ciao, ET.

[1] i.e. KDE had this bug - don't know if it's still there.

^ permalink raw reply

* git grep in .
From: Uwe Zeisberger @ 2006-06-20 16:08 UTC (permalink / raw)
  To: git

Hello,

git grep behaves wrongly if I give it . as path to search in.

E.g.

	uzeisberger@io:~/gsrc/git$ git version
	git version 1.4.0

	uzeisberger@io:~/gsrc/git$ git grep git-grep 
	.gitignore:git-grep
	Documentation/git-grep.txt:git-grep(1)
	Documentation/git-grep.txt:git-grep - Print lines matching a pattern
	Documentation/git-grep.txt:'git-grep' [--cached]
	Documentation/git.txt:gitlink:git-grep[1]::
	Makefile:       git-grep$X git-add$X git-rm$X git-rev-list$X \
	builtin-grep.c:"git-grep <option>* <rev>* [-e] <pattern> [<path>...]";

	uzeisberger@io:~/gsrc/git$ git grep git-grep .

	uzeisberger@io:~/gsrc/git$ 

I'd expect that `git grep git-grep .` gives the same results as `git
grep git-grep`.

Best regards
Uwe

-- 
Uwe Zeisberger

exit vi, lesson II:
: w q ! <CR>

NB: write the current file

^ permalink raw reply

* [PATCH] Add git version to gitweb output
From: Jakub Narebski @ 2006-06-20 15:59 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

---

 gitweb/gitweb.cgi |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

09a68749cb29e1f0add3ac9859c11cd0924f70c7
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 89224e6..87ec565 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -29,6 +29,14 @@ my $projectroot = "/home/kay/public_html
 # location of the git-core binaries
 my $gitbin = "/usr/bin";
 
+# version of the git-core binaries
+my $git_version = qx($gitbin/git --version);
+if ($git_version =~ m/git version (.*)$/) {
+	$git_version = $1;
+} else {
+	$git_version = "unknown";
+}
+
 # location for temporary files needed for diffs
 my $git_temp = "/tmp/gitweb";
 
@@ -288,11 +296,12 @@ sub git_header_html {
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
 <!-- git web interface v$version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
+<!-- git core binaries version $git_version -->
 <head>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
 <meta name="robots" content="index, nofollow"/>
-<link rel="stylesheet" type="text/css" href="$stylesheet"/>
 <title>$title</title>
+<link rel="stylesheet" type="text/css" href="$stylesheet"/>
 $rss_link
 </head>
 <body>
@@ -816,7 +825,7 @@ sub git_get_project_config {
 	$key =~ s/^gitweb\.//;
 	return if ($key =~ m/\W/);
 
-	my $val = qx(git-repo-config --get gitweb.$key);
+	my $val = qx($gitbin/git-repo-config --get gitweb.$key);
 	return ($val);
 }
 
-- 
1.3.0

^ permalink raw reply related

* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
From: David Woodhouse @ 2006-06-20 15:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jakub Narebski, git
In-Reply-To: <7vd5d4chmg.fsf@assigned-by-dhcp.cox.net>

On Tue, 2006-06-20 at 02:15 -0700, Junio C Hamano wrote:
> I wonder if there is somebody who is willing to run gitweb from
> the "next" branch on some public site, so that I can be
> reasonably confident before breaking one of the most important
> infrastructure of the kernel development?  Volunteers? 

Yeah, we can do it on git.infradead.org if you promise to respond
quickly when you break it. Or I can set up a virtual host on
http://git2.infradead.org/ to use the testing version if you'd prefer.

Mail me a SSH public key, I'll give you an account.

-- 
dwmw2

^ permalink raw reply

* Re: packs and trees
From: Keith Packard @ 2006-06-20 15:18 UTC (permalink / raw)
  To: Jon Smirl; +Cc: keithp, Martin Langhoff, git
In-Reply-To: <9e4733910606200735u5741a9adr83264ae7d51dd37@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

On Tue, 2006-06-20 at 10:35 -0400, Jon Smirl wrote:

> Keith's parsecvs run ended up in a loop and mine hit a parsecvs error
> and then had memory corruption after about eight hours. That was last
> week,  I just checked the logs and I don't see any comments about
> fixing it.

Yeah, I'm rewriting the tool; the current codebase isn't supportable.

> Even after spending eight hours building the changeset info iit is
> still going to take it a couple of days to retrieve the versions one
> at a time and write them to git. Reparsing 50MB delta files n^2/2
> times is a major bottleneck for all three programs.

The eight hours in question *were* writing out the deltas and packing
the resulting trees. All that remained was to construct actual commit
objects and write them out. 

The problem was that parsecvs's internals are structured so that this
processes would take a large amount of memory, so I'm reworking the code
to free stuff as it goes along.

With a rewritten parsecvs, I'm hoping to be able to steal the algorithms
from cvs2svn and stick those in place. Then work on truncating the
history so it can deal with incremental updates to the repository, which
I think will be straightforward if we stick a few breadcrumbs in the git
repository to recover state from.

-- 
keith.packard@intel.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: packs and trees
From: Nicolas Pitre @ 2006-06-20 15:03 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Jon Smirl, git
In-Reply-To: <46a038f90606192313l16b16132r1523f5e05ae1566a@mail.gmail.com>

On Tue, 20 Jun 2006, Martin Langhoff wrote:

> On 6/20/06, Jon Smirl <jonsmirl@gmail.com> wrote:
> > The plan is to modify rcs2git from parsecvs to create all of the git
> > objects for the tree.
> 
> Sounds like a good plan. Have you seen recent discussions about it
> being impossible to repack usefully when you don't have trees (and
> resulting performance problems on ext3).

What do you mean?


Nicolas

^ permalink raw reply

* [PATCH] gitweb: style done with stylesheet
From: Jakub Narebski @ 2006-06-20 14:58 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Replace (almost) all 'style' attributes with 'class' attribute
and adding rule to CSS file. Some tables use CSS for styling
instead of legacy styling attributes.

---
This patch needs readable CSS style file gitweb/gitweb.css
introduced in previous patch.

It applies on top of next.

 gitweb/gitweb.cgi |   80 ++++++++++++++++++++++--------------------
 gitweb/gitweb.css |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 136 insertions(+), 45 deletions(-)

eaa8afc21044fcce134777b35bdcfb3e97f8ab8f
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 1b254df..89224e6 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -252,6 +252,19 @@ sub unquote {
 	return $str;
 }
 
+# CSS class for given age value (in seconds)
+sub age_class {
+	my $age = shift;
+
+	if ($age < 60*60*2) {
+		return "age0";
+	} elsif ($age < 60*60*24*2) {
+		return "age1";
+	} else {
+		return "age2";
+	}
+}
+
 sub git_header_html {
 	my $status = shift || "200 OK";
 	my $expires = shift;
@@ -600,13 +613,13 @@ sub git_diff_print {
 		while (my $line = <$fd>) {
 			chomp($line);
 			my $char = substr($line, 0, 1);
-			my $color = "";
+			my $diff_class = "";
 			if ($char eq '+') {
-				$color = " style=\"color:#008800;\"";
+				$diff_class = " add";
 			} elsif ($char eq "-") {
-				$color = " style=\"color:#cc0000;\"";
+				$diff_class = " rem";
 			} elsif ($char eq "@") {
-				$color = " style=\"color:#990099;\"";
+				$diff_class = " chunk_header";
 			} elsif ($char eq "\\") {
 				# skip errors
 				next;
@@ -617,7 +630,7 @@ sub git_diff_print {
 					$line =~ s/\t/$spaces/;
 				}
 			}
-			print "<div class=\"pre\"$color>" . esc_html($line) . "</div>\n";
+			print "<div class=\"diff$diff_class\">" . esc_html($line) . "</div>\n";
 		}
 	}
 	close $fd;
@@ -849,7 +862,7 @@ sub git_project_list {
 		close $fd;
 		print "</div>\n";
 	}
-	print "<table cellspacing=\"0\">\n" .
+	print "<table class=\"project_list\">\n" .
 	      "<tr>\n";
 	if (!defined($order) || (defined($order) && ($order eq "project"))) {
 		@projects = sort {$a->{'path'} cmp $b->{'path'}} @projects;
@@ -888,15 +901,7 @@ sub git_project_list {
 		print "<td>" . $cgi->a({-href => "$my_uri?" . esc_param("p=$pr->{'path'};a=summary"), -class => "list"}, esc_html($pr->{'path'})) . "</td>\n" .
 		      "<td>$pr->{'descr'}</td>\n" .
 		      "<td><i>" . chop_str($pr->{'owner'}, 15) . "</i></td>\n";
-		my $colored_age;
-		if ($pr->{'commit'}{'age'} < 60*60*2) {
-			$colored_age = "<span style =\"color: #009900;\"><b><i>$pr->{'commit'}{'age_string'}</i></b></span>";
-		} elsif ($pr->{'commit'}{'age'} < 60*60*24*2) {
-			$colored_age = "<span style =\"color: #009900;\"><i>$pr->{'commit'}{'age_string'}</i></span>";
-		} else {
-			$colored_age = "<i>$pr->{'commit'}{'age_string'}</i>";
-		}
-		print "<td>$colored_age</td>\n" .
+		print "<td class=\"". age_class($pr->{'commit'}{'age'}) . "\">" . $pr->{'commit'}{'age_string'} . "</td>\n" .
 		      "<td class=\"link\">" .
 		      $cgi->a({-href => "$my_uri?" . esc_param("p=$pr->{'path'};a=summary")}, "summary") .
 		      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$pr->{'path'};a=shortlog")}, "shortlog") .
@@ -1240,7 +1245,7 @@ sub git_blame {
 	print "<div class=\"page_path\"><b>" . esc_html($file_name) . "</b></div>\n";
 	print "<div class=\"page_body\">\n";
 	print <<HTML;
-<table style="border-collapse: collapse;">
+<table class="blame">
   <tr>
     <th>Commit</th>
     <th>Age</th>
@@ -1261,7 +1266,7 @@ HTML
 		my $data;
 		my $age;
 		my $age_str;
-		my $age_style;
+		my $age_class;
 
 		chomp $line;
 		$line_class_num = ($line_class_num + 1) % $line_class_len;
@@ -1273,16 +1278,14 @@ HTML
 			$lineno   = $4;
 			$data     = $5;
 		} else {
-			print qq(  <tr><td colspan="5" style="color: red; background-color: yellow;">Unable to parse: $line</td></tr>\n);
+			print qq(  <tr><td colspan="5" class="error">Unable to parse: $line</td></tr>\n);
 			next;
 		}
 		$short_rev  = substr ($long_rev, 0, 8);
 		$age        = time () - $time;
 		$age_str    = age_string ($age);
 		$age_str    =~ s/ /&nbsp;/g;
-		$age_style  = 'font-style: italic;';
-		$age_style .= ' color: #009900; background: transparent;' if ($age < 60*60*24*2);
-		$age_style .= ' font-weight: bold;' if ($age < 60*60*2);
+		$age_class  = age_class($age);
 		$author     = esc_html ($author);
 		$author     =~ s/ /&nbsp;/g;
 		# escape tabs
@@ -1293,15 +1296,14 @@ HTML
 			}
 		}
 		$data = esc_html ($data);
-		$data =~ s/ /&nbsp;/g;
 
 		print <<HTML;
   <tr class="$line_class[$line_class_num]">
-    <td style="font-family: monospace;"><a href="$my_uri?${\esc_param ("p=$project;a=commit;h=$long_rev")}" class="text">$short_rev..</a></td>
-    <td style="$age_style">$age_str</td>
+    <td class="sha1"><a href="$my_uri?${\esc_param ("p=$project;a=commit;h=$long_rev")}" class="text">$short_rev..</a></td>
+    <td class="$age_class">$age_str</td>
     <td>$author</td>
-    <td style="text-align: right;"><a id="$lineno" href="#$lineno" class="linenr">$lineno</a></td>
-    <td style="font-family: monospace;">$data</td>
+    <td class="linenr"><a id="$lineno" href="#$lineno" class="linenr">$lineno</a></td>
+    <td class="pre">$data</td>
   </tr>
 HTML
 	} # while (my $line = <$fd>)
@@ -1646,7 +1648,7 @@ sub git_tree {
 			print "<tr class=\"light\">\n";
 		}
 		$alternate ^= 1;
-		print "<td style=\"font-family:monospace\">" . mode_str($t_mode) . "</td>\n";
+		print "<td class=\"mode\">" . mode_str($t_mode) . "</td>\n";
 		if ($t_type eq "blob") {
 			print "<td class=\"list\">" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name"), -class => "list"}, esc_html($t_name)) .
@@ -1912,7 +1914,7 @@ sub git_commit {
 	      "<tr>" .
 	      "<td></td><td> $ad{'rfc2822'}";
 	if ($ad{'hour_local'} < 6) {
-		printf(" (<span style=\"color: #cc0000;\">%02d:%02d</span> %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
+		printf(" (<span class=\"atnight\">%02d:%02d</span> %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
 	} else {
 		printf(" (%02d:%02d %s)", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'});
 	}
@@ -1920,10 +1922,10 @@ sub git_commit {
 	      "</tr>\n";
 	print "<tr><td>committer</td><td>" . esc_html($co{'committer'}) . "</td></tr>\n";
 	print "<tr><td></td><td> $cd{'rfc2822'}" . sprintf(" (%02d:%02d %s)", $cd{'hour_local'}, $cd{'minute_local'}, $cd{'tz_local'}) . "</td></tr>\n";
-	print "<tr><td>commit</td><td style=\"font-family:monospace\">$co{'id'}</td></tr>\n";
+	print "<tr><td>commit</td><td class=\"sha1\">$co{'id'}</td></tr>\n";
 	print "<tr>" .
 	      "<td>tree</td>" .
-	      "<td style=\"font-family:monospace\">" .
+	      "<td class=\"sha1\">" .
 	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash"), class => "list"}, $co{'tree'}) .
 	      "</td>" .
 	      "<td class=\"link\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") .
@@ -1933,7 +1935,7 @@ sub git_commit {
 	foreach my $par (@$parents) {
 		print "<tr>" .
 		      "<td>parent</td>" .
-		      "<td style=\"font-family:monospace\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$par"), class => "list"}, $par) . "</td>" .
+		      "<td class=\"sha1\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$par"), class => "list"}, $par) . "</td>" .
 		      "<td class=\"link\">" .
 		      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$par")}, "commit") .
 		      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash;hp=$par")}, "commitdiff") .
@@ -1958,7 +1960,7 @@ sub git_commit {
 		}
 		if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
 			$signed = 1;
-			print "<span style=\"color: #888888\">" . esc_html($line) . "</span><br/>\n";
+			print "<span class=\"signoff\">" . esc_html($line) . "</span><br/>\n";
 		} else {
 			$signed = 0;
 			print format_log_line_html($line) . "<br/>\n";
@@ -1970,7 +1972,7 @@ sub git_commit {
 		print(($#difftree + 1) . " files changed:\n");
 	}
 	print "</div>\n";
-	print "<table cellspacing=\"0\">\n";
+	print "<table class=\"diff_tree\">\n";
 	my $alternate = 0;
 	foreach my $line (@difftree) {
 		# ':100644 100644 03b218260e99b78c6df0ed378e59ed9205ccc96d 3b93d5e7cc7f7dd4ebed13a5cc1a4ad976fc94d8 M      ls-files.c'
@@ -1998,12 +2000,12 @@ sub git_commit {
 			}
 			print "<td>" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file"), -class => "list"}, esc_html($file)) . "</td>\n" .
-			      "<td><span style=\"color: #008000;\">[new " . file_type($to_mode) . "$mode_chng]</span></td>\n" .
+			      "<td><span class=\"file_status new\">[new " . file_type($to_mode) . "$mode_chng]</span></td>\n" .
 			      "<td class=\"link\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, "blob") . "</td>\n";
 		} elsif ($status eq "D") {
 			print "<td>" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file"), -class => "list"}, esc_html($file)) . "</td>\n" .
-			      "<td><span style=\"color: #c00000;\">[deleted " . file_type($from_mode). "]</span></td>\n" .
+			      "<td><span class=\"file_status deleted\">[deleted " . file_type($from_mode). "]</span></td>\n" .
 			      "<td class=\"link\">" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file")}, "blob") .
 			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$hash;f=$file")}, "history") .
@@ -2011,7 +2013,7 @@ sub git_commit {
 		} elsif ($status eq "M" || $status eq "T") {
 			my $mode_chnge = "";
 			if ($from_mode != $to_mode) {
-				$mode_chnge = " <span style=\"color: #777777;\">[changed";
+				$mode_chnge = " <span class=\"file_status mode_chnge\">[changed";
 				if (((oct $from_mode) & S_IFMT) != ((oct $to_mode) & S_IFMT)) {
 					$mode_chnge .= " from " . file_type($from_mode) . " to " . file_type($to_mode);
 				}
@@ -2047,7 +2049,7 @@ sub git_commit {
 			}
 			print "<td>" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file"), -class => "list"}, esc_html($to_file)) . "</td>\n" .
-			      "<td><span style=\"color: #777777;\">[moved from " .
+			      "<td><span class=\"file_status moved\">[moved from " .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$from_file"), -class => "list"}, esc_html($from_file)) .
 			      " with " . (int $similarity) . "% similarity$mode_chng]</span></td>\n" .
 			      "<td class=\"link\">" .
@@ -2407,7 +2409,7 @@ sub git_search {
 					my $match = esc_html($2) || "";
 					my $trail = esc_html($3) || "";
 					$trail = chop_str($trail, 30, 10);
-					my $text = "$lead<span style=\"color:#e00000\">$match</span>$trail";
+					my $text = "$lead<span class=\"match\">$match</span>$trail";
 					print chop_str($text, 80, 5) . "<br/>\n";
 				}
 			}
@@ -2456,7 +2458,7 @@ sub git_search {
 					while (my $setref = shift @files) {
 						my %set = %$setref;
 						print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$set{'id'};hb=$co{'id'};f=$set{'file'}"), class => "list"},
-						      "<span style=\"color:#e00000\">" . esc_html($set{'file'}) . "</span>") .
+						      "<span class=\"match\">" . esc_html($set{'file'}) . "</span>") .
 						      "<br/>\n";
 					}
 					print "</td>\n" .
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index da53eb4..98410f5 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -89,14 +89,18 @@ span.age {
 	position: relative;
 	float: left;
 	width: 142px;
-	font-style:italic;
+	font-style: italic;
+}
+
+div.page_body span.signoff {
+	color: #888888;
 }
 
 div.log_link {
 	padding: 0px 8px;
 	font-size: 10px;
 	font-family: sans-serif;
-	font-style:normal;
+	font-style: normal;
 	position: relative;
 	float: left;
 	width: 136px;
@@ -138,6 +142,14 @@ table {
 	padding: 8px 4px;
 }
 
+table.project_list, table.diff_tree {
+	border-spacing: 0;
+}
+
+table.blame {
+	border-collapse: collapse;
+}
+
 th {
 	padding: 2px 5px;
 	font-size: 12px;
@@ -156,11 +168,10 @@ tr.dark:hover {
 	background-color: #edece6;
 }
 
-
 td {
 	padding: 2px 5px;
 	font-size: 12px;
-	vertical-align:top;
+	vertical-align: top;
 }
 
 td.link {
@@ -169,10 +180,77 @@ td.link {
 	font-size: 10px;
 }
 
-div.pre {
+td.sha1 {
+	font-family: monospace;
+}
+
+td.error {
+	color: red;
+	background-color: yellow;
+}
+
+table.diff_tree span.file_status.new {
+	color: #008000;
+}
+
+table.diff_tree span.file_status.deleted {
+	color: #c00000;
+}
+
+table.diff_tree span.file_status.moved,
+table.diff_tree span.file_status.mode_chnge {
+	color: #777777;
+}
+
+/* age2: 60*60*24*2 <= age */
+table.project_list td.age2, table.blame td.age2 {
+	font-style: italic;
+}
+
+/* age1: 60*60*2 <= age < 60*60*24*2 */
+table.project_list td.age1 {
+	color: #009900;
+	font-style: italic;
+}
+
+table.blame td.age1 {
+	color: #009900;
+	background: transparent;
+}
+
+/* age0: age < 60*60*2 */
+table.project_list td.age0 {
+	color: #009900;
+	font-style: italic;
+	font-weight: bold;
+}
+
+table.blame td.age0 {
+	color: #009900;
+	background: transparent;
+	font-weight: bold;
+}
+
+td.pre, div.pre, div.diff {
 	font-family: monospace;
 	font-size: 12px;
 	white-space: pre;
+}
+
+td.mode {
+	font-family: monospace;
+}
+
+div.diff.add {
+	color: #008800;
+}
+
+div.diff.rem {
+	color: #cc0000;
+}
+
+div.diff.chunk_header {
+	color: #990099;
 }
 
 div.diff_info {
@@ -196,6 +273,10 @@ div.search {
 	right: 12px
 }
 
+td.linenr {
+	text-align: right;
+}
+
 a.linenr {
 	color: #999999;
 	text-decoration: none
@@ -229,3 +310,11 @@ span.tag {
 	border: 1px solid;
 	border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
 }
+
+span.atnight {
+	color: #cc0000;
+}
+
+span.match {
+	color: #e00000;
+}
-- 
1.3.0

^ permalink raw reply related

* [PATCH] Log peer address when git-daemon called from inetd
From: David Woodhouse @ 2006-06-20 14:38 UTC (permalink / raw)
  To: git; +Cc: jdl

When we run git-daemon from inetd, even with the --verbose option, it
doesn't log the peer address. That logic was only in the standalone
dæmon code -- move it to the execute() function instead. Tested with
both IPv6 and Legacy IP clients, in both inetd and dæmon mode.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Jon Loeliger <jdl@jdl.com>

diff --git a/daemon.c b/daemon.c
index 2f03f99..7d30302 100644
--- a/daemon.c
+++ b/daemon.c
@@ -264,11 +264,34 @@ static int upload(char *dir)
 	return -1;
 }
 
-static int execute(void)
+static int execute(struct sockaddr *addr)
 {
 	static char line[1000];
 	int pktlen, len;
 
+	if (addr) {
+		char addrbuf[256] = "";
+		int port = -1;
+
+		if (addr->sa_family == AF_INET) {
+			struct sockaddr_in *sin_addr = (void *) addr;
+			inet_ntop(addr->sa_family, &sin_addr->sin_addr, addrbuf, sizeof(addrbuf));
+			port = sin_addr->sin_port;
+#ifndef NO_IPV6
+		} else if (addr && addr->sa_family == AF_INET6) {
+			struct sockaddr_in6 *sin6_addr = (void *) addr;
+			
+			char *buf = addrbuf;
+			*buf++ = '['; *buf = '\0'; /* stpcpy() is cool */
+			inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(addrbuf) - 1);
+			strcat(buf, "]");
+
+			port = sin6_addr->sin6_port;
+#endif
+		}
+		loginfo("Connection from %s:%d", addrbuf, port);
+	}
+
 	alarm(init_timeout ? init_timeout : timeout);
 	pktlen = packet_read_line(0, line, sizeof(line));
 	alarm(0);
@@ -414,8 +437,6 @@ static void check_max_connections(void)
 static void handle(int incoming, struct sockaddr *addr, int addrlen)
 {
 	pid_t pid = fork();
-	char addrbuf[256] = "";
-	int port = -1;
 
 	if (pid) {
 		unsigned idx;
@@ -436,26 +457,7 @@ static void handle(int incoming, struct 
 	dup2(incoming, 1);
 	close(incoming);
 
-	if (addr->sa_family == AF_INET) {
-		struct sockaddr_in *sin_addr = (void *) addr;
-		inet_ntop(AF_INET, &sin_addr->sin_addr, addrbuf, sizeof(addrbuf));
-		port = sin_addr->sin_port;
-
-#ifndef NO_IPV6
-	} else if (addr->sa_family == AF_INET6) {
-		struct sockaddr_in6 *sin6_addr = (void *) addr;
-
-		char *buf = addrbuf;
-		*buf++ = '['; *buf = '\0'; /* stpcpy() is cool */
-		inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(addrbuf) - 1);
-		strcat(buf, "]");
-
-		port = sin6_addr->sin6_port;
-#endif
-	}
-	loginfo("Connection from %s:%d", addrbuf, port);
-
-	exit(execute());
+	exit(execute(addr));
 }
 
 static void child_handler(int signo)
@@ -751,8 +753,16 @@ int main(int argc, char **argv)
 	}
 
 	if (inetd_mode) {
+		struct sockaddr_storage ss;
+		struct sockaddr *peer = (struct sockaddr *)&ss;
+		socklen_t slen = sizeof(ss);
+
 		fclose(stderr); //FIXME: workaround
-		return execute();
+
+		if (getpeername(0, peer, &slen))
+			peer = NULL;
+
+		return execute(peer);
 	}
 
 	return serve(port);


-- 
dwmw2

^ permalink raw reply related

* Re: packs and trees
From: Jon Smirl @ 2006-06-20 14:35 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: git
In-Reply-To: <46a038f90606192313l16b16132r1523f5e05ae1566a@mail.gmail.com>

On 6/20/06, Martin Langhoff <martin.langhoff@gmail.com> wrote:
> On 6/20/06, Jon Smirl <jonsmirl@gmail.com> wrote:
> > The plan is to modify rcs2git from parsecvs to create all of the git
> > objects for the tree.
>
> Sounds like a good plan. Have you seen recent discussions about it
> being impossible to repack usefully when you don't have trees (and
> resulting performance problems on ext3).

No, I will look back in the archives.  If needed we can do a repack
after each file is added. I would hope that git can handle a repack
when the new stuff is 100% deltas from a single file.

If I can't pack the exploded deltas need about 35GB disk space. That
is an awful lot to feed to pack all at once, but it will have trees,

>
> > cvs2svn seems to do a good job at generating the trees.
>
> No doubt. Gut the last stage, and use all the data in the intermediate
> DBs to run a git import. It's a great plan, and if you can understand
> that Python code... all yours ;-)

How hard would it be to adjust cvsps to use cvs2svn's algorithm for
grouping the changesets? I'd rather do this in a C app but I haven't
figured out the guts of parsecvs or cvsps well enough to change the
algorithms. There is no requirement to use external databases, sorting
everything in RAM is fine.

If you are interested in changing the cvsps grouping algorithm I can
look at moding it to write out the revisions as are they are parsed.
Then you only need to save the git sha1 in memory instead of the
file:rev when sorting.

> > exactly sure how the changeset detection algorithms in the three apps
> > compare, but cvs2svn is not having any trouble building changesets for
> > Mozilla. The other two apps have some issues, cvsps throws away some
> > of the branches and parsecvs can't complete the analysis.
>
> Have you tried a recent parsecvs from Keith's tree? There's been quite
> a bit of activity there too. And Keith's interested in sorting out
> incremental imports too, which you need for a reasonable Moz
> transition plan as well.

Keith's parsecvs run ended up in a loop and mine hit a parsecvs error
and then had memory corruption after about eight hours. That was last
week,  I just checked the logs and I don't see any comments about
fixing it.

Even after spending eight hours building the changeset info iit is
still going to take it a couple of days to retrieve the versions one
at a time and write them to git. Reparsing 50MB delta files n^2/2
times is a major bottleneck for all three programs.

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: [PATCH] checkout -f: do not leave untracked working tree files.
From: Carl Worth @ 2006-06-20 14:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff Garzik, git, Ryan Anderson
In-Reply-To: <7vfyi0b1gv.fsf_-_@assigned-by-dhcp.cox.net>

[-- Attachment #1: Type: text/plain, Size: 1173 bytes --]

On Tue, 20 Jun 2006 02:50:08 -0700, Junio C Hamano wrote:
> 
> Earlier we did not consider untracked working tree files
> "precious", but we have always considered them fair game to
> clobber.  These days, branch switching by read-tree is more
> careful and tries to protect untracked working tree files.  This
> caused the following workflow to stop working:
> 
> 	git checkout one-branch-with-file-F
> 	git checkout -f another-without-file-F
> 	git pull . one-branch-with-file-F

Another one that a colleague of mine hit is:

	git checkout -b branch-without-file branch-with-file
	git rm some-file
	# Allow for some external changes on branch-with-file
	git pull . branch-with-file

One possibility for fixing this case is to make git-rm delete the file
by default, (that is, act as if the current -f option is
passed). There's no real safety concern unless the file is dirty,
(could require -f again for that case).

>                 If this works out for Jeff, I can simply drop
>    the "core.oktoclobber = ask" patch from my topics -- although
>    I kind of liked that one ;-).

Fixing the behavior instead of adding configuration is definitely a
good plan.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] gitweb: Use $hash_base as $search_hash if possible
From: Timo Hirvonen @ 2006-06-20 13:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v64iw80uo.fsf@assigned-by-dhcp.cox.net>

$hash (h parameter) does not always point to a commit. Use $hash_base as
$search_hash when it is defined.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---

  Junio C Hamano <junkio@cox.net> wrote:
  
  > Timo Hirvonen <tihirvon@gmail.com> writes:
  > 
  > > Starting search from whatever the current "h" parameter points to is
  > > wrong.  Sometimes it doesn't give all the expected results or may even
  > > fail if h points to an object which is not a commit.
  > 
  > If h is not a commit, perhaps, but wouldn't you expect it to
  > find things from "next" branch if "h" points at it?

  I did not change it to start search from tip of the branch. The
  current behavior is somewhat confusing but at least it is consistent
  with rest of gitweb.  For example clicking shortlog link from commit
  view shows the current commit at top of the list, not tip of the
  current branch.

 gitweb/gitweb.cgi |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 78e6dd0..7318512 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -293,7 +293,9 @@ EOF
 			$searchtext = "";
 		}
 		my $search_hash;
-		if (defined $hash) {
+		if (defined $hash_base) {
+			$search_hash = $hash_base;
+		} elsif (defined $hash) {
 			$search_hash = $hash;
 		} else {
 			$search_hash  = "HEAD";
-- 
1.4.0.gd281

^ permalink raw reply related

* Re: [PATCH] Restore SIGCHLD to SIG_DFL where we care about waitpid().
From: Petr Baudis @ 2006-06-20 12:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Linus Torvalds, git
In-Reply-To: <7vslm04j2r.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Tue, Jun 20, 2006 at 05:11:40AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> diff --git a/connect.c b/connect.c
> index 52d709e..db7342e 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -581,6 +581,11 @@ int git_connect(int fd[2], char *url, co
>  	enum protocol protocol = PROTO_LOCAL;
>  	int free_path = 0;
>  
> +	/* Without this we cannot rely on waitpid() to tell
> +	 * what happened to our children.
> +	 */
> +	signal(SIGCHLD, SIG_DFL);
> +
>  	host = strstr(url, "://");
>  	if(host) {
>  		*host = '\0';

It would be nice if at this point of Git development we could already
think about libification when doing things like this (I'd like to do
Git.pm as my little summer project this year). I'd make it part of the
API that the calling application must not defer SIGCHLD, and conversely
put the handler to all the main()s that reach git_connect().

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.

^ permalink raw reply

* Re: [PATCH] gitweb: Start search from HEAD
From: Junio C Hamano @ 2006-06-20 12:31 UTC (permalink / raw)
  To: Timo Hirvonen; +Cc: git
In-Reply-To: <20060620152515.23e59396.tihirvon@gmail.com>

Timo Hirvonen <tihirvon@gmail.com> writes:

> Starting search from whatever the current "h" parameter points to is
> wrong.  Sometimes it doesn't give all the expected results or may even
> fail if h points to an object which is not a commit.

If h is not a commit, perhaps, but wouldn't you expect it to
find things from "next" branch if "h" points at it?

^ permalink raw reply

* Re: wrong check condition in patch-delta.c?
From: Nicolas Pitre @ 2006-06-20 12:28 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git
In-Reply-To: <fcaeb9bf0606192332j5b2ee4b9ycf2c63c7b1820204@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 418 bytes --]

On Tue, 20 Jun 2006, Nguyn Thái Ngc Duy wrote:

> Hi,
> While inspecting patch-delta.c, I encounter this:
>                       if (cp_off + cp_size < cp_size ||
>                           cp_off + cp_size > src_size ||
>                           cp_size > size)
>                               goto bad;
> "cp_off + cp_size < cp_size" doesn't make sense to me. Is it on purpose?

Yes, it absolutely is.


Nicolas

^ permalink raw reply

* [PATCH] gitweb: Start search from HEAD
From: Timo Hirvonen @ 2006-06-20 12:25 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Starting search from whatever the current "h" parameter points to is
wrong.  Sometimes it doesn't give all the expected results or may even
fail if h points to an object which is not a commit.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---

 This patch is against the "next" branch.

 gitweb/gitweb.cgi |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 78e6dd0..3ad23a3 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -292,14 +292,7 @@ EOF
 		if (!defined $searchtext) {
 			$searchtext = "";
 		}
-		my $search_hash;
-		if (defined $hash) {
-			$search_hash = $hash;
-		} else {
-			$search_hash  = "HEAD";
-		}
 		$cgi->param("a", "search");
-		$cgi->param("h", $search_hash);
 		print $cgi->startform(-method => "get", -action => $my_uri) .
 		      "<div class=\"search\">\n" .
 		      $cgi->hidden(-name => "p") . "\n" .
@@ -2328,9 +2321,7 @@ sub git_search {
 	if (!defined $searchtext) {
 		die_error("", "Text field empty.");
 	}
-	if (!defined $hash) {
-		$hash = git_read_head($project);
-	}
+	$hash = "HEAD";
 	my %co = git_read_commit($hash);
 	if (!%co) {
 		die_error(undef, "Unknown commit object.");
-- 
1.4.0.gd281

^ permalink raw reply related

* upload-pack is unsafe in corrupt repository
From: Junio C Hamano @ 2006-06-20 12:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

I was helping Andrew fetching from maintainer trees.  One of the
trees were corrupt (i.e. git-fsck-objects unclean) and there was
a rather grave consequences we found out the hard way (and it is
5am but Tuesday is not my git day X-<).

upload-pack forks a pipeline, whose upstream execs rev-list and
downstream execs pack-objects.  rev-list correctly notices that
it cannot reach some objects and dies, but pack-objects just
says "Ah, the list of object input just ended -- let's send them
all".  This results in git-fetch-pack to be fed an incomplete
pack.  However, git-unpack-objects is happy (the pack is not
corrupt, just that it does not contain what the protocol
exchange expected to send) and git-fetch-pack ends up going all
the way through updating the ref.

Eek.

At this moment, I am just reporting this because I am too tired
to code it myself right now, but I think the fix is to make
upload-pack to fork once more, waitpid() for rev-list and
inject/append garbage in the stream pack-objects produces, in
order to cause unpack-objects (or index-pack) that runs on the
the fetching end to notice, when rev-list or pack-objects barf.

Of course a nicer fix is to add the sideband we have been
discussing about, but that relies on protocol extension and
would not solve the problem for older clients.

Side note: in my head, the sideband would work by the "forked
once more" upload-pack process to listen to both stdout and
stderr of pack-objects, and feed them packetized (instead of the
current "go-straight-stream") by perhaps prefixing them with one
byte (is this a payload, or is this a progress-bar/keepalive type
packet).  Of course, this would change the way the payload is
transferred, so the initial handshake needs to negotiate if the
sideband should be used just like we do other new features like
thin pack transfers.

^ permalink raw reply

* Re: [PATCH] checkout -f: do not leave untracked working tree files.
From: Alexander Litvinov @ 2006-06-20 12:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vveqw82qd.fsf@assigned-by-dhcp.cox.net>

> "will" meaning "you suspect" or "you tried and confirmed"?
:-) I suspect.

Lets test. Your pu branch (5af05efbeaa06005596129fb111a739a87f8a883) really 
works. I have cvs repo and use git for daily work. I have head and 2 branches 
from cvs and store CVS/* files in git too. Usualy this operation pruduce a 
lot of CVS/Tag files:

git checkout -f cvs-v52 (this is one of by cvs's branch)
cvs -q up -dP (nothing have been updated)
git checkout -f master (this is a dev branch from cvs head)
git status

pu branch nuke them when use git checkout -f !

^ permalink raw reply

* Re: [PATCH] checkout -f: do not leave untracked working tree files.
From: Junio C Hamano @ 2006-06-20 11:51 UTC (permalink / raw)
  To: Alexander Litvinov; +Cc: Santi Béjar, git
In-Reply-To: <200606201827.50808.lan@academsoft.ru>

Alexander Litvinov <lan@academsoft.ru> writes:

> Good news. I have a habbit to switch branches using two commands:
>
> git checkout -f second-branch
> git clean -d -q
>
> Now this will work with single command. Thanks.

"will" meaning "you suspect" or "you tried and confirmed"?

^ permalink raw reply

* Re: [PATCH] checkout -f: do not leave untracked working tree files.
From: Alexander Litvinov @ 2006-06-20 11:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Santi Béjar, git
In-Reply-To: <7vfyi09isf.fsf@assigned-by-dhcp.cox.net>

Good news. I have a habbit to switch branches using two commands:

git checkout -f second-branch
git clean -d -q

Now this will work with single command. Thanks.

^ permalink raw reply

* Re: [PATCH] checkout -f: do not leave untracked working tree files.
From: Junio C Hamano @ 2006-06-20 11:18 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git
In-Reply-To: <8764iw5bvl.fsf@gmail.com>

Santi Béjar <sbejar@gmail.com> writes:

> Another thing to take into account is that, for this particular
> case/sequence, the untracked file-F is exactly the same as the one from
> the pull, so you are not overwritting that file and it could succeed.

Yes and no.  The untracked file is not even known to git when
pull is happening (that is the definition of "untracked").  Yes,
we could see if the contents happen to match and choose to
overwrite, but I think it is often more likely that the contents
do not match that it is not worth it (I have not examined what
it would involve to add that check yet, so it might turn out to
be a cheap check but I doubt it).

^ permalink raw reply

* Re: [PATCH] checkout -f: do not leave untracked working tree files.
From: Santi Béjar @ 2006-06-20 11:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff Garzik, git, Ryan Anderson
In-Reply-To: <7vfyi0b1gv.fsf_-_@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> writes:

> Earlier we did not consider untracked working tree files
> "precious", but we have always considered them fair game to
> clobber.  These days, branch switching by read-tree is more
> careful and tries to protect untracked working tree files.  This
> caused the following workflow to stop working:
>
> 	git checkout one-branch-with-file-F
> 	git checkout -f another-without-file-F
> 	git pull . one-branch-with-file-F
>
> Because the second checkout leaves F from the previous state as
> untracked file in the working tree, the merge would fail, trying
> to protect F from being clobbered.
>
> This changes "git checkout -f" to remove working tree files that
> are known to git in the switched-from state but do not exist in
> the switched-to state, borrowing the same logic from "reset --hard".
>

I agree with this patch (without testing).

Another thing to take into account is that, for this particular
case/sequence, the untracked file-F is exactly the same as the one from
the pull, so you are not overwritting that file and it could succeed.

    Santi

^ permalink raw reply

* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
From: Timo Hirvonen @ 2006-06-20 10:57 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <e78gun$65s$1@sea.gmane.org>

Jakub Narebski <jnareb@gmail.com> wrote:

> Timo Hirvonen wrote:
> 
> > http://onion.dynserv.net/git/gitweb.cgi
> > 
> > Global symbol "$path" requires explicit package name at
> > /var/www/localhost/htdocs/git/gitweb.cgi line 1521.
> > Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to
> > compilation errors.
> > 
> > The line is:
> > 
> > $file =~ m#^/# or $file = "$projectroot/$path/$file";
> > 
> > $path seems to be undefined.  I don't understand perl very well so I
> > can't fix it.
> 
> Temporary fix is in:
>  
>   "[PATCH] Fix: Support for the standard mime.types map in gitweb"
>   (Message-Id: <11507843541678-git-send-email-jnareb@gmail.com>)
>     http://permalink.gmane.org/gmane.comp.version-control.git/22172

Seems to work now.  I also enabled blame and it works too. But I noticed
that the search is sometimes broken.  If you click a "blob" link and
then try to search something gitweb will complain:

    403 Forbidden - Unknown commit object. 

"h" parameter is blob, not commit. Shouldn't the h parameter be set to
HEAD always when searching?  Searching starts at h so the search results
vary:

http://onion.dynserv.net/git/gitweb.cgi?p=cmus.git&a=search&h=HEAD&s=pickaxe%3Atheme

http://onion.dynserv.net/git/gitweb.cgi?p=cmus.git&a=search&h=fd2d983d51858e25cc71b14b59c787e1683ba7c5&s=pickaxe%3Atheme

-- 
http://onion.dynserv.net/~timo/

^ permalink raw reply

* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
From: Jakub Narebski @ 2006-06-20  9:59 UTC (permalink / raw)
  To: git
In-Reply-To: <20060620124606.4e3e226c.tihirvon@gmail.com>

Timo Hirvonen wrote:

> http://onion.dynserv.net/git/gitweb.cgi
> 
> Global symbol "$path" requires explicit package name at
> /var/www/localhost/htdocs/git/gitweb.cgi line 1521.
> Execution of /var/www/localhost/htdocs/git/gitweb.cgi aborted due to
> compilation errors.
> 
> The line is:
> 
> $file =~ m#^/# or $file = "$projectroot/$path/$file";
> 
> $path seems to be undefined.  I don't understand perl very well so I
> can't fix it.

Temporary fix is in:
 
  "[PATCH] Fix: Support for the standard mime.types map in gitweb"
  (Message-Id: <11507843541678-git-send-email-jnareb@gmail.com>)
    http://permalink.gmane.org/gmane.comp.version-control.git/22172

BTW. I have _my_ version at 
  http://front.fuw.edu.pl/cgi-bin/jnareb/gitweb.cgi

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* [PATCH] checkout -f: do not leave untracked working tree files.
From: Junio C Hamano @ 2006-06-20  9:50 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: git, Ryan Anderson
In-Reply-To: <7vr71kb257.fsf@assigned-by-dhcp.cox.net>

Earlier we did not consider untracked working tree files
"precious", but we have always considered them fair game to
clobber.  These days, branch switching by read-tree is more
careful and tries to protect untracked working tree files.  This
caused the following workflow to stop working:

	git checkout one-branch-with-file-F
	git checkout -f another-without-file-F
	git pull . one-branch-with-file-F

Because the second checkout leaves F from the previous state as
untracked file in the working tree, the merge would fail, trying
to protect F from being clobbered.

This changes "git checkout -f" to remove working tree files that
are known to git in the switched-from state but do not exist in
the switched-to state, borrowing the same logic from "reset --hard".

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 * I am going to bed without trying this out since it is very
   late tonight.  Might be in "pu" or "next" tomorrow depending
   on my mood.  If this works out for Jeff, I can simply drop
   the "core.oktoclobber = ask" patch from my topics -- although
   I kind of liked that one ;-).

 git-checkout.sh |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/git-checkout.sh b/git-checkout.sh
index 564117f..77c2593 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -137,8 +137,7 @@ # what we already had
 
 if [ "$force" ]
 then
-    git-read-tree --reset $new &&
-	git-checkout-index -q -f -u -a
+    git-read-tree --reset -u $new
 else
     git-update-index --refresh >/dev/null
     merge_error=$(git-read-tree -m -u $old $new 2>&1) || (
-- 
1.4.0.g59268

^ permalink raw reply related

* Re: [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
From: Jakub Narebski @ 2006-06-20  9:48 UTC (permalink / raw)
  To: git
In-Reply-To: <7vd5d4chmg.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:

> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> Doesn't work well with values outside us-ascii, but that might be
>> considered web browser bug (misfeature), not a bug in gitweb.
> 
> That's sad.
> 
> Are you sure about it?

Now I see I was wrong.

> What does start_td({-title=>"blah"}) produce? <td title="blah">?
> If so, is http://members.cox.net/junkio/t.html close to what you
> are trying to achieve here?

Yes, that is what I tried to achieve. Using CGI to set attributes
was to quote characters which cannot be in double quited attribute values,
i.e. change '"' to '&#34;' or '&quot;'. I don't know what start_td did with
\"o character (Perl v5.8.6, CGI::VERSION=3.05).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox