Git development
 help / color / mirror / Atom feed
* Re: [PATCH] Fix crash when GIT_DIR is invalid
From: Johannes Schindelin @ 2006-08-04 22:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7virl8jpnw.fsf@assigned-by-dhcp.cox.net>

Hi,

On Fri, 4 Aug 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> >  	bad_dir_environ:
> > -		if (!nongit_ok) {
> > +		if (nongit_ok) {
> >  			*nongit_ok = 1;
> 
> *BLUSH*  How could I have missed something like this...

It's too easy. I actually reviewed that patch, saw that I did the same 
(not!), and hit the bug...

Ciao,
Dscho "errare humanum est" --

^ permalink raw reply

* [PATCH 0/5] Some further gitweb patches
From: Jakub Narebski @ 2006-08-04 22:36 UTC (permalink / raw)
  To: git

Based on 'next' branch, v1.4.2-rc3-g1c4b267

This is also kind of cleanup series of patches, although it introduces 
minor improvements (patches 1 and 5).

This series does not include latest Luben Tuikov series...
-- 
Jakub Narebski
Poland

^ permalink raw reply

* [PATCH 4/4] gitweb: No periods for error messages
From: Luben Tuikov @ 2006-08-04 22:16 UTC (permalink / raw)
  To: git

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

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   88 ++++++++++++++++++++++++++--------------------------
 1 files changed, 44 insertions(+), 44 deletions(-)

[-- Attachment #2: 2013183029-p4.patch --]
[-- Type: application/octet-stream, Size: 11771 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 723823a..3731f4e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -76,7 +76,7 @@ our $action = $cgi->param('a');
 if (defined $action) {
 	if ($action =~ m/[^0-9a-zA-Z\.\-_]/) {
 		undef $action;
-		die_error(undef, "Invalid action parameter.");
+		die_error(undef, "Invalid action parameter");
 	}
 	if ($action eq "opml") {
 		git_opml();
@@ -89,15 +89,15 @@ if (defined $project) {
 	$project =~ s|^/||; $project =~ s|/$||;
 	$project = validate_input($project);
 	if (!defined($project)) {
-		die_error(undef, "Invalid project parameter.");
+		die_error(undef, "Invalid project parameter");
 	}
 	if (!(-d "$projectroot/$project")) {
 		undef $project;
-		die_error(undef, "No such directory.");
+		die_error(undef, "No such directory");
 	}
 	if (!(-e "$projectroot/$project/HEAD")) {
 		undef $project;
-		die_error(undef, "No such project.");
+		die_error(undef, "No such project");
 	}
 	$rss_link = "<link rel=\"alternate\" title=\"" . esc_param($project) . " log\" href=\"" .
 	            "$my_uri?" . esc_param("p=$project;a=rss") . "\" type=\"application/rss+xml\"/>";
@@ -111,7 +111,7 @@ our $file_name = $cgi->param('f');
 if (defined $file_name) {
 	$file_name = validate_input($file_name);
 	if (!defined($file_name)) {
-		die_error(undef, "Invalid file parameter.");
+		die_error(undef, "Invalid file parameter");
 	}
 }
 
@@ -119,7 +119,7 @@ our $hash = $cgi->param('h');
 if (defined $hash) {
 	$hash = validate_input($hash);
 	if (!defined($hash)) {
-		die_error(undef, "Invalid hash parameter.");
+		die_error(undef, "Invalid hash parameter");
 	}
 }
 
@@ -127,7 +127,7 @@ our $hash_parent = $cgi->param('hp');
 if (defined $hash_parent) {
 	$hash_parent = validate_input($hash_parent);
 	if (!defined($hash_parent)) {
-		die_error(undef, "Invalid hash parent parameter.");
+		die_error(undef, "Invalid hash parent parameter");
 	}
 }
 
@@ -135,7 +135,7 @@ our $hash_base = $cgi->param('hb');
 if (defined $hash_base) {
 	$hash_base = validate_input($hash_base);
 	if (!defined($hash_base)) {
-		die_error(undef, "Invalid hash base parameter.");
+		die_error(undef, "Invalid hash base parameter");
 	}
 }
 
@@ -143,7 +143,7 @@ our $page = $cgi->param('pg');
 if (defined $page) {
 	if ($page =~ m/[^0-9]$/) {
 		undef $page;
-		die_error(undef, "Invalid page parameter.");
+		die_error(undef, "Invalid page parameter");
 	}
 }
 
@@ -151,7 +151,7 @@ our $searchtext = $cgi->param('s');
 if (defined $searchtext) {
 	if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
 		undef $searchtext;
-		die_error(undef, "Invalid search parameter.");
+		die_error(undef, "Invalid search parameter");
 	}
 	$searchtext = quotemeta $searchtext;
 }
@@ -181,7 +181,7 @@ my %actions = (
 $action = 'summary' if (!defined($action));
 if (!defined($actions{$action})) {
 	undef $action;
-	die_error(undef, "Unknown action.");
+	die_error(undef, "Unknown action");
 }
 $actions{$action}->();
 exit;
@@ -427,7 +427,7 @@ sub git_get_hash_by_path {
 	my $tree = $base;
 
 	open my $fd, "-|", $GIT, "ls-tree", $base, "--", $path
-		or die_error(undef, "Open git-ls-tree failed.");
+		or die_error(undef, "Open git-ls-tree failed");
 	my $line = <$fd>;
 	close $fd or return undef;
 
@@ -1274,13 +1274,13 @@ ## actions
 sub git_project_list {
 	my $order = $cgi->param('o');
 	if (defined $order && $order !~ m/project|descr|owner|age/) {
-		die_error(undef, "Invalid order parameter '$order'.");
+		die_error(undef, "Invalid order parameter '$order'");
 	}
 
 	my @list = git_read_projects();
 	my @projects;
 	if (!@list) {
-		die_error(undef, "No projects found.");
+		die_error(undef, "No projects found");
 	}
 	foreach my $pr (@list) {
 		my $head = git_read_head($pr->{'path'});
@@ -1414,7 +1414,7 @@ sub git_summary {
 	      "</table>\n";
 
 	open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_read_head($project)
-		or die_error(undef, "Open git-rev-list failed.");
+		or die_error(undef, "Open git-rev-list failed");
 	my @revlist = map { chomp; $_ } <$fd>;
 	close $fd;
 	git_header_div('shortlog');
@@ -1470,7 +1470,7 @@ sub git_tag {
 sub git_blame2 {
 	my $fd;
 	my $ftype;
-	die_error(undef, "Permission denied.") if (!git_get_project_config_bool ('blame'));
+	die_error(undef, "Permission denied") if (!git_get_project_config_bool ('blame'));
 	die_error('404 Not Found', "File name not defined") if (!$file_name);
 	$hash_base ||= git_read_head($project);
 	die_error(undef, "Reading commit failed") unless ($hash_base);
@@ -1485,7 +1485,7 @@ sub git_blame2 {
 		die_error("400 Bad Request", "object is not a blob");
 	}
 	open ($fd, "-|", $GIT, "blame", '-l', $file_name, $hash_base)
-		or die_error(undef, "Open git-blame failed.");
+		or die_error(undef, "Open git-blame failed");
 	git_header_html();
 	my $formats_nav =
 		$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") .
@@ -1528,18 +1528,18 @@ sub git_blame2 {
 
 sub git_blame {
 	my $fd;
-	die_error('403 Permission denied', "Permission denied.") if (!git_get_project_config_bool ('blame'));
+	die_error('403 Permission denied', "Permission denied") if (!git_get_project_config_bool ('blame'));
 	die_error('404 Not Found', "What file will it be, master?") if (!$file_name);
 	$hash_base ||= git_read_head($project);
-	die_error(undef, "Reading commit failed.") unless ($hash_base);
+	die_error(undef, "Reading commit failed") unless ($hash_base);
 	my %co = git_read_commit($hash_base)
-		or die_error(undef, "Reading commit failed.");
+		or die_error(undef, "Reading commit failed");
 	if (!defined $hash) {
 		$hash = git_get_hash_by_path($hash_base, $file_name, "blob")
-			or die_error(undef, "Error lookup file.");
+			or die_error(undef, "Error lookup file");
 	}
 	open ($fd, "-|", $GIT, "annotate", '-l', '-t', '-r', $file_name, $hash_base)
-		or die_error(undef, "Open git-annotate failed.");
+		or die_error(undef, "Open git-annotate failed");
 	git_header_html();
 	my $formats_nav =
 		$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") .
@@ -1649,9 +1649,9 @@ sub git_blob_plain {
 		if (defined $file_name) {
 			my $base = $hash_base || git_read_head($project);
 			$hash = git_get_hash_by_path($base, $file_name, "blob")
-				or die_error(undef, "Error lookup file.");
+				or die_error(undef, "Error lookup file");
 		} else {
-			die_error(undef, "No file name defined.");
+			die_error(undef, "No file name defined");
 		}
 	}
 	my $type = shift;
@@ -1682,14 +1682,14 @@ sub git_blob {
 		if (defined $file_name) {
 			my $base = $hash_base || git_read_head($project);
 			$hash = git_get_hash_by_path($base, $file_name, "blob")
-				or die_error(undef, "Error lookup file.");
+				or die_error(undef, "Error lookup file");
 		} else {
-			die_error(undef, "No file name defined.");
+			die_error(undef, "No file name defined");
 		}
 	}
 	my $have_blame = git_get_project_config_bool ('blame');
 	open my $fd, "-|", $GIT, "cat-file", "blob", $hash
-		or die_error(undef, "Couldn't cat $file_name, $hash.");
+		or die_error(undef, "Couldn't cat $file_name, $hash");
 	my $mimetype = git_blob_plain_mimetype($fd, $file_name);
 	if ($mimetype !~ m/^text\//) {
 		close $fd;
@@ -1747,9 +1747,9 @@ sub git_tree {
 	}
 	$/ = "\0";
 	open my $fd, "-|", $GIT, "ls-tree", '-z', $hash
-		or die_error(undef, "Open git-ls-tree failed.");
+		or die_error(undef, "Open git-ls-tree failed");
 	my @entries = map { chomp; $_ } <$fd>;
-	close $fd or die_error(undef, "Reading tree failed.");
+	close $fd or die_error(undef, "Reading tree failed");
 	$/ = "\n";
 
 	my $refs = read_info_ref();
@@ -1828,7 +1828,7 @@ sub git_log {
 
 	my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
 	open my $fd, "-|", $GIT, "rev-list", $limit, $hash
-		or die_error(undef, "Open git-rev-list failed.");
+		or die_error(undef, "Open git-rev-list failed");
 	my @revlist = map { chomp; $_ } <$fd>;
 	close $fd;
 
@@ -1889,7 +1889,7 @@ sub git_log {
 sub git_commit {
 	my %co = git_read_commit($hash);
 	if (!%co) {
-		die_error(undef, "Unknown commit object.");
+		die_error(undef, "Unknown commit object");
 	}
 	my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});
 	my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});
@@ -1899,9 +1899,9 @@ sub git_commit {
 		$parent = "--root";
 	}
 	open my $fd, "-|", $GIT, "diff-tree", '-r', '-M', $parent, $hash
-		or die_error(undef, "Open git-diff-tree failed.");
+		or die_error(undef, "Open git-diff-tree failed");
 	my @difftree = map { chomp; $_ } <$fd>;
-	close $fd or die_error(undef, "Reading git-diff-tree failed.");
+	close $fd or die_error(undef, "Reading git-diff-tree failed");
 
 	# non-textual hash id's can be cached
 	my $expires;
@@ -2117,15 +2117,15 @@ sub git_commitdiff {
 	mkdir($git_temp, 0700);
 	my %co = git_read_commit($hash);
 	if (!%co) {
-		die_error(undef, "Unknown commit object.");
+		die_error(undef, "Unknown commit object");
 	}
 	if (!defined $hash_parent) {
 		$hash_parent = $co{'parent'};
 	}
 	open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
-		or die_error(undef, "Open git-diff-tree failed.");
+		or die_error(undef, "Open git-diff-tree failed");
 	my @difftree = map { chomp; $_ } <$fd>;
-	close $fd or die_error(undef, "Reading diff-tree failed.");
+	close $fd or die_error(undef, "Reading diff-tree failed");
 
 	# non-textual hash id's can be cached
 	my $expires;
@@ -2205,9 +2205,9 @@ sub git_commitdiff {
 sub git_commitdiff_plain {
 	mkdir($git_temp, 0700);
 	open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
-		or die_error(undef, "Open git-diff-tree failed.");
+		or die_error(undef, "Open git-diff-tree failed");
 	my @difftree = map { chomp; $_ } <$fd>;
-	close $fd or die_error(undef, "Reading diff-tree failed.");
+	close $fd or die_error(undef, "Reading diff-tree failed");
 
 	# try to figure out the next tag after this commit
 	my $tagname;
@@ -2265,7 +2265,7 @@ sub git_history {
 	my $ftype;
 	my %co = git_read_commit($hash_base);
 	if (!%co) {
-		die_error(undef, "Unknown commit object.");
+		die_error(undef, "Unknown commit object");
 	}
 	my $refs = read_info_ref();
 	git_header_html();
@@ -2323,14 +2323,14 @@ sub git_history {
 
 sub git_search {
 	if (!defined $searchtext) {
-		die_error("", "Text field empty.");
+		die_error("", "Text field empty");
 	}
 	if (!defined $hash) {
 		$hash = git_read_head($project);
 	}
 	my %co = git_read_commit($hash);
 	if (!%co) {
-		die_error(undef, "Unknown commit object.");
+		die_error(undef, "Unknown commit object");
 	}
 	# pickaxe may take all resources of your box and run for several minutes
 	# with every query - so decide by yourself how public you make this feature :)
@@ -2468,7 +2468,7 @@ sub git_shortlog {
 
 	my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
 	open my $fd, "-|", $GIT, "rev-list", $limit, $hash
-		or die_error(undef, "Open git-rev-list failed.");
+		or die_error(undef, "Open git-rev-list failed");
 	my @revlist = map { chomp; $_ } <$fd>;
 	close $fd;
 
@@ -2496,9 +2496,9 @@ ## feeds (RSS, OPML)
 sub git_rss {
 	# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
 	open my $fd, "-|", $GIT, "rev-list", "--max-count=150", git_read_head($project)
-		or die_error(undef, "Open git-rev-list failed.");
+		or die_error(undef, "Open git-rev-list failed");
 	my @revlist = map { chomp; $_ } <$fd>;
-	close $fd or die_error(undef, "Reading rev-list failed.");
+	close $fd or die_error(undef, "Reading rev-list failed");
 	print $cgi->header(-type => 'text/xml', -charset => 'utf-8');
 	print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
 	      "<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">\n";
-- 
1.4.2.rc3.g6df3


^ permalink raw reply related

* [PATCH 3/4] gitweb: git_tree displays blame based on repository config
From: Luben Tuikov @ 2006-08-04 22:14 UTC (permalink / raw)
  To: git

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

git_tree() will now conditionally display "blame"
depending on how "gitweb.blame" variable is configured
using "git-repo-config".

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

[-- Attachment #2: 963471848-p3.patch --]
[-- Type: application/octet-stream, Size: 1663 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 69b787f..723823a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1757,6 +1757,7 @@ sub git_tree {
 	git_header_html();
 	my $base_key = "";
 	my $base = "";
+	my $have_blame = git_get_project_config_bool ('blame');
 	if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
 		$base_key = ";hb=$hash_base";
 		git_page_nav('tree','', $hash_base);
@@ -1792,9 +1793,11 @@ sub git_tree {
 			      $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)) .
 			      "</td>\n" .
 			      "<td class=\"link\">" .
-			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob") .
-#			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame") .
-			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$t_hash;hb=$hash_base;f=$base$t_name")}, "history") .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$t_hash$base_key;f=$base$t_name")}, "blob");
+			if ($have_blame) {
+				print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$t_hash$base_key;f=$base$t_name")}, "blame");
+			}
+			print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$t_hash;hb=$hash_base;f=$base$t_name")}, "history") .
 			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$t_hash;f=$base$t_name")}, "raw") .
 			      "</td>\n";
 		} elsif ($t_type eq "tree") {
-- 
1.4.2.rc3.g6df3


^ permalink raw reply related

* [PATCH 2/4] gitweb: bugfix: git_commit and git_commitdiff parents
From: Luben Tuikov @ 2006-08-04 22:11 UTC (permalink / raw)
  To: git

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

In git_commit() the hash base of $from_id is $parent, not
$hash:
 - If status is "D", then action blob for $from_id wants
   $parent, not $hash.  History needs $parent too.
 - If status is "R", then action blob for $from_id wants
   $parent, not $hash.

In git_commitdiff() the hash base of $from_id is
$hash_parent, not $hash:
 - If status is "D".
 - If status is "M".

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.perl |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

[-- Attachment #2: 3952834181-p2.patch --]
[-- Type: application/octet-stream, Size: 3549 bytes --]

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 049f27e..69b787f 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2018,11 +2018,11 @@ sub git_commit {
 			      "<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" .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$file"), -class => "list"}, esc_html($file)) . "</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;hb=$hash;f=$file")}, "history") .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$file")}, "blob") .
+			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$parent;f=$file")}, "history") .
 			      "</td>\n"
 		} elsif ($status eq "M" || $status eq "T") {
 			my $mode_chnge = "";
@@ -2064,7 +2064,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 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)) .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$from_file"), -class => "list"}, esc_html($from_file)) .
 			      " with " . (int $similarity) . "% similarity$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=$to_file")}, "blob");
@@ -2178,15 +2178,17 @@ sub git_commitdiff {
 			git_diff_print(undef, "/dev/null", $to_id, "b/$file");
 		} elsif ($status eq "D") {
 			print "<div class=\"diff_info\">" . file_type($from_mode) . ":" .
-			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file")}, $from_id) . "(deleted)" .
+			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash_parent;f=$file")}, $from_id) . "(deleted)" .
 			      "</div>\n";
 			git_diff_print($from_id, "a/$file", undef, "/dev/null");
 		} elsif ($status eq "M") {
 			if ($from_id ne $to_id) {
 				print "<div class=\"diff_info\">" .
-				      file_type($from_mode) . ":" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash;f=$file")}, $from_id) .
+				      file_type($from_mode) . ":" .
+				      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$hash_parent;f=$file")}, $from_id) .
 				      " -> " .
-				      file_type($to_mode) . ":" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, $to_id);
+				      file_type($to_mode) . ":" .
+				      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, $to_id);
 				print "</div>\n";
 				git_diff_print($from_id, "a/$file",  $to_id, "b/$file");
 			}
-- 
1.4.2.rc3.g6df3


^ permalink raw reply related

* [PATCH 1/4] gitweb: blame table row no highlight fix
From: Luben Tuikov @ 2006-08-04 22:09 UTC (permalink / raw)
  To: git

Until now blame just used the commit/tree/tags/etc style of
highlight-able table rows, which have strictly alternating
light/dark rows. This is very annoying in blame, since the
text is static and it interferes with the per-revision block
highlight.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.css  |    4 ++++
 gitweb/gitweb.perl |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 460e728..47c1ade 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -171,6 +171,10 @@ tr.dark {
 	background-color: #f6f6f0;
 }
 
+tr.dark2 {
+	background-color: #f6f6f0;
+}
+
 tr.dark:hover {
 	background-color: #edece6;
 }
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 58eb5b1..049f27e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1493,7 +1493,7 @@ sub git_blame2 {
 	git_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
 	git_header_div('commit', esc_html($co{'title'}), $hash_base);
 	git_print_page_path($file_name, $ftype);
-	my @rev_color = (qw(light dark));
+	my @rev_color = (qw(light2 dark2));
 	my $num_colors = scalar(@rev_color);
 	my $current_color = 0;
 	my $last_rev;
-- 
1.4.2.rc3.g6df3

^ permalink raw reply related

* [PATCH] GIT-VERSION-GEN: Use git project-version.
From: Santi Béjar @ 2006-08-04 22:01 UTC (permalink / raw)
  To: Git Mailing List


---
Hi *,

There are two little behaviour changes:

1.- the -dirty suffix is converted to .dirty
2.- the version from the file version does not get the -dirty suffix.

 GIT-VERSION-GEN |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 1ce217d..99e35e1 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -3,9 +3,9 @@ #!/bin/sh
 GVF=GIT-VERSION-FILE
 DEF_VER=v1.4.2.GIT
 
-# First try git-describe, then see if there is a version file
+# First try git-project-version, then see if there is a version file
 # (included in release tarballs), then default
-if VN=$(git describe --abbrev=4 HEAD 2>/dev/null); then
+if VN=$(git project-version); then
 	VN=$(echo "$VN" | sed -e 's/-/./g');
 elif test -f version
 then
@@ -16,14 +16,6 @@ fi
 
 VN=$(expr "$VN" : v*'\(.*\)')
 
-dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
-case "$dirty" in
-'')
-	;;
-*)
-	VN="$VN-dirty" ;;
-esac
-
 if test -r $GVF
 then
 	VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
-- 
1.4.2.rc3.g3f0a-dirty

^ permalink raw reply related

* [PATCH] git-project-version
From: Santi Béjar @ 2006-08-04 21:48 UTC (permalink / raw)
  To: Git Mailing List

Introduce an easy way for projects to get its git version. This is
something that other projects using git would like to do, and we don't
want them all reinventing the wheel.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
Hi *,

I would prefer an output with an explicit git string as:

v1.4.2-rc3-git46faaaf

Also I would prefer the dirty state with an ending M as in:

v1.4.2-rc3-git46faaaf-M

to use the same letter of the diff family.

   Santi

 Makefile               |    3 ++-
 git-project-version.sh |    9 +++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index d662bd6..7c4e360 100644
--- a/Makefile
+++ b/Makefile
@@ -169,7 +169,8 @@ SCRIPT_SH = \
 	git-applymbox.sh git-applypatch.sh git-am.sh \
 	git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
 	git-merge-resolve.sh git-merge-ours.sh \
-	git-lost-found.sh git-quiltimport.sh
+	git-lost-found.sh git-quiltimport.sh \
+	git-project-version.sh
 
 SCRIPT_PERL = \
 	git-archimport.perl git-cvsimport.perl git-relink.perl \
diff --git a/git-project-version.sh b/git-project-version.sh
new file mode 100755
index 0000000..88b21fa
--- /dev/null
+++ b/git-project-version.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# First try git-describe.
+VN=$(git describe --abbrev=4 HEAD 2>/dev/null) ||
+VN=$(git rev-parse --short HEAD | sed -e 's/^/g/')
+
+dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty=
+[ "$dirty" ] && VN="$VN-dirty"
+
+echo $VN
-- 
1.4.2.rc3.g3f0a-dirty

^ permalink raw reply related

* [PATCH 5/5] autoconf: Unset NO_STH and NEED_STH when it is detected not needed
From: Jakub Narebski @ 2006-08-04 21:43 UTC (permalink / raw)
  To: git
In-Reply-To: <200608042333.19011.jnareb@gmail.com>

When configure detects some NO_XXX or NEEDS_XXX is unneeded, unset
this variable (actually set it to empty string).  This allow
autodetection to override the default set in Makefile.

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

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 configure.ac |   49 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 33 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6557bd2..74984e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,31 +154,36 @@ AC_MSG_NOTICE([CHECKS for libraries])
 #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
-AC_CHECK_LIB([crypto], [SHA1_Init],[],
+AC_CHECK_LIB([crypto], [SHA1_Init],
+[GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)],
 [AC_CHECK_LIB([ssl], [SHA1_Init],
- [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)],
+ [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)
+  GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=)],
  [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])])
 #
 # Define NO_CURL if you do not have curl installed.  git-http-pull and
 # git-http-push are not built, and you cannot use http:// and https://
 # transports.
-AC_CHECK_LIB([curl], [curl_global_init],[],
+AC_CHECK_LIB([curl], [curl_global_init],
+[GIT_CONF_APPEND_LINE(NO_CURL=)],
 [GIT_CONF_APPEND_LINE(NO_CURL=YesPlease)])
 #
 # Define NO_EXPAT if you do not have expat installed.  git-http-push is
 # not built, and you cannot push using http:// and https:// transports.
-AC_CHECK_LIB([expat], [XML_ParserCreate],[],
+AC_CHECK_LIB([expat], [XML_ParserCreate],
+[GIT_CONF_APPEND_LINE(NO_EXPAT=)],
 [GIT_CONF_APPEND_LINE(NO_EXPAT=YesPlease)])
 #
 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
-AC_CHECK_LIB([c], [iconv],[],
+AC_CHECK_LIB([c], [iconv],
+[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=)],
 [GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)])
 #
 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
 # Patrick Mauritz).
-AC_CHECK_LIB([c], [socket],[],
-[AC_CHECK_LIB([socket],[socket],
- [GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)],[])])
+AC_CHECK_LIB([c], [socket],
+[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=)],
+[GIT_CONF_APPEND_LINE(NEEDS_SOCKET=YesPlease)])
 
 
 ## Checks for header files.
@@ -188,24 +193,28 @@ ## Checks for typedefs, structures, and 
 AC_MSG_NOTICE([CHECKS for typedefs, structures, and compiler characteristics])
 #
 # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
-AC_CHECK_MEMBER(struct dirent.d_ino,[],
+AC_CHECK_MEMBER(struct dirent.d_ino,
+[GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=)],
 [GIT_CONF_APPEND_LINE(NO_D_INO_IN_DIRENT=YesPlease)],
 [#include <dirent.h>])
 #
 # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
 # d_type in struct dirent (latest Cygwin -- will be fixed soonish).
-AC_CHECK_MEMBER(struct dirent.d_type,[],
+AC_CHECK_MEMBER(struct dirent.d_type,
+[GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=)],
 [GIT_CONF_APPEND_LINE(NO_D_TYPE_IN_DIRENT=YesPlease)],
 [#include <dirent.h>])
 #
 # Define NO_SOCKADDR_STORAGE if your platform does not have struct
 # sockaddr_storage.
-AC_CHECK_TYPE(struct sockaddr_storage,[],
+AC_CHECK_TYPE(struct sockaddr_storage,
+[GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=)],
 [GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)],
 [#include <netinet/in.h>])
 #
 # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
-AC_CHECK_TYPE(struct addrinfo,[],
+AC_CHECK_TYPE(struct addrinfo,
+[GIT_CONF_APPEND_LINE(NO_IPV6=)],
 [GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)],
 [#include <sys/types.h>
 #include <sys/socket.h>
@@ -230,6 +239,8 @@ AC_RUN_IFELSE(
 ])
 if test $ac_cv_c_c99_format = no; then
 	GIT_CONF_APPEND_LINE(NO_C99_FORMAT=YesPlease)
+else
+	GIT_CONF_APPEND_LINE(NO_C99_FORMAT=)
 fi
 
 
@@ -238,25 +249,31 @@ ## (in default C library and libraries c
 AC_MSG_NOTICE([CHECKS for library functions])
 #
 # Define NO_STRCASESTR if you don't have strcasestr.
-AC_CHECK_FUNC(strcasestr,[],
+AC_CHECK_FUNC(strcasestr,
+[GIT_CONF_APPEND_LINE(NO_STRCASESTR=)],
 [GIT_CONF_APPEND_LINE(NO_STRCASESTR=YesPlease)])
 #
 # Define NO_STRLCPY if you don't have strlcpy.
-AC_CHECK_FUNC(strlcpy,[],
+AC_CHECK_FUNC(strlcpy,
+[GIT_CONF_APPEND_LINE(NO_STRLCPY=)],
 [GIT_CONF_APPEND_LINE(NO_STRLCPY=YesPlease)])
 #
 # Define NO_SETENV if you don't have setenv in the C library.
-AC_CHECK_FUNC(setenv,[],
+AC_CHECK_FUNC(setenv,
+[GIT_CONF_APPEND_LINE(NO_SETENV=)],
 [GIT_CONF_APPEND_LINE(NO_SETENV=YesPlease)])
 #
 # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
-AC_CHECK_FUNC(getaddrinfo,[],
+AC_CHECK_FUNC(getaddrinfo,
+[GIT_CONF_APPEND_LINE(NO_IPV6=)],
 [GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)])
 #
 # Define NO_MMAP if you want to avoid mmap.
 AC_FUNC_MMAP
 if test $ac_cv_func_mmap_fixed_mapped != yes; then
 	GIT_CONF_APPEND_LINE(NO_MMAP=YesPlease)
+else
+	GIT_CONF_APPEND_LINE(NO_MMAP=)
 fi
 #
 # Define NO_ICONV if your libc does not properly support iconv.
-- 
1.4.1.1

^ permalink raw reply related

* [PATCH 0/5] autoconf: Fixes and improvements (was: What's in git.git)
From: Jakub Narebski @ 2006-08-04 21:33 UTC (permalink / raw)
  To: git

Junio C Hamano wrote:

> (1) configure misdetects NO_OPENSSL.  The relevant parts are:
>
>         checking for SHA1_Init in -lssl... no
>         checking for SHA1_INIT in -lcrypto... no
>
>     but I've been building git on Cygwin without NO_OPENSSL (eh,
>     that's double negation -- what I mean is I've been building
>     git with -lssl just fine).  I think the function to check in
>     -lcrypto should be SHA1_Init, not SHA1_INIT (trivial patch
>     attached at the end).

Should be corrected by patches 1 and 3 by Junio C Hamano.
I had just not understood meaning of NEEDS_SSL_WITH_CRYPTO 
variable.

> (2) NO_STRLCPY is detected to be available by configure.  I
>     think we should update the default in Makefile.

Not adressed.

> (3) NEEDS_LIBICONV is found to be unnecessary by configure, but
>     the link fails like this without it:
>
>         builtin-mailinfo.o: In function `convert_to_utf8':
>         /git/builtin-mailinfo.c:539: undefined reference to
> `_libiconv_open' /git/builtin-mailinfo.c:560: undefined reference to
> `_libiconv' /git/builtin-mailinfo.c:561: undefined reference to
> `_libiconv_close' collect2: ld returned 1 exit status

Check if patch 2 corrects this error. Patch 5 does the same as patch 2 
for NEEDS_SOCKET due to cleanup during making this change.

> (4) NO_IPV6 is not detected yet -- you should be able to detect
>     this by checking for "struct addrinfo".  The compilation
>     fails like this on Cygwin:
>
>         connect.c: In function `git_tcp_connect_sock':
>         connect.c:361: error: storage size of 'hints' isn't known

Patch 4 adresses this. Perhas one of the checks can be dropped (leaving 
easier or faster one).

> (Z) When configure detects some NO_XXX is unneeded, currently
>     there is no way for generated config.mak.autogen to override
>     the default set in Makefile.  For example, NO_STRLCPY is set
>     by Makefile, and the included config.mak.autogen does not
>     say anything about it even though it knows strlcpy is
>     usable.  It might be better to explicitly undef unneeded
>     NO_XXX in config.mak.autogen?

Patch 5 tries to address this. Additionally it can be easily seen what 
was detested... but it is somewhat harder to see which variables are 
set among unset ones.

-- 
Jakub Narebski
Poland

^ permalink raw reply

* [PATCH 4/5] autoconf: Double check for IPv6 support
From: Jakub Narebski @ 2006-08-04 21:30 UTC (permalink / raw)
  To: git
In-Reply-To: <200608042333.19011.jnareb@gmail.com>

Check for IPv6 support, first by checking if "struct addrinfo" exists,
then by checking if there is getaddrinfo() in standard libraries.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 configure.ac |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index a49bd1f..6557bd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,13 @@ AC_CHECK_TYPE(struct sockaddr_storage,[]
 [GIT_CONF_APPEND_LINE(NO_SOCKADDR_STORAGE=YesPlease)],
 [#include <netinet/in.h>])
 #
+# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
+AC_CHECK_TYPE(struct addrinfo,[],
+[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)],
+[#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>])
+#
 # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
 # do not support the 'size specifiers' introduced by C99, namely ll, hh,
 # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
@@ -242,14 +249,16 @@ # Define NO_SETENV if you don't have set
 AC_CHECK_FUNC(setenv,[],
 [GIT_CONF_APPEND_LINE(NO_SETENV=YesPlease)])
 #
+# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
+AC_CHECK_FUNC(getaddrinfo,[],
+[GIT_CONF_APPEND_LINE(NO_IPV6=YesPlease)])
+#
 # Define NO_MMAP if you want to avoid mmap.
 AC_FUNC_MMAP
 if test $ac_cv_func_mmap_fixed_mapped != yes; then
 	GIT_CONF_APPEND_LINE(NO_MMAP=YesPlease)
 fi
 #
-# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
-#
 # Define NO_ICONV if your libc does not properly support iconv.
 
 
-- 
1.4.1.1

^ permalink raw reply related

* [PATCH 1/5] autoconf: typofix to detect SHA1_Init in -lcrypto
From: Jakub Narebski @ 2006-08-04 21:29 UTC (permalink / raw)
  To: git
In-Reply-To: <200608042333.19011.jnareb@gmail.com>

>From 15951e524df655d12b2bc42b1cf0a4be39fc3278 Mon Sep 17 00:00:00 2001
From: Junio C Hamano <junkio@cox.net>
Date: Fri, 4 Aug 2006 22:17:35 +0200
Subject: [PATCH 1/5] autoconf: typofix to detect SHA1_Init in -lcrypto

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 76bfa9d..5926f3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,7 +155,7 @@ #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl 
(Darwin).
 AC_CHECK_LIB([ssl], [SHA1_Init],[],
-[AC_CHECK_LIB([crypto], [SHA1_INIT],
+[AC_CHECK_LIB([crypto], [SHA1_Init],
  [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)],
  [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])])
 #
-- 
1.4.1.1

^ permalink raw reply related

* [PATCH 2/5] autoconf: Set NEEDS_LIBICONV unconditionally if there is no iconv in libc
From: Jakub Narebski @ 2006-08-04 21:28 UTC (permalink / raw)
  To: git
In-Reply-To: <200608042333.19011.jnareb@gmail.com>

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 configure.ac |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5926f3c..61c9fa3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,8 +172,7 @@ AC_CHECK_LIB([expat], [XML_ParserCreate]
 #
 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
 AC_CHECK_LIB([c], [iconv],[],
-[AC_CHECK_LIB([iconv],[iconv],
- [GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)],[])])
+[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)])
 #
 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
 # Patrick Mauritz).
-- 
1.4.1.1

^ permalink raw reply related

* [PATCH 3/5] autoconf: Fix NEEDS_SSL_WITH_CRYPTO detection
From: Jakub Narebski @ 2006-08-04 21:28 UTC (permalink / raw)
  To: git
In-Reply-To: <200608042333.19011.jnareb@gmail.com>

>From 7829f2f76c429594602d845168841d378d269fba Mon Sep 17 00:00:00 2001
From: Junio C Hamano <junkio@cox.net>
Date: Fri, 4 Aug 2006 13:06:33 -0700
Subject: [PATCH 3/5] autoconf: Fix NEEDS_SSL_WITH_CRYPTO detection

NEEDS_SSL_WITH_CRYPTO means you cannot just say "-lcrypto" to
use SHA1 stuff, but need to say "-lcrypto -lssl", so the test
should say "if we can get away with -lcrypto, we are happy,
otherwise if we need -lssl, then say NEEDS_SSL_WITH_CRYPTO,
otherwise we cannot use OpenSSL so say NO_OPENSSL", or something
like that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 configure.ac |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 61c9fa3..a49bd1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,8 +154,8 @@ AC_MSG_NOTICE([CHECKS for libraries])
 #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
-AC_CHECK_LIB([ssl], [SHA1_Init],[],
-[AC_CHECK_LIB([crypto], [SHA1_Init],
+AC_CHECK_LIB([crypto], [SHA1_Init],[],
+[AC_CHECK_LIB([ssl], [SHA1_Init],
  [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)],
  [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])])
 #
-- 
1.4.1.1

^ permalink raw reply related

* update-ref logs: problem with committer info?
From: Ramsay Jones @ 2006-08-04 21:01 UTC (permalink / raw)
  To: git

Hi all,

As a follow-up to the previous (two) email, this concerns the ability
to override the committer info from the config file. As before, this
depends on the relative call sites of setup_ident() and git_config().

In particular, the call to setup_ident(), from log_ref_write(),
which in turn is called from write_ref_sha1() in file refs.c.
Here, the call to setup_ident() seems to me to be misplaced and to
almost guarantee that it will over-write the values set by an
earlier call to git_config(). It is possible, I suppose, that there
has been no previous call to git_config(); just not very likely, and
even if that were so, then it should be the responsibility of the
*callers* of write_ref_sha1() to ensure this happens.

Indeed, tracing the callers of write_ref_sha1(), we find cmd_update_ref()
in builtin-update-ref.c and pull() in fetch.c. Adding a call to
setup_ident() in cmd_update_ref() takes care of that route. The callers
of pull() are to be found in http-fetch.c, local-fetch.c and ssh-fetch.c.
Adding calls to setup_ident() in these callers is equally simple, so it
only remains to remove the call from refs.c.

Now, as in the previous email, I can't compile http-fetch.c or test
the result. (Yes, I could test a local fetch, but I'm feeling lazy!)
In addition, I feel that somebody who knows the code better than I
should take a look.

comments?

Ramsay

diff --git a/builtin-update-ref.c b/builtin-update-ref.c
index 00333c7..83094ab 100644
--- a/builtin-update-ref.c
+++ b/builtin-update-ref.c
@@ -12,6 +12,7 @@ int cmd_update_ref(int argc, const char 
 	unsigned char sha1[20], oldsha1[20];
 	int i;
 
+	setup_ident();
 	setup_git_directory();
 	git_config(git_default_config);
 
diff --git a/http-fetch.c b/http-fetch.c
index 44eba5f..fe3a4fd 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -1222,6 +1222,7 @@ int main(int argc, char **argv)
 	int arg = 1;
 	int rc = 0;
 
+	setup_ident();
 	setup_git_directory();
 	git_config(git_default_config);
 
diff --git a/local-fetch.c b/local-fetch.c
index ffa4887..d059a51 100644
--- a/local-fetch.c
+++ b/local-fetch.c
@@ -207,6 +207,7 @@ int main(int argc, char **argv)
 	char *commit_id;
 	int arg = 1;
 
+	setup_ident();
 	setup_git_directory();
 	git_config(git_default_config);
 
diff --git a/refs.c b/refs.c
index 713ca46..a4060d8 100644
--- a/refs.c
+++ b/refs.c
@@ -379,7 +379,6 @@ static int log_ref_write(struct ref_lock
 			lock->log_file, strerror(errno));
 	}
 
-	setup_ident();
 	comitter = git_committer_info(1);
 	if (msg) {
 		maxlen = strlen(comitter) + strlen(msg) + 2*40 + 5;
diff --git a/ssh-fetch.c b/ssh-fetch.c
index 1e59cd2..a42d17e 100644
--- a/ssh-fetch.c
+++ b/ssh-fetch.c
@@ -131,6 +131,7 @@ int main(int argc, char **argv)
 	prog = getenv("GIT_SSH_PUSH");
 	if (!prog) prog = "git-ssh-upload";
 
+	setup_ident();
 	setup_git_directory();
 	git_config(git_default_config);
 

^ permalink raw reply related

* http-push: email address problem with LOCK_REQUEST?
From: Ramsay Jones @ 2006-08-04 21:01 UTC (permalink / raw)
  To: git

Hi all,

Whilst fixing the git-format-patch "Signed-off-by identity bug", I
decided to have a look at the other calls to setup_ident(), to check
for similar problems. I noticed a couple of things that didn't look
quite right (see also next email).

In particular, http-push accesses git_default_email directly, using
it as part of a (DAV?) LOCK_REQUEST. However, since http-push does
not call git_config(), only the generic <user@localhost.localdomain>
determined by setup_ident() will be used.

Now this may not be a problem. I don't really know what the email
address is used for in the lock request; it could have no effect
on the transaction at all, apart from perhaps some message text
in the web-server logs.

Also, there may be a reason for not reading the config file. I can't
think of one, but hey ...

Unfortunately, since my config has NO_CURL, I can't even compile
http-push.c, let alone test the change given below.

comments anyone?

Ramsay


diff --git a/http-push.c b/http-push.c
index e281f70..4de62e4 100644
--- a/http-push.c
+++ b/http-push.c
@@ -2340,6 +2340,7 @@ int main(int argc, char **argv)
 
 	setup_git_directory();
 	setup_ident();
+	git_config(git_default_config);
 
 	remote = xcalloc(sizeof(*remote), 1);
 

^ permalink raw reply related

* [PATCH] Allow config file to specify Signed-off-by identity in format-patch.
From: Ramsay Jones @ 2006-08-04 21:01 UTC (permalink / raw)
  To: git

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


Unlike git-commit, git-format-patch was not picking up and using the
user.email config variable for the email part of the committer info.
I was forced to use the GIT_COMMITTER_EMAIL environment variable to
override the default <user@localhost.localdomain>. The fix was to
simply move the call to setup_ident() to come before the git_config()
call.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin-log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index f9515a8..dcee141 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -243,6 +243,7 @@ int cmd_format_patch(int argc, const cha
 	rev.ignore_merges = 1;
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 
+	setup_ident();
 	git_config(git_format_config);
 	rev.extra_headers = extra_headers;
 
@@ -283,7 +284,6 @@ int cmd_format_patch(int argc, const cha
 			 !strcmp(argv[i], "-s")) {
 			const char *committer;
 			const char *endpos;
-			setup_ident();
 			committer = git_committer_info(1);
 			endpos = strchr(committer, '>');
 			if (!endpos)
-- 
1.4.1

[-- Attachment #2: P0013.TXT --]
[-- Type: text/plain, Size: 1346 bytes --]

From 2bc01f2ceb042192827d05e941ca81c1a7dc30fe Mon Sep 17 00:00:00 2001
From: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Date: Fri, 4 Aug 2006 17:18:15 +0100
Subject: [PATCH] Allow config file to specify Signed-off-by identity in format-patch.

Unlike git-commit, git-format-patch was not picking up and using the
user.email config variable for the email part of the committer info.
I was forced to use the GIT_COMMITTER_EMAIL environment variable to
override the default <user@localhost.localdomain>. The fix was to
simply move the call to setup_ident() to come before the git_config()
call.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
---
 builtin-log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index f9515a8..dcee141 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -243,6 +243,7 @@ int cmd_format_patch(int argc, const cha
 	rev.ignore_merges = 1;
 	rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 
+	setup_ident();
 	git_config(git_format_config);
 	rev.extra_headers = extra_headers;
 
@@ -283,7 +284,6 @@ int cmd_format_patch(int argc, const cha
 			 !strcmp(argv[i], "-s")) {
 			const char *committer;
 			const char *endpos;
-			setup_ident();
 			committer = git_committer_info(1);
 			endpos = strchr(committer, '>');
 			if (!endpos)
-- 
1.4.1


^ permalink raw reply related

* Oh, you are not able to control your feelings!
From: Prince @ 2006-08-04 20:46 UTC (permalink / raw)
  To: glenda

Hello my friend! The good news are that this obstacle can be overcome by you, the real man. Extra-Time is ready to contribute to your durability, confidence and happiness. Many of us know the bitter feeling of not being able to deliver longer acts of mutual pleasure. Enter here:  http://finepont.com/gal/get/ Girls will start spreading rumors about the duration they got with you.

^ permalink raw reply

* Re: Creating objects manually and repack
From: Jakub Narebski @ 2006-08-04 20:37 UTC (permalink / raw)
  To: git
In-Reply-To: <7vd5bgi6qt.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:

> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> Junio C Hamano wrote:
>>
>>> There _already_ is a command called git-show-index, since early
>>> July last year ;-).
>>
>> Parhaps it should be renamed then, for consistency? 
> 
> There isn't anything to make consistent.  We use the word 
> "index" to mean both dircache and the pack index files.
> Usually you can tell between the two usage from context.

Oops. I should say, for better readibility (to not depend on context), then.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: Creating objects manually and repack
From: Junio C Hamano @ 2006-08-04 20:30 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <eb09ln$h7k$1@sea.gmane.org>

Jakub Narebski <jnareb@gmail.com> writes:

> Junio C Hamano wrote:
>
>> There _already_ is a command called git-show-index, since early
>> July last year ;-).
>
> Parhaps it should be renamed then, for consistency? 

There isn't anything to make consistent.  We use the word 
"index" to mean both dircache and the pack index files.
Usually you can tell between the two usage from context.

We could rename it to git-show-pack-index, but the command has
primarily been the debugging aid and not for real use, and I was
actually thinking about removing it, perhaps until now ;-).

^ permalink raw reply

* Re: What's in git.git
From: Jakub Narebski @ 2006-08-04 20:27 UTC (permalink / raw)
  To: git
In-Reply-To: <7vy7u4i8lm.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:

> (3) NEEDS_LIBICONV is found to be unnecessary by configure, but
>     the link fails like this without it:
> 
>         builtin-mailinfo.o: In function `convert_to_utf8':
>         /git/builtin-mailinfo.c:539: undefined reference to `_libiconv_open'
>         /git/builtin-mailinfo.c:560: undefined reference to `_libiconv'
>         /git/builtin-mailinfo.c:561: undefined reference to `_libiconv_close'
>         collect2: ld returned 1 exit status

Does the following patch help?

+++
autoconf: Set NEEDS_LIBICONV unconditionally if there is no iconv in libc

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 configure.ac |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5926f3c..61c9fa3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,8 +172,7 @@ AC_CHECK_LIB([expat], [XML_ParserCreate]
 #
 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
 AC_CHECK_LIB([c], [iconv],[],
-[AC_CHECK_LIB([iconv],[iconv],
- [GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)],[])])
+[GIT_CONF_APPEND_LINE(NEEDS_LIBICONV=YesPlease)])
 #
 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
 # Patrick Mauritz).
-- 
1.4.1.1

^ permalink raw reply related

* Re: Creating objects manually and repack
From: Jakub Narebski @ 2006-08-04 20:12 UTC (permalink / raw)
  To: git
In-Reply-To: <7vodv0i89m.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:

> Carl Worth <cworth@cworth.org> writes:
> 
>> On Fri, 4 Aug 2006 12:20:36 -0700 (PDT), Linus Torvalds wrote:
>>> > > To get a list of all object names in a pack-file, you'd basically do
just
>>> > > something like the appended.
>>> >
>>> > git-show-index?
>>>
>>> Yeah, that might be good.
>>
>> That clashes pretty badly with update-index. git-show-pack-index
>> perhaps?
> 
> There _already_ is a command called git-show-index, since early
> July last year ;-).

Parhaps it should be renamed then, for consistency? 

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: Creating objects manually and repack
From: Carl Worth @ 2006-08-04 20:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vodv0i89m.fsf@assigned-by-dhcp.cox.net>

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

On Fri, 04 Aug 2006 12:57:25 -0700, Junio C Hamano wrote:
> > That clashes pretty badly with update-index. git-show-pack-index
> > perhaps?
>
> There _already_ is a command called git-show-index, since early
> July last year ;-).

Ah, don't mind me then. Just another one of my public displays of
incompetence. Time to go back and work harder on memorizing that list
of 120+ commands...

-Carl

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

^ permalink raw reply

* Re: Creating objects manually and repack
From: Carl Worth @ 2006-08-04 20:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vodv0i89m.fsf@assigned-by-dhcp.cox.net>

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

On Fri, 04 Aug 2006 12:57:25 -0700, Junio C Hamano wrote:
> > That clashes pretty badly with update-index. git-show-pack-index
> > perhaps?
>
> There _already_ is a command called git-show-index, since early
> July last year ;-).

Ah, don't mind me then. Just another one of my typical public displays
of ignorance. Time to go back and work harder on memorizing that list
of 120+ commands...

-Carl

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

^ permalink raw reply

* Re: What's in git.git
From: Junio C Hamano @ 2006-08-04 20:06 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <7vy7u4i8lm.fsf@assigned-by-dhcp.cox.net>

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

> (1) configure misdetects NO_OPENSSL.  The relevant parts are:
>
>         checking for SHA1_Init in -lssl... no
>         checking for SHA1_INIT in -lcrypto... no
>
>     but I've been building git on Cygwin without NO_OPENSSL (eh,
>     that's double negation -- what I mean is I've been building
>     git with -lssl just fine).  I think the function to check in
>     -lcrypto should be SHA1_Init, not SHA1_INIT (trivial patch
>     attached at the end).

I just noticed that this is not enough.  It does fix the
NO_OPENSSL problem, but I think the logic and test for ssl and
crypto in the original are the other way around.

NEEDS_SSL_WITH_CRYPTO means you cannot just say "-lcrypto" to
use SHA1 stuff, but need to say "-lcrypto -lssl", so the test
should say "if we can get away with -lcrypto, we are happy,
otherwise if we need -lssl, then say NEEDS_SSL_WITH_CRYPTO,
otherwise we cannot use OpenSSL so say NO_OPENSSL", or something
like that.

-- >8 --

diff --git a/configure.ac b/configure.ac
index 9ce00e9..fea18b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,8 +154,8 @@ AC_MSG_NOTICE([CHECKS for libraries])
 #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
-AC_CHECK_LIB([ssl], [SHA1_Init],[],
-[AC_CHECK_LIB([crypto], [SHA1_INIT],
+AC_CHECK_LIB([crypto], [SHA1_Init],[],
+[AC_CHECK_LIB([ssl], [SHA1_Init],
  [GIT_CONF_APPEND_LINE(NEEDS_SSL_WITH_CRYPTO=YesPlease)],
  [GIT_CONF_APPEND_LINE(NO_OPENSSL=YesPlease)])])
 #

^ permalink raw reply related


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