Git development
 help / color / mirror / Atom feed
* Re: [PATCH] Fix t4114 on cygwin
From: Junio C Hamano @ 2006-07-24  6:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0607181946090.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Thanks.

^ permalink raw reply

* Re: [PATCH] cvsexportcommit - add -a (add author line) flag, cleanup warnings
From: Junio C Hamano @ 2006-07-24  6:41 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: git
In-Reply-To: <11531893692075-git-send-email-martin@catalyst.net.nz>

Thanks.

^ permalink raw reply

* Re: [PATCH] Trivial path optimization test
From: Junio C Hamano @ 2006-07-24  6:41 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git, Linus Torvalds
In-Reply-To: <20060717223432.GA25522@steel.home>

Clean up the commit log pretty please.

^ permalink raw reply

* Re: [PATCH] Allow an alias to start with "-p"
From: Junio C Hamano @ 2006-07-24  6:32 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, junkio
In-Reply-To: <Pine.LNX.4.63.0607190125150.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Now, something like
>
> 	[alias]
> 		pd = -p diff
>
> works as expected.

I like what it wants to do but I am afraid this leads to an
unmaintainable code (a micronit that already shows what I mean
is that you can say "git --paginate diff", but you cannot say
"pd = --paginate diff" in the configuration file).

Is there a cleaner way to do it without duplicating the argument
loop of git.c::main()?

^ permalink raw reply

* Re: [PATCH] upload-pack: fix timeout in create_pack_file
From: Junio C Hamano @ 2006-07-24  6:23 UTC (permalink / raw)
  To: Matthias Lederhofer; +Cc: git
In-Reply-To: <E1G2t9n-0005PW-72@moooo.ath.cx>

Matthias Lederhofer <matled@gmx.net> writes:

> Signed-off-by: Matthias Lederhofer <matled@gmx.net>
> ---
> <yacc> fatal: packfile '../linux-2.6/.git/objects/pack/tmp-7iPJo5'
>        SHA1 mismatch
> <yacc> error: git-fetch-pack: unable to read from git-index-pack
> <yacc> error: git-index-pack died with error code 128
> <yacc> Any idea what this means?
> This happens after ~12 minutes.  The problem is that the loop in
> upload-pack.c actually sending the pack does not reset the timeout.
> I'd guess --timeout is 600 or a bit more on git.kernel.org :)
>
> This does not help for low timeouts with slow clients.  If a client is
> slow enough so the server is blocked for more time than specified by
> timeout the connection will be closed too (e.g. 15kb/s with a timeout
> of 30 (git adds 10 extra) is not enough).

Where do we add 10 extra?

> We should either add a
> warning to the man page or try to fix this.  I don't know if this can
> be fixed not using non-blocking sockets.

I think the intent of "timeout" was to protect us from funny
clients by avoiding talking with the ones that take too much
time doing something that should not take too long.  When we are
in create_pack_file(), we are already committed to the heaviest
operation anyway, so one possibility might be to stop doing
timeout at that point.  I am not sure if that is acceptable,
though -- it opens up the daemon to even easier DoS than it
currently is.

My gut feeling is that your patch would be fine as is (have you
tried and confirmed that it helps cases other than slow
clients?)

> Perhaps support for resume would be quite useful too but I've no idea
> how hard this is to implement.

That would be _very_ hard.

^ permalink raw reply

* Re: print errors from git-update-ref
From: Junio C Hamano @ 2006-07-24  6:06 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Git Mailing List
In-Reply-To: <81b0412b0607180613t603551b8t865b407c40ab8aef@mail.gmail.com>

"Alex Riesen" <raa.lkml@gmail.com> writes:

> ...otherwise it not clear what happened when update-ref fails.
>
> E.g., git checkout -b a/b/c HEAD would print nothing if refs/heads/a
> exists and is a directory (it does return 1, so scripts checking for
> return code should be ok).
>
> I'm attaching two patches, because I'm not quite sure where it should
> be done: git-checkout is the least intrusive, but only builtin-update-ref.c
> has enough info to help user to resolve the problem (errno is ENOTDIR,
> which is selfexplanatory). And I happen to use git-update-ref directly
> sometimes.

My gut feeling is that complaining from update-ref is fine, but
I am still tired after a long week and not thinking straight, so
I will not be applying this tonight.

git-applypatch, git-am, and git-branch would be helped by
update-ref complaining.

Porcelains?

BTW, I wonder what happens when .git/logs/refs/a is a directory
(by mistake or malice), .git/refs/a does not exist, and the user
does "git checkout -b a/b/c HEAD".  Or when .git/logs/refs/a/b/c
does exist but is not writable.  My preference is just warn but
do not interrupt the primary operation, since ref-log is just an
optional part of the system, but that would probably lead to
confusion, so we might be better off erroring the caller out in
such a case.  Opinions?

git-resolve does not check exit value from update-ref, which is
*BAD*, but we should be deprecating it anyway.

git-reset has the same problem of not checking the exit status
from update ref.  Worse yet, it calls update-ref with wrong
parameter ($@ in its parameter should be $*).

Patches to fix these two and half problems should be trivial but
I won't be doing that myself tonight.

^ permalink raw reply

* Re: [PATCH 1/2] add git-quote: shell and C quoting tool
From: Junio C Hamano @ 2006-07-24  5:49 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git
In-Reply-To: <20060716222757.GA10135@steel.home>

fork0@t-online.de (Alex Riesen) writes:

> In case anyone asks why isn't it a standalone tool nor is it put into
> git-stripspace: I don't know. Maybe it should be.

This organization is fine by me.

 * unquote?
 * doc?

> +enum {SHELL_QUOTE, C_QUOTE};
> +static int style = SHELL_QUOTE,
> +	   use_stdin = 0;

Shouldn't style be of type which is that unnamed enum?

> +static const char *separator = NULL; /* default is space */
> +static unsigned sep_len = 0;

It is not clear if this is separator of input side or output
side (after reading the code it becomes somewhat obvious that
you are talking about output separator), and if the default is
space wouldn't it make more sense to set that here?

> +static const char builtin_quote_usage[] =
> +"git-quote [--c] [--sep=<c-quoted> | -z] ( [--stdin] | [--] ... )";
> +
> +static void print_quoted(const char *text)
> +{
> +	switch (style)
> +	{
> +	case SHELL_QUOTE:
> +		sq_quote_print(stdout, text);
> +		break;
> +	case C_QUOTE:
> +		quote_c_style(text, NULL, stdout, 0);
> +		break;
> +	}

Not a big deal but aren't these going to write out things quoted
when they do not need to?  To help scripts, it might be worth
adding "check if this needs quoting" interface perhaps?

> +int cmd_quote(int argc, const char **argv, char **envp)
> +{
> +	int i;
> +	for (i = 1; i < argc; i++) {
> +		const char *arg = argv[i];
> +
> +		if (arg[0] != '-')
> +			break;
> +		if (!strcmp(arg, "--")) {
> +			i++;
> +			break;
> +		}
> +		if (!strcmp(arg, "--stdin")) {
> +			use_stdin = 1;
> +			if ( !separator ) {
> +				separator = "\n";
> +				sep_len = 1;
> +			}
> +			break;
> +		}
> +		if (!strcmp(arg, "--c")) {

Perhaps "--c-style" with "-c" as a shorthand, (and
"--shell-style" with "-s" to complement)?

> +			style = C_QUOTE;
> +			continue;
> +		}
> +		if (!strcmp(arg, "-z")) {
> +			separator = "";
> +			sep_len = 1;
> +			continue;
> +		}

Is it plausible that somebody might want to feed you NUL
terminated sequence as input (iow you might want to give them
choice of separator on the input side)?

> +		if (!strncmp(arg, "--sep=", 6)) {

Perhaps "--separator" (or "--output-separator") with whatever
shorthand is handy?

> +			const char *end;
> +			char *tmp;
> +			arg += 6;
> +			if ('"' == *arg)
> +				tmp = strdup(arg);
> +			else {
> +				size_t l = strlen(arg);
> +				tmp = malloc(l + 3);
> +				sprintf(tmp, "\"%s\"", arg);
> +			}
> +			separator = unquote_c_style(tmp, &end);
> +			sep_len = strlen(separator);

If the parameter is a malformed c-quoted string, you would dump
core here.

> +			/* this will leak if multiple --sep= given */
> +			continue;
> +		}
> +		die(builtin_quote_usage);
> +	}
> +	if (!separator) {
> +		sep_len = 1;
> +		separator = "\x20";

Any reason you needed to spell it in hex?  Is this trying to
be portable to EBCDIC (or trying to prevent the code to be
ported there)?  I dunno.

> +	}
> +	if (use_stdin) {
> +		size_t size = BUFSIZ;
> +		char *buf = xmalloc(size);
> +		int ch, pos = 0;
> +		while (EOF != (ch = fgetc(stdin))) {
> +			if (pos == size)
> +				buf = xrealloc(buf, size <<= 1);
> +			buf[pos++] = ch;
> +			if ('\n' == ch) {
> +				buf[--pos] = '\0';
> +				pos = 0;
> +				print_quoted(buf);
> +			}
> +		}

Looks similar to strbuf.c::read_line() loop...

^ permalink raw reply

* Re: Makefile checks for DarwinPorts / Fink
From: Shawn Pearce @ 2006-07-24  4:28 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <e9vrsf$foc$1@sea.gmane.org>

Jakub Narebski <jnareb@gmail.com> wrote:
> Could you _please_ document this option in commentary part in main
> Makefile?

OK.

I left them out originally as it seemed like other platform specific
items weren't in the main commentary part, but since these are
new defines I guess it makes perfect sense that they should be
documented before they get included into the main Makefile.  :-)

Hopefully this is the final version of this patch...

-->8--
Disable linking with Fink or DarwinPorts.

It may be desirable for the compiler to disable linking against Fink
or DarwinPorts, especially if both are installed on the system and
the user wants GIT to be linked specifically to only one of them.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 Makefile |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index a1666e2..5432636 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,18 @@ # Define NO_SVN_TESTS if you want to ski
 # tests.  These tests take up a significant amount of the total test time
 # but are not needed unless you plan to talk to SVN repos.
 #
+# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
+# installed in /sw, but don't want GIT to link against any libraries
+# installed there.  If defined you may specify your own (or Fink's)
+# include directories and library directories by defining CFLAGS
+# and LDFLAGS appropriately.
+#
+# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
+# have DarwinPorts installed in /opt/local, but don't want GIT to
+# link against any libraries installed there.  If defined you may
+# specify your own (or DarwinPort's) include directories and
+# library directories by defining CFLAGS and LDFLAGS appropriately.
+#
 # Define PPC_SHA1 environment variable when running make to make use of
 # a bundled SHA1 routine optimized for PowerPC.
 #
@@ -267,15 +279,17 @@ ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
 	NO_STRLCPY = YesPlease
-	## fink
-	ifeq ($(shell test -d /sw/lib && echo y),y)
-		BASIC_CFLAGS += -I/sw/include
-		BASIC_LDFLAGS += -L/sw/lib
+	ifndef NO_FINK
+		ifeq ($(shell test -d /sw/lib && echo y),y)
+			BASIC_CFLAGS += -I/sw/include
+			BASIC_LDFLAGS += -L/sw/lib
+		endif
 	endif
-	## darwinports
-	ifeq ($(shell test -d /opt/local/lib && echo y),y)
-		BASIC_CFLAGS += -I/opt/local/include
-		BASIC_LDFLAGS += -L/opt/local/lib
+	ifndef NO_DARWIN_PORTS
+		ifeq ($(shell test -d /opt/local/lib && echo y),y)
+			BASIC_CFLAGS += -I/opt/local/include
+			BASIC_LDFLAGS += -L/opt/local/lib
+		endif
 	endif
 endif
 ifeq ($(uname_S),SunOS)
-- 
1.4.2.rc1.ge711

^ permalink raw reply related

* Better Future, wet nurse
From: Erick Daniels @ 2006-07-24  3:35 UTC (permalink / raw)
  To: git

Your cre dit doesn't matter to us! If you OWN real est ate
and want IMMEDIATEZ cash to spend ANY way you like, or simply wish 
to LOWER your monthly paym ents by a third or more, here are the dea ls
we have TODAY (hurry, these ofers will expre TONIGHT):

$488,000.00 at a 3.67,% fixed-rate0
$372,000.00 at a 3.90,% variable-rateG
$492,000.00 at a 3.21,% interest-onlyZ
$248,000.00 at a 3.36,% fixed-rateZ
$198,000.00 at a 3.55,% variable-rateS

Hurry, when these deals are gone, they are gone Simply fill out this one-min ute form... 

Don't worry about approval, your cre dit will not disqualify you! 

http://2I2BXYKB.fortessed.com



sip, shut his  eyes, and handed the  flask  to Arthur. That's it, he thought
because of him. Now that my head is clear, I know why. It was right to  save

workers showed up here for  the moulage. There were two lab assistants, both
gummed his mouth, making it  hard to breathe. Gulping for  air, Redrick tore
engineer he had drowned in vitriol that day.

hill except the intense sunlight, but on the right slope, in the shade, pale
     "Phoo-oo-ey." He shook his head, scattering dirty drops of water.
swamp  to  the right of  the embankment  reeked of  decay. The  fog made  it
of the )i. The name was sort of familiar, but who Whip was exactly, and what

but  confidence in a miracle --filled him to the brim,  and he was amazed at
you lift the bag  with rocks and guide it over the ground, it was all  clear

^ permalink raw reply

* Re: Git BOF notes
From: Johannes Schindelin @ 2006-07-23 22:53 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git
In-Reply-To: <20060722191652.GR13776@pasky.or.cz>

Hi,

On Sat, 22 Jul 2006, Petr Baudis wrote:

> Dear diary, on Sat, Jul 22, 2006 at 05:55:59AM CEST, I got a letter
> where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> > On Sat, 22 Jul 2006, Petr Baudis wrote:
> > > Dear diary, on Sat, Jul 22, 2006 at 02:17:48AM CEST, I got a letter
> > > where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> > > > And also think "setup a remote repository", especially "setup a remote
> > > > HTTP repository".
> > > 
> > >   Of course. Currently you need to tinker with environment variables,
> > > then with hooks, possibly with permissions and stuff to make the
> > > repository shared... Think cg-admin-setuprepo. ;-)
> > 
> > git-init-db --shared
> 
> And the environment variable and the chgrp and g+s. That's my point.

I do not have the itch. But of course, it would be trivial to do that as 
command line options.

> > And sometimes, I do "cp -R /some/where/CVS ./; git-cvsimport".
> 
> git-cvsimport will create the repository for you, won't it?

It could, if I'd let it ;-)

> > >   Of course sometimes you don't want to add everything, and that should
> > > still be possible to do (cg-init has a switch for that).
> > 
> > Usually I start small projects as a single .c or .java file. Only after a 
> > while, I think it is worth it to init a git database. So, I _always_ have 
> > generated files lying around. And I would hate it if they were checked in 
> > automatically. (Yeah, I could remove them, _then_ remove them from the 
> > index, and then git-commit --amend. Ugly.)
> 
> Can't you just do make clean before git init? Or you can prepare 
> .gitignore before you check stuff in, so that the autogenerated files 
> don't pollute your git status output. ;-)

Yes, I can. I also can type in several sheets of hex data. But I don't 
want to. Like Timo, I am very happy to tell the computer what to do, not 
to let it take guesses.

Ciao,
Dscho

^ permalink raw reply

* Re: [RFC] Colorize 'commit' lines in log ui
From: Jeff King @ 2006-07-23 22:01 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: git, Junio C Hamano
In-Reply-To: <20060723112422.GB27825@lug-owl.de>

On Sun, Jul 23, 2006 at 01:24:22PM +0200, Jan-Benedict Glaw wrote:

> If people only were used to *always* place a comma behind the last
> array element, the diff would be shorter by one line each time...

I agree that it's much more convenient; I left it off because it wasn't
there before and I thought there were some standardization issues.

As it turns out, the situation is quite ridiculous. C89 allowed trailing
commas in initialization lists but not in enums. Most compilers (gcc,
sun) accepted it anyway, but some (aix xlc) did not.

Do we care? I think probably not, since the color_diff enum already had
a trailing comma. It seems like the primary non-gcc compiler that has
been mentioned is sun cc. I don't know what other compilers are being
used to compile git.

-Peff

^ permalink raw reply

* Hey, buddy, you must be very disappointed of it!
From: Echols @ 2006-07-23 20:50 UTC (permalink / raw)
  To: glenn

Hello bro, Leave complaining to others. You deserve to get rid of this. The great thing about Extra-Time is that it works, making you last longer from the very first time. It starts great but you feel like finishing within very first minutes? This is a common thing. Enter here:  http://florexx.com/gall/get/ Confidence and affection of your partner are the greatest things you get.

^ permalink raw reply

* [PATCH] support cover letter before commit log, using "+++"
From: Martin Waitz @ 2006-07-23 21:45 UTC (permalink / raw)
  To: git

We already have a "---" separator to end the commit log.
But writing the cover letter after this separator looks strange.
Now it is possible to put the cover letter and comments both before
or after the commit log, as the author sees fit.

Just put the commit log between lines starting with "+++" and "---".

Signed-off-by: Martin Waitz <tali@admingilde.org>
---
 builtin-mailinfo.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index ac53f76..a1cfc81 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -690,6 +690,13 @@ static int handle_commit_msg(int *seen)
 			return 1;
 		}
 
+		/* check for separator between cover-letter and commit log */
+		if (!memcmp("+++", line, 3)) {
+			rewind(cmitmsg);
+			ftruncate(fileno(cmitmsg), 0);
+			continue;
+		}
+
 		/* Unwrap transfer encoding and optionally
 		 * normalize the log message to UTF-8.
 		 */
-- 
1.4.1.gd3582

-- 
Martin Waitz

^ permalink raw reply related

* [PATCH] gitweb.cgi: git_blame2: slight optimization reading the blame lines
From: Luben Tuikov @ 2006-07-23 21:17 UTC (permalink / raw)
  To: git

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

Eliminate git_read_blame_line() -- move that code inline and
optimize it.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.cgi |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 2795696785-p1.patch --]
[-- Type: text/inline; name="p1.patch", Size: 1010 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 16340f2..7fbfc0d 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1252,15 +1252,6 @@ sub git_tag {
 	git_footer_html();
 }
 
-sub git_read_blame_line {
-	my %bl;
-	$_ = shift;
-
-	($bl{'hash'}, $bl{'lineno'}, $bl{'data'}) = /^([0-9a-fA-F]{40}).*?(\d+)\)\s{1}(\s*.*)/;
-
-	return %bl;
-}
-
 sub git_blame2 {
 	my $fd;
 	my $ftype;
@@ -1302,13 +1293,12 @@ sub git_blame2 {
 	print "<div class=\"page_body\">\n";
 	print "<table class=\"blame\">\n";
 	print "<tr><th>Commit</th><th>Line</th><th>Data</th></tr>\n";
-	while (my $line = <$fd>) {
-		my %blame_line = git_read_blame_line($line);
-		my $full_rev = $blame_line{'hash'};
+	while (<$fd>) {
+		/^([0-9a-fA-F]{40}).*?(\d+)\)\s{1}(\s*.*)/;
+		my $full_rev = $1;
 		my $rev = substr($full_rev, 0, 8);
-		my $lineno = $blame_line{'lineno'};
-		my $data = $blame_line{'data'};
+		my $lineno = $2;
+		my $data = $3;
 
 		if (!defined $last_rev) {
 			$last_rev = $full_rev;
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 3/3] gitweb.cgi: git_blame2: Revision blocks now have alternating colors
From: Luben Tuikov @ 2006-07-23 20:37 UTC (permalink / raw)
  To: git

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

A revision block is the largest number of adjacent
lines of code originating from the same revision.

This patch adds color to git_blame2(), in that no two
adjacent revision blocks have the same color.  The color
alternates between light and dark.

As we annotate the code lines, we alternate the color
(light, dark) of code lines _per revision_.  This makes it
easier to see line conglomerations per revision.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.cgi |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 963471848-p3.patch --]
[-- Type: text/inline; name="p3.patch", Size: 1471 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 2c2d9c8..16340f2 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1295,9 +1295,11 @@ sub git_blame2 {
 		$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) .
 		"</div>\n";
 	git_print_page_path($file_name, $ftype);
-
+	my @rev_color = (qw(light dark));
+	my $num_colors = scalar(@rev_color);
+	my $current_color = 0;
+	my $last_rev;
 	print "<div class=\"page_body\">\n";
-
 	print "<table class=\"blame\">\n";
 	print "<tr><th>Commit</th><th>Line</th><th>Data</th></tr>\n";
 	while (my $line = <$fd>) {
@@ -1307,7 +1309,13 @@ sub git_blame2 {
 		my $lineno = $blame_line{'lineno'};
 		my $data = $blame_line{'data'};
 
-		print "<tr>\n";
+		if (!defined $last_rev) {
+			$last_rev = $full_rev;
+		} elsif ($last_rev ne $full_rev) {
+			$last_rev = $full_rev;
+			$current_color = ++$current_color % $num_colors;
+		}
+		print "<tr class=\"$rev_color[$current_color]\">\n";
 		print "<td class=\"sha1\">" .
 			$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$full_rev;f=$file_name")}, esc_html($rev)) . "</td>\n";
 		print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" . esc_html($lineno) . "</a></td>\n";
@@ -1316,8 +1324,6 @@ sub git_blame2 {
 	}
 	print "</table>\n";
 	print "</div>";
-
 	close $fd or print "Reading blob failed\n";
 	git_footer_html();
 }
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 2/3] gitweb.cgi: git_blame2: Allow back-trekking through commits
From: Luben Tuikov @ 2006-07-23 20:36 UTC (permalink / raw)
  To: git

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

This patch adds the capability of back-trekking through
commits from git_blame2() as follows:
blame2->commit->blame2->commit->blame2->...->initial commit.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 3952834181-p2.patch --]
[-- Type: text/inline; name="p2.patch", Size: 896 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 57f4a2e..2c2d9c8 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -2022,8 +2022,13 @@ sub git_commit {
 		print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash")}, "commitdiff");
 	}
 	print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") . "\n" .
-	      "<br/><br/></div>\n";
+		"<br/>\n";
+	if (defined $file_name && defined $co{'parent'}) {
+		my $parent = $co{'parent'};
+		print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;hb=$parent;f=$file_name")}, "blame") . "\n";
+	}
+	print "<br/></div>\n";
+
 	if (defined $co{'parent'}) {
 		print "<div>\n" .
 		      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash"), -class => "title"}, esc_html($co{'title'}) . $ref) . "\n" .
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 1/3] gitweb.cgi: git_blame2: an alternative simple working git blame
From: Luben Tuikov @ 2006-07-23 20:34 UTC (permalink / raw)
  To: git

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

This patch adds an alternative simple working git-blame
called git_blame2().  Simple, because it displays just
three columns: the commit, the line number and the line
of code.  Alternative, because the original git_blame()
is left untouched.  Lines of code are printed html
escaped, but as-is.

git_blame2() uses git-blame as opposed to git-annotate
used by git_blame().

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 2795696785-p1.patch --]
[-- Type: text/inline; name="p1.patch", Size: 3420 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 4106cb8..57f4a2e 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -227,7 +227,7 @@ if (!defined $action || $action eq "summ
 	git_tag();
 	exit;
 } elsif ($action eq "blame") {
-	git_blame();
+	git_blame2();
 	exit;
 } else {
 	undef $action;
@@ -1252,7 +1252,75 @@ sub git_tag {
 	git_footer_html();
 }
 
+sub git_read_blame_line {
+	my %bl;
+	$_ = shift;
+
+	($bl{'hash'}, $bl{'lineno'}, $bl{'data'}) = /^([0-9a-fA-F]{40}).*?(\d+)\)\s{1}(\s*.*)/;
+
+	return %bl;
+}
+
+sub git_blame2 {
+	my $fd;
+	my $ftype;
+	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);
+	my %co = git_read_commit($hash_base)
+		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 looking up file");
+	}
+	$ftype = git_get_type($hash);
+	if ($ftype !~ "blob") {
+		die_error("400 Bad Request", "object is not a blob");
+	}
+	open ($fd, "-|", $GIT, "blame", '-l', $file_name, $hash_base)
+		or die_error(undef, "Open failed");
+	git_header_html();
+	print "<div class=\"page_nav\">\n" .
+		$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, "summary") .
+		" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog")}, "shortlog") .
+		" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log")}, "log") .
+		" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base")}, "commit") .
+		" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash_base")}, "commitdiff") .
+		" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash_base")}, "tree") . "<br/>\n";
+	print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") .
+		" | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;f=$file_name")}, "head") . "<br/>\n";
+	print "</div>\n".
+		"<div>" .
+		$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) .
+		"</div>\n";
+	git_print_page_path($file_name, $ftype);
+
+	print "<div class=\"page_body\">\n";
+
+	print "<table class=\"blame\">\n";
+	print "<tr><th>Commit</th><th>Line</th><th>Data</th></tr>\n";
+	while (my $line = <$fd>) {
+		my %blame_line = git_read_blame_line($line);
+		my $full_rev = $blame_line{'hash'};
+		my $rev = substr($full_rev, 0, 8);
+		my $lineno = $blame_line{'lineno'};
+		my $data = $blame_line{'data'};
+
+		print "<tr>\n";
+		print "<td class=\"sha1\">" .
+			$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$full_rev;f=$file_name")}, esc_html($rev)) . "</td>\n";
+		print "<td class=\"linenr\"><a id=\"l$lineno\" href=\"#l$lineno\" class=\"linenr\">" . esc_html($lineno) . "</a></td>\n";
+		print "<td class=\"pre\">" . esc_html($data) . "</td>\n";
+		print "</tr>\n";
+	}
+	print "</table>\n";
+	print "</div>";
+
+	close $fd or print "Reading blob failed\n";
+	git_footer_html();
+}
+
 sub git_blame {
 	my $fd;
 	die_error('403 Permission denied', "Permission denied.") if (!git_get_project_config_bool ('blame'));
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 4/4] gitweb.cgi: Centralize printing of the page path
From: Luben Tuikov @ 2006-07-23 20:31 UTC (permalink / raw)
  To: git

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

Centralize printing of the page path so that
if the entity is a blob, we can set the page path
to be the link to the HEAD revision of the
"raw" blob.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.cgi |   41 +++++++++++++++++++++--------------------
 1 files changed, 21 insertions(+), 20 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 2013183029-p4.patch --]
[-- Type: text/inline; name="p4.patch", Size: 3349 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index c04283b..4106cb8 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1199,6 +1199,20 @@ sub git_summary {
 	git_footer_html();
 }
 
+sub git_print_page_path {
+	my $name = shift;
+	my $type = shift;
+
+	if (!defined $name) {
+		print "<div class=\"page_path\"><b>/</b></div>\n";
+	} elsif ($type =~ "blob") {
+		print "<div class=\"page_path\"><b>" .
+			$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;f=$file_name")}, esc_html($name)) . "</b><br/></div>\n";
+	} else {
+		print "<div class=\"page_path\"><b>" . esc_html($name) . "</b><br/></div>\n";
+	}
+}
+
 sub git_tag {
 	my $head = git_read_head($project);
 	git_header_html();
@@ -1266,7 +1280,7 @@ sub git_blame {
 		"<div>" .
 		$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) .
 		"</div>\n";
-	print "<div class=\"page_path\"><b>" . esc_html($file_name) . "</b></div>\n";
+	git_print_page_path($file_name);
 	print "<div class=\"page_body\">\n";
 	print <<HTML;
 <table class="blame">
@@ -1604,9 +1618,7 @@ sub git_blob {
 		      "<br/><br/></div>\n" .
 		      "<div class=\"title\">$hash</div>\n";
 	}
-	if (defined $file_name) {
-		print "<div class=\"page_path\"><b>" . esc_html($file_name) . "</b></div>\n";
-	}
+	git_print_page_path($file_name, "blob");
 	print "<div class=\"page_body\">\n";
 	my $nr;
 	while (my $line = <$fd>) {
@@ -1671,10 +1683,8 @@ sub git_tree {
 	}
 	if (defined $file_name) {
 		$base = esc_html("$file_name/");
-		print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b></div>\n";
-	} else {
-		print "<div class=\"page_path\"><b>/</b></div>\n";
 	}
+	git_print_page_path($file_name);
 	print "<div class=\"page_body\">\n";
 	print "<table cellspacing=\"0\">\n";
 	my $alternate = 0;
@@ -2132,9 +2142,7 @@ sub git_blobdiff {
 		      "<br/><br/></div>\n" .
 		      "<div class=\"title\">$hash vs $hash_parent</div>\n";
 	}
-	if (defined $file_name) {
-		print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b></div>\n";
-	}
+	git_print_page_path($file_name, "blob");
 	print "<div class=\"page_body\">\n" .
 	      "<div class=\"diff_info\">blob:" .
 	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash_parent;hb=$hash_base;f=$file_name")}, $hash_parent) .
@@ -2308,6 +2316,7 @@ sub git_history {
 	if (!defined $hash_base) {
 		$hash_base = git_read_head($project);
 	}
+	my $ftype;
 	my %co = git_read_commit($hash_base);
 	if (!%co) {
 		die_error(undef, "Unknown commit object.");
@@ -2330,18 +2339,9 @@ sub git_history {
 		$hash = git_get_hash_by_path($hash_base, $file_name);
 	}
 	if (defined $hash) {
-		my $ftype = git_get_type($hash);
-
-		if ($ftype =~ "blob") {
-		    print "<div class=\"page_path\"><b>/" .
-			$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;f=$file_name")}, esc_html($file_name)) . "</b><br/></div>\n";
-		} else {
-		    print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
-		}
-	} else {
-		print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
+		$ftype = git_get_type($hash);
 	}
+	git_print_page_path($file_name, $ftype);
 
 	open my $fd, "-|",
 		"$GIT rev-list --full-history $hash_base -- \'$file_name\'";
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 3/4] gitweb.cgi: Show "raw" head of project link even when $hash is not defined
From: Luben Tuikov @ 2006-07-23 20:30 UTC (permalink / raw)
  To: git

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

Some callers of git_history() do not set $hash of $file_name.
Add code to find it, if it is not defined.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 963471848-p3.patch --]
[-- Type: text/inline; name="p3.patch", Size: 537 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 7a61de4..c04283b 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -2326,7 +2326,9 @@ sub git_history {
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
 	      "</div>\n";
+	if (!defined $hash && defined $file_name) {
+		$hash = git_get_hash_by_path($hash_base, $file_name);
+	}
 	if (defined $hash) {
 		my $ftype = git_get_type($hash);
 
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 2/4] gitweb.cgi: Include direct link to "raw" files from "history"
From: Luben Tuikov @ 2006-07-23 20:28 UTC (permalink / raw)
  To: git

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

In "history" view, the "page_path" is now also a URL link to
the "raw" format of the file, which will always give you
the latest version in the repository.

This is helpful for externally linking files, such that
the latest version is always referenced and in "raw" format.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 3952834181-p2.patch --]
[-- Type: text/inline; name="p2.patch", Size: 3229 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index d976d4a..7a61de4 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1531,6 +1531,14 @@ sub git_blob_plain_mimetype {
 }
 
 sub git_blob_plain {
+	if (!defined $hash) {
+                if (defined $file_name) {
+                        my $base = $hash_base || git_read_head($project);
+                        $hash = git_get_hash_by_path($base, $file_name, "blob") || die_error(undef, "Error lookup file.");
+                } else {
+                        die_error(undef, "No file name defined.");
+                }
+        }
 	my $type = shift;
 	open my $fd, "-|", "$GIT cat-file blob $hash" or die_error("Couldn't cat $file_name, $hash");
 
@@ -1554,10 +1562,14 @@ sub git_blob_plain {
 }
 
 sub git_blob {
-	if (!defined $hash && defined $file_name) {
-		my $base = $hash_base || git_read_head($project);
-		$hash = git_get_hash_by_path($base, $file_name, "blob") || die_error(undef, "Error lookup file.");
-	}
+	if (!defined $hash) {
+                if (defined $file_name) {
+                        my $base = $hash_base || git_read_head($project);
+                        $hash = git_get_hash_by_path($base, $file_name, "blob") || die_error(undef, "Error lookup file.");
+                } else {
+                        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, "Open failed.");
 	my $mimetype = git_blob_plain_mimetype($fd, $file_name);
@@ -1687,7 +1699,7 @@ sub git_tree {
 			      "<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;hb=$hash_base;f=$base$t_name")}, "history") .
+			      " | " . $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") {
@@ -2314,8 +2326,18 @@ sub git_history {
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
 	      "</div>\n";
-	print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
+	if (defined $hash) {
+		my $ftype = git_get_type($hash);
+
+		if ($ftype =~ "blob") {
+		    print "<div class=\"page_path\"><b>/" .
+			$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;f=$file_name")}, esc_html($file_name)) . "</b><br/></div>\n";
+		} else {
+		    print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
+		}
+	} else {
+		print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
+	}
 
 	open my $fd, "-|",
 		"$GIT rev-list --full-history $hash_base -- \'$file_name\'";
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH 1/4] gitweb.cgi: Teach git_history() to read hash from $hash_base
From: Luben Tuikov @ 2006-07-23 20:26 UTC (permalink / raw)
  To: git

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

Teach git_history() to take its hash argument from
the hb parameter, i.e. from $hash_base.  Also change
all "a=history" actions to pass "hb=" instead of "h=".

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 2795696785-p1.patch --]
[-- Type: text/inline; name="p1.patch", Size: 5250 bytes --]

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 2fd1e5f..d976d4a 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1687,7 +1687,7 @@ sub git_tree {
 			      "<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=$hash_base;f=$base$t_name")}, "history") .
+			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;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") {
@@ -1696,7 +1696,7 @@ #			      " | " . $cgi->a({-href => "$my
 			      "</td>\n" .
 			      "<td class=\"link\">" .
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$t_hash$base_key;f=$base$t_name")}, "tree") .
-			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$hash_base;f=$base$t_name")}, "history") .
+			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$hash_base;f=$base$t_name")}, "history") .
 			      "</td>\n";
 		}
 		print "</tr>\n";
@@ -2041,7 +2041,7 @@ sub git_commit {
 			      "<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") .
+			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$hash;f=$file")}, "history") .
 			      "</td>\n"
 		} elsif ($status eq "M" || $status eq "T") {
 			my $mode_chnge = "";
@@ -2072,7 +2072,7 @@ sub git_commit {
 			if ($to_id ne $from_id) {
 				print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$file")}, "diff");
 			}
-			print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;h=$hash;f=$file")}, "history") . "\n";
+			print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$hash;f=$file")}, "history") . "\n";
 			print "</td>\n";
 		} elsif ($status eq "R") {
 			my ($from_file, $to_file) = split "\t", $file;
@@ -2293,10 +2293,10 @@ sub git_commitdiff_plain {
 }
 
 sub git_history {
-	if (!defined $hash) {
-		$hash = git_read_head($project);
+	if (!defined $hash_base) {
+		$hash_base = git_read_head($project);
 	}
-	my %co = git_read_commit($hash);
+	my %co = git_read_commit($hash_base);
 	if (!%co) {
 		die_error(undef, "Unknown commit object.");
 	}
@@ -2306,18 +2306,18 @@ sub git_history {
 	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, "summary") .
 	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog")}, "shortlog") .
 	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log")}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash")}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash")}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") .
+	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base")}, "commit") .
+	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash_base")}, "commitdiff") .
+	      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash_base")}, "tree") .
 	      "<br/><br/>\n" .
 	      "</div>\n";
 	print "<div>\n" .
-	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash"), -class => "title"}, esc_html($co{'title'})) . "\n" .
+	      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_base"), -class => "title"}, esc_html($co{'title'})) . "\n" .
 	      "</div>\n";
 	print "<div class=\"page_path\"><b>/" . esc_html($file_name) . "</b><br/></div>\n";
 
 	open my $fd, "-|",
-		"$GIT rev-list --full-history $hash -- \'$file_name\'";
+		"$GIT rev-list --full-history $hash_base -- \'$file_name\'";
 	print "<table cellspacing=\"0\">\n";
 	my $alternate = 0;
 	while (my $line = <$fd>) {
@@ -2345,8 +2345,7 @@ sub git_history {
 			      $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") .
 			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") .
 			      " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;hb=$commit;f=$file_name")}, "blob");
-			my $blob = git_get_hash_by_path($hash, $file_name);
+			my $blob = git_get_hash_by_path($hash_base, $file_name);
 			my $blob_parent = git_get_hash_by_path($commit, $file_name);
 			if (defined $blob && defined $blob_parent && $blob ne $blob_parent) {
 				print " | " .
-- 
1.4.2.rc1.g9b54


^ permalink raw reply related

* [PATCH] show-branch: Fix another performance problem.
From: Alexandre Julliard @ 2006-07-23 17:51 UTC (permalink / raw)
  To: git

When naming commits, stop walking the parent chain as soon as we find
a commit that already has a name. The parent chain of that commit will
be walked later on in any case (or may even have been walked already).
This avoids O(n^2) behavior; on a tree where show-branch displays 6800
commits, the total run time drops from 77 seconds to 5 seconds.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 builtin-show-branch.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 3d240ca..82f75b7 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -89,6 +89,8 @@ static int name_first_parent_chain(struc
 			name_parent(c, p);
 			i++;
 		}
+		else
+			break;
 		c = p;
 	}
 	return i;
-- 
1.4.2.rc1.ge7a0

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply related

* Your money, orange-striped
From: Carla Herrington @ 2006-07-23 17:26 UTC (permalink / raw)
  To: git-commits-head-owner

Genuine Swiss made RoleKx repilcas are as close to the real thing 
as a repilca watch can be. Sometimes even the professional jewelers 
are unable to tell the difference from the real Role2x watch.

Why spend thousands of dollars on the real deal when 
a repilca watch looks so much alike that only an expert could tell the difference...
And you only pay a fractoin of the price.

VISIT US, AND GET OUR SPECIL 370% DISLCOUNT OFER!

http://23IJQJF1hou6k7r777ckjjz6j1zo1jj.unrhymedad.com/

==========
     "See here Jonathan " said his father not unkindly. "Winter isn't  far
the window, too.  The glass in our  windows is thick and leaded.  And beyond
something over two hundred miles per hour, into a cliff of solid granite.
crossed over the hillock  and moved  on and on toward us, right next  to the
     Jonathan stayed and worked with the new birds coming in, who were all
     I stepped inside  and went straight for the canisters.  I crouched over

globe and you  start firing bullets into it.  The bullet  holes would lie on
that the  rescue squad had climbed into  their helicopter, the firemen  were

^ permalink raw reply

* Re: GIT user survey
From: Jakub Narebski @ 2006-07-23 13:18 UTC (permalink / raw)
  To: git
In-Reply-To: <4d8e3fd30607230145i2480c20fxb06127c8b0187c98@mail.gmail.com>

Paolo Ciarrocchi wrote:

> If you know people using GIT please forward this message to them,
> currently is has been sent to the following projects:
> - u-boot
> - wine
> - cairo
> - xmms2
> - xcb

Check out http://git.or.cz/gitwiki/GitProjects

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

^ permalink raw reply

* Re: Makefile checks for DarwinPorts / Fink
From: Jakub Narebski @ 2006-07-23 13:00 UTC (permalink / raw)
  To: git
In-Reply-To: <20060723054531.GA12559@spearce.org>

Shawn Pearce wrote:

> This is a slightly cleaner version of my prior patch.  :-)
> 
> -->8--
> Disable linking with Fink or DarwinPorts.
> 
> It may be desirable for the compiler to disable linking against Fink
> or DarwinPorts, especially if both are installed on the system and
> the user wants GIT to be linked specifically to only one of them.
> 
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Could you _please_ document this option in commentary part in main Makefile?
TIA. 

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