Git development
 help / color / mirror / Atom feed
* [PATCH (fixed)] git-svn: fix --rmdir when using SVN:: libraries
From: Eric Wong @ 2006-06-20  0:59 UTC (permalink / raw)
  To: git, Junio C Hamano; +Cc: Eric Wong
In-Reply-To: <11507645052855-git-send-email-normalperson@yhbt.net>

When tracking directories with nearly all of its files at
the most nested levels, --rmdir would accidentally go too
far when deleting.

Of course, we'll add a test for this condition, too.

Makefile: automatically run new tests as they appear in t/

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---

Oops, I left out the Makefile change in the other patch, had the new
test file as +x

 contrib/git-svn/Makefile              |    3 +--
 contrib/git-svn/git-svn.perl          |   15 +++++++++++----
 contrib/git-svn/t/t0002-deep-rmdir.sh |   29 +++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/contrib/git-svn/Makefile b/contrib/git-svn/Makefile
index 6aedb10..7c20946 100644
--- a/contrib/git-svn/Makefile
+++ b/contrib/git-svn/Makefile
@@ -29,8 +29,7 @@ git-svn.html : git-svn.txt
 	asciidoc -b xhtml11 -d manpage \
 		-f ../../Documentation/asciidoc.conf $<
 test: git-svn
-	cd t && $(SHELL) ./t0000-contrib-git-svn.sh $(TEST_FLAGS)
-	cd t && $(SHELL) ./t0001-contrib-git-svn-props.sh $(TEST_FLAGS)
+	cd t && for i in t????-*.sh; do $(SHELL) ./$$i $(TEST_FLAGS); done
 
 # we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
 full-test:
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index da0ff9a..7e7f2f0 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -2841,13 +2841,20 @@ sub rmdirs {
 		exec qw/git-ls-tree --name-only -r -z/, $self->{c} or croak $!;
 	}
 	local $/ = "\0";
+	my @svn_path = split m#/#, $self->{svn_path};
 	while (<$fh>) {
 		chomp;
-		$_ = $self->{svn_path} . '/' . $_;
-		my ($dn) = ($_ =~ m#^(.*?)/?(?:[^/]+)$#);
-		delete $rm->{$dn};
-		last unless %$rm;
+		my @dn = (@svn_path, (split m#/#, $_));
+		while (pop @dn) {
+			delete $rm->{join '/', @dn};
+		}
+		unless (%$rm) {
+			close $fh;
+			return;
+		}
 	}
+	close $fh;
+
 	my ($r, $p, $bat) = ($self->{r}, $self->{pool}, $self->{bat});
 	foreach my $d (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$rm) {
 		$self->close_directory($bat->{$d}, $p);
diff --git a/contrib/git-svn/t/t0002-deep-rmdir.sh b/contrib/git-svn/t/t0002-deep-rmdir.sh
new file mode 100644
index 0000000..d693d18
--- /dev/null
+++ b/contrib/git-svn/t/t0002-deep-rmdir.sh
@@ -0,0 +1,29 @@
+test_description='git-svn rmdir'
+. ./lib-git-svn.sh
+
+test_expect_success 'initialize repo' "
+	mkdir import &&
+	cd import &&
+	mkdir -p deeply/nested/directory/number/1 &&
+	mkdir -p deeply/nested/directory/number/2 &&
+	echo foo > deeply/nested/directory/number/1/file &&
+	echo foo > deeply/nested/directory/number/2/another &&
+	svn import -m 'import for git-svn' . $svnrepo &&
+	cd ..
+	"
+
+test_expect_success 'mirror via git-svn' "
+	git-svn init $svnrepo &&
+	git-svn fetch &&
+	git checkout -f -b test-rmdir remotes/git-svn
+	"
+
+test_expect_success 'Try a commit on rmdir' "
+	git rm -f deeply/nested/directory/number/2/another &&
+	git commit -a -m 'remove another' &&
+	git-svn commit --rmdir HEAD &&
+	svn ls -R $svnrepo | grep ^deeply/nested/directory/number/1
+	"
+
+
+test_done
-- 
1.4.GIT

^ permalink raw reply related

* Re: [PATCH (fixed)] git-svn: fix --rmdir when using SVN:: libraries
From: Junio C Hamano @ 2006-06-20  1:17 UTC (permalink / raw)
  To: Eric Wong; +Cc: git
In-Reply-To: <11507651751452-git-send-email-normalperson@yhbt.net>

Eric Wong <normalperson@yhbt.net> writes:

> Makefile: automatically run new tests as they appear in t/
>
> Signed-off-by: Eric Wong <normalperson@yhbt.net>
> ---
>
> Oops, I left out the Makefile change in the other patch,...

Yeah, I was wondering about that.

> ... had the new
> test file as +x

Shouldn't they be executable?  It is not a big deal, because you
run them via $(SHELL), though...

^ permalink raw reply

* Re: [PATCH] Fix git to be (more) ANSI C99 compliant.
From: Junio C Hamano @ 2006-06-20  1:59 UTC (permalink / raw)
  To: Florian Forster; +Cc: git, Linus Torvalds, Rene Scharfe
In-Reply-To: <20060619212116.GL1331@verplant.org>

Florian Forster <octo@verplant.org> writes:

> I didn't start writing the patch because I like C99 so much. In fact, in
> my opinion it introduces some possibilities I'd rather not have in C
> because people might actually use them. But by default the Sun cc
> complains about void-pointer arithmetic...

I am reasonably sympathetic to that, and judging from the number
of lines the patch touches, I am not as strongly opposed to it
as Linus seems to be.

> Maybe Rene Scharfe's method (as used in the patch to git-tar-tree) is a
> good way around it? There are no explicit casts involved and standard-
> compliant compilers like it, too. The downside is that you have two
> variables for the same thing/memory.

I think Rene's patch makes sense primarily because the functions
affected are small and we can easily see that the aliased input
variable ("data") is not used -- IOW, there is no confusion.

If it were a big function and the code used one variable for
some purpose and the other one for another purpose, it would be
far worse than having to cast the same variable occasionally.

BTW, I think we would probably want to have this patch on top of
Rene's patch.  In all instances, the variable "buf" is of type
"const char *" and the existing casts do not make sense to me.


diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c
index 5c8a5f0..39a61b6 100644
--- a/builtin-tar-tree.c
+++ b/builtin-tar-tree.c
@@ -36,7 +36,7 @@ static void reliable_write(const void *d
 			die("git-tar-tree: disk full?");
 		}
 		size -= ret;
-		buf = (char *) buf + ret;
+		buf += ret;
 	}
 }
 
@@ -65,13 +65,13 @@ static void write_blocked(const void *da
 		memcpy(block + offset, buf, chunk);
 		size -= chunk;
 		offset += chunk;
-		buf = (char *) buf + chunk;
+		buf += chunk;
 		write_if_needed();
 	}
 	while (size >= BLOCKSIZE) {
 		reliable_write(buf, BLOCKSIZE);
 		size -= BLOCKSIZE;
-		buf = (char *) buf + BLOCKSIZE;
+		buf += BLOCKSIZE;
 	}
 	if (size) {
 		memcpy(block + offset, buf, size);

^ permalink raw reply related

* Re: 2.6.17-rc6-mm2
From: Michal Ludvig @ 2006-06-20  3:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Goo GGooo, git, Junio C Hamano
In-Reply-To: <Pine.LNX.4.64.0606152335130.5498@g5.osdl.org>

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

Linus Torvalds wrote:
> 
> On Fri, 16 Jun 2006, Goo GGooo wrote:
> 
>> I suggest adding SO_KEEPALIVE option on the git socket.
> 
> Actually, the really irritating thing is that we actually generate all 
> these nice status updates, which just makes pulling and cloning a lot more 
> comfortable, because you actually see what is going on, and what to 
> expect. 
> 
> Except they only work over ssh, where we have a separate channel (for 
> stderr), and with the native git protocol all that nice status work just 
> gets flushed to /dev/null :(

OpenBSD has CVS access to their repos over SSH even for anonymous users.
Could something similar be set up on git.kernel.org as well?

> And in your case, the usability downside actually turned into a real 
> accessibility bug.

Same issue here. Thanks for the hint. Attached is a patch against git
1.4.0 that solves it perfectly in my case.

Sysctl settings (for keepalive every 10 sec):
net.ipv4.tcp_keepalive_intvl=10
net.ipv4.tcp_keepalive_time=10

Michal

[-- Attachment #2: keepalive.diff --]
[-- Type: text/x-patch, Size: 1375 bytes --]

Set SO_KEEPALIVE option on native git:// sockets.

Signed-off-by: Michal Ludvig <michal@logix.cz>

Index: git-1.4.0/connect.c
===================================================================
--- git-1.4.0.orig/connect.c
+++ git-1.4.0/connect.c
@@ -331,7 +331,7 @@ static int git_tcp_connect_sock(char *ho
 	char *colon, *end;
 	char *port = STR(DEFAULT_GIT_PORT);
 	struct addrinfo hints, *ai0, *ai;
-	int gai;
+	int gai, option;
 
 	if (host[0] == '[') {
 		end = strchr(host + 1, ']');
@@ -363,6 +363,10 @@ static int git_tcp_connect_sock(char *ho
 				ai->ai_socktype, ai->ai_protocol);
 		if (sockfd < 0)
 			continue;
+
+		option = 1;
+		setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &option, sizeof(option));
+
 		if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) {
 			close(sockfd);
 			sockfd = -1;
@@ -392,7 +396,7 @@ static int git_tcp_connect_sock(char *ho
 	struct hostent *he;
 	struct sockaddr_in sa;
 	char **ap;
-	unsigned int nport;
+	unsigned int nport, option;
 
 	if (host[0] == '[') {
 		end = strchr(host + 1, ']');
@@ -433,6 +437,9 @@ static int git_tcp_connect_sock(char *ho
 		sa.sin_port = htons(nport);
 		memcpy(&sa.sin_addr, *ap, he->h_length);
 
+		option = 1;
+		setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &option, sizeof(option));
+
 		if (connect(sockfd, (struct sockaddr *)&sa, sizeof sa) < 0) {
 			close(sockfd);
 			sockfd = -1;

^ permalink raw reply

* [PATCH] Restore SIGCHLD to SIG_DFL where we care about waitpid().
From: Junio C Hamano @ 2006-06-20  3:11 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0606191742470.5498@g5.osdl.org>

It was reported that under one implementation of socks client,
"git clone" fails with "error: waitpid failed (No child
processes)", because "git" is spawned after setting SIGCHLD to
SIG_IGN.

Arguably it may be a broken setting, but we should protect
ourselves so that we can get reliable results from waitpid() for
the children we care about.

This patch resets SIGCHLD to SIG_DFL in three places:

 - connect.c::git_connect() - initiators of git native
   protocol transfer are covered with this.

 - daemon.c::main() - obviously.

 - merge-index.c::main() - obviously.

There are other programs that do fork() but do not waitpid():
http-push, imap-send.  upload-pack does not either, but in the
case of that program, each of the forked halves runs exec()
another program, so this change would not have much effect
there.

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

  Linus Torvalds <torvalds@osdl.org> writes:

  > On Mon, 19 Jun 2006, Junio C Hamano wrote:
  >
  >> I do not offhand think of a place where we do fork() but not
  >> waitpid(), and it is very tempting to cheat and do that in the
  >> main(), since I do not see a downside to it.
  >
  > Yeah, it probably does make sense. That said, there are several "main()" 
  > functions, so you'd still end up having to verify that we catch all the 
  > paths.. Are all users of fork() built-in by now? 
 
  Not really.  But git native protocol initiators all use
  git_connect() so they are easy, and there are only few
  remaining ones that matter.

 connect.c     |    5 +++++
 daemon.c      |    5 +++++
 merge-index.c |    5 +++++
 3 files changed, 15 insertions(+), 0 deletions(-)

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';
diff --git a/daemon.c b/daemon.c
index 2f03f99..1067004 100644
--- a/daemon.c
+++ b/daemon.c
@@ -671,6 +671,11 @@ int main(int argc, char **argv)
 	int inetd_mode = 0;
 	int i;
 
+	/* Without this we cannot rely on waitpid() to tell
+	 * what happened to our children.
+	 */
+	signal(SIGCHLD, SIG_DFL);
+
 	for (i = 1; i < argc; i++) {
 		char *arg = argv[i];
 
diff --git a/merge-index.c b/merge-index.c
index 024196e..190e12f 100644
--- a/merge-index.c
+++ b/merge-index.c
@@ -99,6 +99,11 @@ int main(int argc, char **argv)
 {
 	int i, force_file = 0;
 
+	/* Without this we cannot rely on waitpid() to tell
+	 * what happened to our children.
+	 */
+	signal(SIGCHLD, SIG_DFL);
+
 	if (argc < 3)
 		usage("git-merge-index [-o] [-q] <merge-program> (-a | <filename>*)");
 
-- 
1.4.0.g275f

^ permalink raw reply related

* Re: 2.6.17-rc6-mm2
From: Linus Torvalds @ 2006-06-20  3:22 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: Goo GGooo, git, Junio C Hamano
In-Reply-To: <44976506.8040205@logix.cz>



On Tue, 20 Jun 2006, Michal Ludvig wrote:
> 
> OpenBSD has CVS access to their repos over SSH even for anonymous users.
> Could something similar be set up on git.kernel.org as well?

I suspect the kernel.org people would prefer not to. And I'm almost 
certain that others don't want to. It would really be much better if the 
git protocol itself just had a sideband channel. Oh, well.

			Linus

^ permalink raw reply

* Re: [PATCH] Make CSS file gitweb/gitweb.css more readable
From: Jakub Narebski @ 2006-06-20  3:25 UTC (permalink / raw)
  To: git
In-Reply-To: <7vwtbc9a45.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:

> Jakub, I've been applying your patches after hand-fixing but it
> appears that there is serious whitespace breakage on the mail
> path somewhere between you and the mailing list.  Please check
> your MUA.

Checking:
--inserted file--
test
        tab test
         tab+space test
 space test
empty line below

line with tab only below
        
-- 
Signature
--end of inserted file--

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: [PATCH] Make CSS file gitweb/gitweb.css more readable
From: Jakub Narebski @ 2006-06-20  3:32 UTC (permalink / raw)
  To: git
In-Reply-To: <e77prc$v40$1@sea.gmane.org>

Jakub Narebski wrote:

> Junio C Hamano wrote:
> 
>> Jakub, I've been applying your patches after hand-fixing but it
>> appears that there is serious whitespace breakage on the mail
>> path somewhere between you and the mailing list.  Please check
>> your MUA.
> 
> Checking:

It looks like KNode/0.7.7 (from KDE 3.2.2) converts tabs to spaces
even for inserted files.

I'll use email client (KMail or git-send-email) in the future.


I'll be resending the patch as part of larger series in near future.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* [PATCH] Make CSS file gitweb/gitweb.css more readable
From: Jakub Narebski @ 2006-06-20  3:48 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski
In-Reply-To: <7vwtbc9a45.fsf@assigned-by-dhcp.cox.net>

---

 gitweb/gitweb.css |  273 +++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 223 insertions(+), 50 deletions(-)

72888c0a080d95117d54dc9578dc2a0de7b19abd
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 5900916..9d91426 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -1,58 +1,231 @@
 body {
-	font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px;
-	margin:10px; background-color:#ffffff; color:#000000;
-}
-a { color:#0000cc; }
-a:hover, a:visited, a:active { color:#880000; }
-div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
-div.page_header a:visited, a.header { color:#0000cc; }
-div.page_header a:hover { color:#880000; }
-div.page_nav { padding:8px; }
-div.page_nav a:visited { color:#0000cc; }
-div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px}
-div.page_footer { height:17px; padding:4px 8px; background-color: #d9d8d1; }
-div.page_footer_text { float:left; color:#555555; font-style:italic; }
-div.page_body { padding:8px; }
+	font-family: sans-serif;
+	font-size: 12px;
+	border:solid #d9d8d1;
+	border-width: 1px;
+	margin: 10px;
+	background-color: #ffffff;
+	color: #000000;
+}
+
+a { 
+	color: #0000cc;
+}
+
+a:hover, a:visited, a:active {
+	color: #880000;
+}
+
+div.page_header {
+	height: 25px;
+	padding: 8px;
+	font-size: 18px;
+	font-weight: bold;
+	background-color: #d9d8d1;
+}
+
+div.page_header a:visited, a.header {
+	color: #0000cc;
+}
+
+div.page_header a:hover {
+	color: #880000;
+}
+
+div.page_nav {
+	padding:8px;
+}
+
+div.page_nav a:visited {
+	color: #0000cc;
+}
+
+div.page_path {
+	padding: 8px;
+	border: solid #d9d8d1;
+	border-width: 0px 0px 1px;
+}
+
+div.page_footer {
+	height: 17px;
+	padding: 4px 8px;
+	background-color: #d9d8d1;
+}
+
+div.page_footer_text {
+	float: left;
+	color: #555555;
+	font-style: italic;
+}
+
+div.page_body {
+	padding: 8px;
+}
+
 div.title, a.title {
-	display:block; padding:6px 8px;
-	font-weight:bold; background-color:#edece6; text-decoration:none; color:#000000;
+	display: block;
+	padding: 6px 8px;
+	font-weight: bold;
+	background-color: #edece6;
+	text-decoration: none;
+	color: #000000;
+}
+
+a.title:hover {
+	background-color: #d9d8d1;
+}
+
+div.title_text {
+	padding: 6px 0px;
+	border: solid #d9d8d1;
+	border-width: 0px 0px 1px;
 }
-a.title:hover { background-color: #d9d8d1; }
-div.title_text { padding:6px 0px; border: solid #d9d8d1; border-width:0px 0px 1px; }
-div.log_body { padding:8px 8px 8px 150px; }
-span.age { position:relative; float:left; width:142px; font-style:italic; }
+
+div.log_body {
+	padding: 8px 8px 8px 150px;
+}
+
+span.age {
+	position: relative;
+	float: left;
+	width: 142px;
+	font-style:italic;
+}
+
 div.log_link {
-	padding:0px 8px;
-	font-size:10px; font-family:sans-serif; font-style:normal;
-	position:relative; float:left; width:136px;
-}
-div.list_head { padding:6px 8px 4px; border:solid #d9d8d1; border-width:1px 0px 0px; font-style:italic; }
-a.list { text-decoration:none; color:#000000; }
-a.list:hover { text-decoration:underline; color:#880000; }
-a.text { text-decoration:none; color:#0000cc; }
-a.text:visited { text-decoration:none; color:#880000; }
-a.text:hover { text-decoration:underline; color:#880000; }
-table { padding:8px 4px; }
-th { padding:2px 5px; font-size:12px; text-align:left; }
-tr.light:hover { background-color:#edece6; }
-tr.dark { background-color:#f6f6f0; }
-tr.dark:hover { background-color:#edece6; }
-td { padding:2px 5px; font-size:12px; vertical-align:top; }
-td.link { padding:2px 5px; font-family:sans-serif; font-size:10px; }
-div.pre { font-family:monospace; font-size:12px; white-space:pre; }
-div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
-div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
-div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
-a.linenr { color:#999999; text-decoration:none }
+	padding: 0px 8px;
+	font-size: 10px;
+	font-family: sans-serif;
+	font-style:normal;
+	position: relative;
+	float: left;
+	width: 136px;
+}
+
+div.list_head {
+	padding: 6px 8px 4px;
+	border: solid #d9d8d1;
+	border-width: 1px 0px 0px;
+	font-style: italic;
+}
+
+a.list {
+	text-decoration: none;
+	color: #000000;
+}
+
+a.list:hover {
+	text-decoration: underline;
+	color: #880000;
+}
+
+a.text {
+	text-decoration: none;
+	color: #0000cc;
+}
+
+a.text:visited {
+	text-decoration: none;
+	color: #880000;
+}
+
+a.text:hover {
+	text-decoration: underline;
+	color: #880000;
+}
+
+table {
+	padding: 8px 4px;
+}
+
+th {
+	padding: 2px 5px;
+	font-size: 12px;
+	text-align: left;
+}
+
+tr.light:hover {
+	background-color: #edece6;
+}
+
+tr.dark {
+	background-color: #f6f6f0;
+}
+
+tr.dark:hover {
+	background-color: #edece6;
+}
+
+
+td {
+	padding: 2px 5px;
+	font-size: 12px;
+	vertical-align:top;
+}
+
+td.link {
+	padding: 2px 5px;
+	font-family: sans-serif;
+	font-size: 10px;
+}
+
+div.pre {
+	font-family: monospace;
+	font-size: 12px;
+	white-space: pre;
+	/* padding-left: 5px; */
+}
+
+div.diff_info {
+	font-family: monospace;
+	color: #000099;
+	background-color: #edece6;
+	font-style: italic;
+}
+
+div.index_include {
+	border: solid #d9d8d1;
+	border-width: 0px 0px 1px;
+	padding: 12px 8px;
+}
+
+div.search {
+	margin: 4px 8px;
+	position: absolute;
+	top: 56px;
+	right: 12px
+}
+
+a.linenr {
+	color: #999999;
+	text-decoration: none
+}
+
 a.rss_logo {
-	float:right; padding:3px 0px; width:35px; line-height:10px;
-	border:1px solid; border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e;
-	color:#ffffff; background-color:#ff6600;
-	font-weight:bold; font-family:sans-serif; font-size:10px;
-	text-align:center; text-decoration:none;
+	float: right;
+	padding: 3px 0px;
+	width: 35px;
+	line-height: 10px;
+	border: 1px solid;
+	border-color: #fcc7a5 #7d3302 #3e1a01 #ff954e;
+	color: #ffffff;
+	background-color: #ff6600;
+	font-weight: bold;
+	font-family: sans-serif;
+	font-size: 10px;
+	text-align: center;
+	text-decoration: none;
+}
+
+a.rss_logo:hover {
+	background-color: #ee5500;
 }
-a.rss_logo:hover { background-color:#ee5500; }
+
 span.tag {
-	padding:0px 4px; font-size:10px; font-weight:normal;
-	background-color:#ffffaa; border:1px solid; border-color:#ffffcc #ffee00 #ffee00 #ffffcc;
+	padding: 0px 4px;
+	font-size: 10px;
+	font-weight: normal;
+	background-color: #ffffaa;
+	border: 1px solid;
+	border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
 }
-- 
1.3.0

^ permalink raw reply related

* [PATCH] gitweb: add type="text/css" to stylesheet link
From: Jakub Narebski @ 2006-06-20  4:11 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

---

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

75b6977d185f946fcab8b86011f37869948c1dac
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index fa90c51..c582424 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -39,7 +39,7 @@ # html text to include at home page
 my $home_text =		"indextext.html";
 
 # URI of default stylesheet
-my $stylesheet =	"gitweb.css";
+my $stylesheet = 	"gitweb.css";
 
 # source of projects list
 #my $projects_list =	$projectroot;
@@ -272,7 +272,7 @@ sub git_header_html {
 <head>
 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
 <meta name="robots" content="index, nofollow"/>
-<link rel="stylesheet" href="$stylesheet"/>
+<link rel="stylesheet" type="text/css" href="$stylesheet"/> 
 <title>$title</title>
 $rss_link
 </head>
-- 
1.3.0

^ permalink raw reply related

* Re: [PATCH (fixed)] git-svn: fix --rmdir when using SVN:: libraries
From: Eric Wong @ 2006-06-20  5:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vbqso7him.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
> 
> > Makefile: automatically run new tests as they appear in t/
> >
> > Signed-off-by: Eric Wong <normalperson@yhbt.net>
> > ---
> >
> > Oops, I left out the Makefile change in the other patch,...
> 
> Yeah, I was wondering about that.
> 
> > ... had the new
> > test file as +x
> 
> Shouldn't they be executable?  It is not a big deal, because you
> run them via $(SHELL), though...

Yes, I prefer to use $(SHELL) instead.  Makes it easier to test with
different shells without mucking /bin/sh

-- 
Eric Wong

^ permalink raw reply

* packs and trees
From: Jon Smirl @ 2006-06-20  5:57 UTC (permalink / raw)
  To: git

Converting from CVS would be a lot more efficient if all of revisions
contained in a CVS file were written into git at the same time. So, if
I extract complete revisions from 100 source files into git objects
and then ask git to incremental pack, will git find all of the deltas
and do a good job packing? Some of these files have thousands (50MB)
of deltas. Also, note that I have not written any tree info into git
yet.

After all of the revisions are into git, I will follow up with the
tree info and then repack all. How will the pack end up grouped,
chronologically or will it still be sorted by file? It is not clear to
me how the tree info interacts with the magic packing sauce.

The plan is to modify rcs2git from parsecvs to create all of the git
objects for the tree. It would be called by the cvs2svn code which
would track the object IDs through the changeset generation process.
At the end it will write all of the trees connecting the objects
together.

cvs2svn seems to do a good job at generating the trees. I am not
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.

-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

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

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).

> 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 ;-)

> 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.

cheers,



martin

^ permalink raw reply

* [PATCH 1/2] gitweb: Add filename to page title if set
From: Jakub Narebski @ 2006-06-20  6:17 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski
In-Reply-To: <11507842053885-git-send-email-jnareb@gmail.com>

---

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

a54751bb328072baed5446bdc4076f1e00002737
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 12d5271..1e1a044 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -260,7 +260,10 @@ sub git_header_html {
 	if (defined $project) {
 		$title .= " - $project";
 		if (defined $action) {
+			if (defined $file_name) {
+				$title .= " - $file_name";
+			}
 		}
 	}
 	print $cgi->header(-type=>'text/html',  -charset => 'utf-8', -status=> $status, -expires => $expires);
-- 
1.3.0

^ permalink raw reply related

* [PATCH 0/2] gitweb: Enhance page title
From: Jakub Narebski @ 2006-06-20  6:17 UTC (permalink / raw)
  To: git


This series of patches adds filename (with '/' at the end added for 
trees, i.e. directories) to the page title, for easier bookmarking and 
viewing browser history.

On top of 'next', but should apply cleanly for 'master' too.

^ permalink raw reply

* [PATCH 1/2] gitweb: add '/' to the end of filename in page title for trees
From: Jakub Narebski @ 2006-06-20  6:17 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski
In-Reply-To: <11507842053885-git-send-email-jnareb@gmail.com>

---

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

d17c119d32ae4c5dd50976ea6a255d2bcbe480ed
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 1e1a044..42f3296 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -263,6 +263,9 @@ sub git_header_html {
 			$title .= "/$action";
 			if (defined $file_name) {
 				$title .= " - $file_name";
+				if ($action eq "tree" && $file_name !~ m|/$|) {
+					$title .= "/";
+				}
 			}
 		}
 	}
-- 
1.3.0

^ permalink raw reply related

* [PATCH] Fix: Support for the standard mime.types map in gitweb
From: Jakub Narebski @ 2006-06-20  6:19 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Temporary fix: commented out offending line in mimetype_guess.

---

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

718a3b4c1e56c0330fa2c7ced2e66be5b095b541
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 11cc71f..1b254df 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1524,7 +1524,7 @@ sub mimetype_guess {
 
 	if ($mimetypes_file) {
 		my $file = $mimetypes_file;
-		$file =~ m#^/# or $file = "$projectroot/$path/$file";
+		#$file =~ m#^/# or $file = "$projectroot/$path/$file";
 		$mime = mimetype_guess_file($filename, $file);
 	}
 	$mime ||= mimetype_guess_file($filename, '/etc/mime.types');
-- 
1.3.0

^ permalink raw reply related

* Re: [PATCH 1/2] gitweb: add '/' to the end of filename in page title for trees
From: Jakub Narebski @ 2006-06-20  6:22 UTC (permalink / raw)
  To: git
In-Reply-To: <1150784206793-git-send-email-jnareb@gmail.com>

This should of course be [PATCH 2/2]. I'm sorry for mistake.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* wrong check condition in patch-delta.c?
From: Nguyễn Thái Ngọc Duy @ 2006-06-20  6:32 UTC (permalink / raw)
  To: git

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?

^ permalink raw reply

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

On Tuesday June 20th 2006 Nguy???n Thái Ng???c Duy wrote:

> 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?

It protects against possible overflow. Adding fixed length integers is
"wraparound" after all and discards the "carry" bit.
-- 
Marco Roeland

^ permalink raw reply

* [PATCH] repo-config: Fix late-night bug
From: Johannes Schindelin @ 2006-06-20  7:45 UTC (permalink / raw)
  To: git, junkio


This bug was hidden by the "future-proofing" of the test. Sigh.

When neither GIT_CONFIG nor GIT_CONFIG_LOCAL is set, do not use NULL,
but $GIT_DIR/config. Instead of using $GIT_DIR/config when only
GIT_CONFIG_LOCAL is set. Sorry.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---

	This time, "only" repo-config was affected, _not_ all users of
	the config file.

 repo-config.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/repo-config.c b/repo-config.c
index 03f108f..ab8f1af 100644
--- a/repo-config.c
+++ b/repo-config.c
@@ -74,8 +74,6 @@ static int get_value(const char* key_, c
 		const char *home = getenv("HOME");
 		local = getenv("GIT_CONFIG_LOCAL");
 		if (!local)
-			local = repo_config;
-		else
 			local = repo_config = strdup(git_path("config"));
 		if (home)
 			global = strdup(mkpath("%s/.gitconfig", home));
-- 
1.4.0.g59268-dirty

^ permalink raw reply related

* [PATCH] git_config: access() returns 0 on success, not > 0
From: Johannes Schindelin @ 2006-06-20  7:51 UTC (permalink / raw)
  To: git, junkio


Another late-night bug. Sorry again.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 config.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/config.c b/config.c
index d064f42..3e077d4 100644
--- a/config.c
+++ b/config.c
@@ -335,7 +335,7 @@ int git_config(config_fn_t fn)
 
 	if (home) {
 		char *user_config = strdup(mkpath("%s/.gitconfig", home));
-		if (access(user_config, R_OK) > 0)
+		if (!access(user_config, R_OK))
 			ret = git_config_from_file(fn, user_config);
 		free(user_config);
 	}
-- 
1.4.0.g59268-dirty

^ permalink raw reply related

* Apologies for the 2 late-night bugs
From: Johannes Schindelin @ 2006-06-20  7:54 UTC (permalink / raw)
  To: git

Hi,

with the recent patches to introduce $HOME/.gitconfig, I also introduced 
two bugs. They were not due to lacking of testing, but rather due to 
testing with an accidentally set GIT_CONFIG. And now I *know* why I did 
not want that thing in the first place. And I decided not to become a 
pilot, ever.

Ciao,
Dscho

^ permalink raw reply

* [PATCH/RFC] gitweb: Add title attribute with unshortened value for table cells
From: Jakub Narebski @ 2006-06-20  8:12 UTC (permalink / raw)
  To: git

This allows to see full, unshortened value on mouseover using 'title'
attribute for <td> element. For now it means only author name and
project owner name.

Ugly solution using $cgi->start_td({-title => VALUE})

Doesn't work well with values outside us-ascii, but that might be
considered web browser bug (misfeature), not a bug in gitweb.

---
The idea is to have full value available on mouseover, be it commit title, 
author of the commit, project owner, tag name/title or project description.
For now only author name and project owner name are implemented, and
implementation is ugly and results is not perfect.


 gitweb/gitweb.cgi |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

b72280ac4649d54375732de771f7d92c7d350258
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 1b254df..9a09b20 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -887,7 +887,7 @@ sub git_project_list {
 		$alternate ^= 1;
 		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";
+		      $cgi->start_td({-title => $pr->{'owner'}}) . 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>";
@@ -1057,7 +1057,7 @@ sub git_summary {
 				$ref = " <span class=\"tag\">" . esc_html($refs->{$commit}) . "</span>";
 			}
 			print "<td><i>$co{'age_string'}</i></td>\n" .
-			      "<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
+			      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
 			      "<td>";
 			if (length($co{'title_short'}) < length($co{'title'})) {
 				print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
@@ -2306,7 +2306,7 @@ sub git_history {
 			}
 			$alternate ^= 1;
 			print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
-			      "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
+			      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
 			      "<td>" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list"}, "<b>" .
 			      esc_html(chop_str($co{'title'}, 50)) . "$ref</b>") . "</td>\n" .
 			      "<td class=\"link\">" .
@@ -2396,7 +2396,7 @@ sub git_search {
 			}
 			$alternate ^= 1;
 			print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
-			      "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
+			      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
 			      "<td>" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$co{'id'}"), -class => "list"}, "<b>" . esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
 			my $comment = $co{'comment'};
@@ -2449,7 +2449,7 @@ sub git_search {
 					}
 					$alternate ^= 1;
 					print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
-					      "<td><i>" . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
+					      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 15, 5)) . "</i></td>\n" .
 					      "<td>" .
 					      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$co{'id'}"), -class => "list"}, "<b>" .
 					      esc_html(chop_str($co{'title'}, 50)) . "</b><br/>");
@@ -2537,7 +2537,7 @@ sub git_shortlog {
 		}
 		$alternate ^= 1;
 		print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
-		      "<td><i>" . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
+		      $cgi->start_td({-title => $co{'author_name'}}) . esc_html(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
 		      "<td>";
 		if (length($co{'title_short'}) < length($co{'title'})) {
 			print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit"), -class => "list", -title => "$co{'title'}"},
-- 
1.3.0

^ permalink raw reply related

* Re: [PATCH] Fix git to be (more) ANSI C99 compliant.
From: Rene Scharfe @ 2006-06-20  8:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Florian Forster, git, Linus Torvalds
In-Reply-To: <7vac8860z9.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano schrieb:
> BTW, I think we would probably want to have this patch on top of
> Rene's patch.  In all instances, the variable "buf" is of type
> "const char *" and the existing casts do not make sense to me.
> 
> 
> diff --git a/builtin-tar-tree.c b/builtin-tar-tree.c
> index 5c8a5f0..39a61b6 100644

Your patch reverts builtin-tar-tree.c to the version which is
currently both in master and next, which I think is a good
change.  However, could it be avoided at merge time?

OT: I found the blobs 5c8a5f0 and 39a61b6 by guessing (they are
builtin-tar-tree.c in pu and master, respectively).  OK, that
was easy.  But is there a way to reversely look up an object
without guessing, i.e. find out which commit(s) introduced a
certain blob?

Thanks,
René

^ 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