* Re: Huge win, compressing a window of delta runs as a unit
From: Jon Smirl @ 2006-08-17 14:36 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Shawn Pearce, git
In-Reply-To: <Pine.LNX.4.63.0608171003020.28360@wbgn013.biozentrum.uni-wuerzburg.de>
On 8/17/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> At least, the delta-chains should be limited by size (_not_ by number of
> deltas: you can have huge deltas, and if you have to unpack 5 huge deltas
> before getting to the huge delta you really need, it takes really long).
This is not an obvious conclusion. Reducing our pack from 845MB to
292MB eliminates a huge amount of IO. All of the work I am doing with
this pack has been totally IO bound. The CPU time to get from one
delta to another is minor compared to the IO time increase if you
break the chains up. Each time you break the chain you have to store a
full copy of the file, the IO increase from doing this out weighs the
CPU time reduction.
I would use a two pack model. One pack holds the 292MB archive and the
second pack is made from recent changes. They can both be the same
format since the chains in the second pack won't be very long. We
might want to put a flag into an archive pack that tells git-repack
not to touch it by default.
As for public servers there is an immediate win in shifting to the new
pack format. Three hour downloads vs one hour, plus the bandwidth
bills. Are the tools smart enough to say this is a newer pack format,
upgrade? It takes far less than two hours to upgrade your git install.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Rename/copy detect in qgit
From: Marco Costalba @ 2006-08-17 13:40 UTC (permalink / raw)
To: GIT list
I have pushed (git://git.kernel.org/pub/scm/qgit/qgit.git) some
patches to add file rename/copy detection to qgit.
It was harder then expected due to some subtle details, and still the
merge combined case is missing, anyhow I think feature is usable and
should be quite stable.
If someone is interested it would be great to give it a try because
testing is required.
BTW it is now possible to view file rename/copy info in patch view as
well in file list (see screenshot), both views are synced and old
commands (as example double-clicking on file name) should still work
as expected.
Screenshot: http://digilander.libero.it/mcostalba/rename_copy.png
Thanks
Marco
^ permalink raw reply
* Re: [PATCH] introduce inline is_same_sha1
From: Alex Riesen @ 2006-08-17 11:59 UTC (permalink / raw)
To: David Rientjes; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0608161721020.11465@chino.corp.google.com>
On 8/17/06, David Rientjes <rientjes@google.com> wrote:
> Introduces global inline:
> is_same_sha1(const unsigned char *sha1,
> const unsigned char *sha2);
It is longer and negates all (like in "lots") previous callsites of memcmp.
Are sure you didn't do a trivial typo somewhere?
Why not just sha1cmp? And if you're aiming at hash-type independence,
why not hashcmp?
^ permalink raw reply
* [RFC diff-tree -c with copy/rename]
From: Marco Costalba @ 2006-08-17 11:02 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT list
>From current git tree:
$ git-diff-tree -r -m -C bb266cb118 (I removed extra useless lines)
bb266cb11842f76712ebff1d8b1bd086dc65337f
:100644 100644 dfb1c44 8d0dbad R093 checkout-index.c builtin-checkout-index.c
:100644 100644 357970d 7d39d9b R083 verify-pack.c builtin-verify-pack.c
:100644 100644 6484cb9 6484cb9 R100 builtin-help.c help.c
bb266cb11842f76712ebff1d8b1bd086dc65337f
:100644 100644 29ea6fd 8d0dbad M builtin-checkout-index.c
:100644 100644 d700761 7d39d9b M builtin-verify-pack.c
:100644 100644 7a7f775 6484cb9 M help.c
$ git-diff-tree -r -c -C bb266cb118
bb266cb11842f76712ebff1d8b1bd086dc65337f
::100644 100644 100644 dfb1c44 29ea6f 8d0dbad RM builtin-checkout-index.c
::100644 100644 100644 357970d d70076 7d39d9b RM builtin-verify-pack.c
::100644 100644 100644 6484cb9 7a7f77 6484cb9 RM help.c
Is it correct do not show in -c case:
- the similarity value
- the origin file:
As example
'R093MM checkout-index.c builtin-checkout-index.c'
instead of current
'RM builtin-checkout-index.c'
Thanks
Marco
P.S: -c with --stat gives both origin and destination files
(checkout-index.c and builtin-checkout-index.c):
$ git-diff-tree -r -c -C --stat bb266cb118
bb266cb11842f76712ebff1d8b1bd086dc65337f
Makefile | 81 +++++++++++++++---------
checkout-index.c => builtin-checkout-index.c | 26 ++++----
builtin-count.c => builtin-count-objects.c | 0
name-rev.c => builtin-name-rev.c | 4 +
pack-objects.c => builtin-pack-objects.c | 4 +
symbolic-ref.c => builtin-symbolic-ref.c | 4 +
unpack-objects.c => builtin-unpack-objects.c | 7 +-
verify-pack.c => builtin-verify-pack.c | 15 ++---
builtin.h | 80 ++++++++++++------------
git.c | 86 ++++++++++++++------------
builtin-help.c => help.c | 0
11 files changed, 166 insertions(+), 141 deletions(-)
^ permalink raw reply
* Re: [Possible bug] diff-tree --stat info does not count copies
From: Marco Costalba @ 2006-08-17 10:54 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vveorsnt3.fsf@assigned-by-dhcp.cox.net>
On 8/17/06, Junio C Hamano <junkio@cox.net> wrote:
> "Marco Costalba" <mcostalba@gmail.com> writes:
>
> > While testing qgit with the new rename/copy support I found this
> > (possible) bug playing on git tree.
> >
> > $ git-diff-tree -r --stat 6973dca
> > 6973dcaee76ef7b7bfcabd2f26e76205aae07858
> > Makefile | 2
> > diff-files.c | 212 +----
> > diff-lib.c | 1862 ++---------------------------------------
> > diff.c | 1795 ++++++++++++++++++++++++++++++++++++++++
> > diff.h | 7
> > t/t1001-read-tree-m-2way.sh | 2
> > t/t1002-read-tree-m-u-2way.sh | 2
> > 7 files changed, 1929 insertions(+), 1953 deletions(-)
> >
> > $ git-diff-tree -r --stat -C 6973dca
> > 6973dcaee76ef7b7bfcabd2f26e76205aae07858
> > Makefile | 2
> > diff-files.c | 212 +----
> > diff-lib.c | 1862 ++---------------------------------------
> > diff-lib.c => diff.c | 0
> > diff.h | 7
> > t/t1001-read-tree-m-2way.sh | 2
> > t/t1002-read-tree-m-u-2way.sh | 2
> > 7 files changed, 134 insertions(+), 1953 deletions(-)
> >
> > IMHO the bug is
> >
> > "diff-lib.c => diff.c | 0"
> >
> > instead of
> >
> > "diff-lib.c => diff.c | 1795"
> >
> > because, after the patch applied, in the repository we have
> > 1953-1929=24 lines of code more, not 1953-134= 1819 less.
>
> Interesting. That's really a matter of taste and interpretation.
>
> If it were a straight rename without changing a single line,
> then would you say 1795 lines were removed (from the LHS file)
> and 1795 lines were added (to the RHS file)?
>
> I personally find that output would be useless and would prefer
> it to say "I renamed file A to file B. Content-wise, there were
> N lines added and M lines removed, compared to the straight
> rename case, by the way".
>
> And that is what the current output does. I do not see why it
> should be different in the case of a copy instead of a rename.
>
Because after a copy you have 2 files, not still one. And the 'after
copied' file cannot be the original, but a new file, because the
original is still alive.
Perhaps I can explain better myself taking in account the _couple_ of
files involved in both cases:
Without -C we have
diff-lib.c | 1862 ++---------------------------------------
diff.c | 1795 ++++++++++++++++++++++++++++++++++++++++
With -C option is
diff-lib.c | 1862 ++---------------------------------------
diff-lib.c => diff.c | 0
If it was a rename we had something like:
diff-lib.c | 1795 -----------------------------------------
diff.c | 1795 ++++++++++++++++++++++++++++++++++++++++
and, with -C
diff-lib.c => diff.c | 0
and _this_ is correct. But with copy diff-lib.c => diff.c should not
stay at zero lines changed because diff.c is not the same of
diff-lib.c, but it's a _new_ file created with the same content of
diff-lib.c and _then_ the original and only diff-lib.c file is further
modified on his own (in our case changing 1862 lines).
Please tell me where I get wrong.
Thanks
Marco
^ permalink raw reply
* Re: [PATCH 4/7] gitweb: Expand href() function to use key as param name for no mapping
From: Jakub Narebski @ 2006-08-17 10:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v8xlnsmyl.fsf@assigned-by-dhcp.cox.net>
On 8/17/06, Junio C Hamano <junkio@cox.net> wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
> > Expand href() function to use key name of params hash as a query param
> > name, if there is no mapping for given key name.
> >
> > It is now safer to use href(); no errors, but links might not work
> > correctly if caller didn't provide correct arguments.
> >
> > Future proofing.
>
> I think that is not a "future proofing" but is "sweeping mess
> under the rug" ;-).
At least leave 'if (exists $mapping{$_})' even if you remove the 'else' part.
[...]
> Obviously unrelated and probably unplanned revert of [2/7] in
> the series, so will not apply.
Ooops, sorry, I haven't noticed this... Very unplanned.
--
Jakub Narebski
^ permalink raw reply
* Re: [PATCH 4/7] gitweb: Expand href() function to use key as param name for no mapping
From: Junio C Hamano @ 2006-08-17 9:58 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <11558064893139-git-send-email-jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> Expand href() function to use key name of params hash as a query param
> name, if there is no mapping for given key name.
>
> It is now safer to use href(); no errors, but links might not work
> correctly if caller didn't provide correct arguments.
>
> Future proofing.
I think that is not a "future proofing" but is "sweeping mess
under the rug" ;-).
> @@ -1174,66 +1179,6 @@ sub git_print_page_path {
> }
> }
>
> -sub git_print_log {
> - my $log = shift;
> -
> - # remove leading empty lines
>...
> -}
> -
> -sub git_print_simplified_log {
> - my $log = shift;
> - my $remove_title = shift;
> -
>...
> - print "<br/>\n" unless $empty;
> -}
> -
> ## ......................................................................
> ## functions printing large fragments of HTML
>...
> @@ -2215,10 +2160,27 @@ sub git_log {
> "<br/>\n" .
> "</div>\n" .
> "<i>" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .
> - "</div>\n";
> -
> - print "<div class=\"log_body\">\n";
> - git_print_simplified_log($co{'comment'});
> + "</div>\n" .
> + "<div class=\"log_body\">\n";
>...
> + print format_log_line_html($line) . "<br/>\n";
> + }
> + if (!$empty) {
> + print "<br/>\n";
> + }
> print "</div>\n";
> }
Obviously unrelated and probably unplanned revert of [2/7] in
the series, so will not apply.
^ permalink raw reply
* Re: [PATCH 5/7] gitweb: Added parse_difftree_raw_line function for later use
From: Junio C Hamano @ 2006-08-17 9:55 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <11558064893592-git-send-email-jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> +sub parse_difftree_raw_line {
> + my $line = shift;
> + my %res;
> +
> + # ':100644 100644 03b218260e99b78c6df0ed378e59ed9205ccc96d 3b93d5e7cc7f7dd4ebed13a5cc1a4ad976fc94d8 M ls-files.c'
> + # ':100644 100644 7f9281985086971d3877aca27704f2aaf9c448ce bc190ebc71bbd923f2b728e505408f5e54bd073a M rev-tree.c'
> + if ($line =~ m/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$/) {
We would probably want to say that status symbol is an uppercase
alpha [A-Z]. Or maybe limit it to a non-whitespace letter (\S).
Dot there to say "just any letter" looks wrong.
I would use "+" instead of hardcoding the length of mode strings
(you have 6 there) and object name hash (ditto 40) but that is
mostly style and a slight future proofing against us using
longer hashes (not in our immediate future though).
^ permalink raw reply
* Re: gitweb: Support for snapshots in gitweb
From: Jakub Narebski @ 2006-08-17 9:49 UTC (permalink / raw)
To: git
In-Reply-To: <44E40CB1.7040805@gmail.com>
Aneesh Kumar K.V wrote:
> + print $cgi->header(-type=>'application/x-tar', -Content-Encoding=>'x-gzip',
> + '-content-disposition' => "inline; filename=\"$project.tar.gz\"",
> + -status=> '200 OK');
Wouldn't it be better to put $hash somewhere in the name?
And please remember that $project can contain slashes, so it should be processed
(only basename of $project, perhaps).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: RFC: git pull <remote> making an octopus?
From: Michael S. Tsirkin @ 2006-08-17 9:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1wrfu3tl.fsf@assigned-by-dhcp.cox.net>
Quoting r. Junio C Hamano <junkio@cox.net>:
> > No, I just reproduced this on plain 1.4.2.
>
> Doesn't reproduce for me and I am getting worried.
No, that was my mistake, sorry about not clarifying that.
Basically what confused me was the following text in get-fetch manpage:
While git-pull run without any explicit <refspec> parameter takes
default <refspec>s from Pull: lines, it merges only the first
<refspec> found into the current branch, after fetching all the remote
refs.
And this actually applied to remotes in $GITDIR/remotes and not just
when git-pull is run without any parameters.
--
MST
^ permalink raw reply
* Re: [PATCH] gitweb: use action dispatcher for non-project actions, too.
From: Jakub Narebski @ 2006-08-17 9:41 UTC (permalink / raw)
To: git
In-Reply-To: <11557673281583-git-send-email-tali@admingilde.org>
Martin Waitz wrote:
> Project list and OPML generation are now hooked into the list as
> "/summary" and "/opml".
It would be better to use "/list" or "/projects", although empty or undef or
"/" action would work as well.
Having both "/summary" (for projects list) and "summary" (for project
summary) is bad, bad idea.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [Possible bug] diff-tree --stat info does not count copies
From: Junio C Hamano @ 2006-08-17 9:40 UTC (permalink / raw)
To: Marco Costalba; +Cc: git
In-Reply-To: <e5bfff550608170219q12fcb34ewf93a195eabe0b94a@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
> While testing qgit with the new rename/copy support I found this
> (possible) bug playing on git tree.
>
> $ git-diff-tree -r --stat 6973dca
> 6973dcaee76ef7b7bfcabd2f26e76205aae07858
> Makefile | 2
> diff-files.c | 212 +----
> diff-lib.c | 1862 ++---------------------------------------
> diff.c | 1795 ++++++++++++++++++++++++++++++++++++++++
> diff.h | 7
> t/t1001-read-tree-m-2way.sh | 2
> t/t1002-read-tree-m-u-2way.sh | 2
> 7 files changed, 1929 insertions(+), 1953 deletions(-)
>
> $ git-diff-tree -r --stat -C 6973dca
> 6973dcaee76ef7b7bfcabd2f26e76205aae07858
> Makefile | 2
> diff-files.c | 212 +----
> diff-lib.c | 1862 ++---------------------------------------
> diff-lib.c => diff.c | 0
> diff.h | 7
> t/t1001-read-tree-m-2way.sh | 2
> t/t1002-read-tree-m-u-2way.sh | 2
> 7 files changed, 134 insertions(+), 1953 deletions(-)
>
> IMHO the bug is
>
> "diff-lib.c => diff.c | 0"
>
> instead of
>
> "diff-lib.c => diff.c | 1795"
>
> because, after the patch applied, in the repository we have
> 1953-1929=24 lines of code more, not 1953-134= 1819 less.
Interesting. That's really a matter of taste and interpretation.
If it were a straight rename without changing a single line,
then would you say 1795 lines were removed (from the LHS file)
and 1795 lines were added (to the RHS file)?
I personally find that output would be useless and would prefer
it to say "I renamed file A to file B. Content-wise, there were
N lines added and M lines removed, compared to the straight
rename case, by the way".
And that is what the current output does. I do not see why it
should be different in the case of a copy instead of a rename.
^ permalink raw reply
* Re: [PATCH] gitweb: use common parameter parsing and generation for "o", too.
From: Jakub Narebski @ 2006-08-17 9:35 UTC (permalink / raw)
To: git
In-Reply-To: <11557673212235-git-send-email-tali@admingilde.org>
Martin Waitz wrote:
> The "o" (list order) parameter was handled special.
> Now it is generated with the common href() function and parsed together with
> all other parameters.
This was because "o" (sort table by) parameter was used only
in one place, and valid values of order parameter depends on
the place it is used.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH 2/2] gitweb: Add support for per project git URLs
From: Jakub Narebski @ 2006-08-17 9:31 UTC (permalink / raw)
To: git
In-Reply-To: <7vveos2z3y.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> It is now possible for project to have individual clone/fetch URLs.
>> They are provided in new file 'cloneurl' added below project's
>> $GIT_DIR directory.
>>
>> If there is no cloneurl file, concatenation of git base URLs with
>> project name is used.
>>
>> This is merge of Jakub Narebski and David Rientjes
>> gitweb: Show project's git URL on summary page
>> with Aneesh Kumar
>> gitweb: Add support for cloneurl.
>> gitweb: Support multiple clone urls
>> patches.
>>
>> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
>
> I'll take this for now, but we might want to consider moving
> 'description' and 'cloneurl' information to the config file to
> prevent cluttering.
>
> gitweb.description
> gitweb.giturl
>
> The URL is not for cloning only, but also for fetch/pull, right?
As of now reading text file is faster than invoking git-repo-config...
although reimplementing _reading_ part of git-repo-config in Perl should be
easy...
cloneurl name is leftover from Aneesh Kumar patch.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH 2/7] gitweb: Refactor printing commit message
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
Separate pretty-printing commit message (comment) into git_print_log
and git_print_simplified_log subroutines. As of now the former is used
in git_commit, the latter in git_log and git_commitdiff.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 132 ++++++++++++++++++++++++++--------------------------
1 files changed, 67 insertions(+), 65 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7c92ac3..0d869f2 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1174,6 +1174,66 @@ sub git_print_page_path {
}
}
+sub git_print_log {
+ my $log = shift;
+
+ # remove leading empty lines
+ while (defined $log->[0] && $log->[0] eq "") {
+ shift @$log;
+ }
+
+ # print log
+ my $signoff = 0;
+ my $empty = 0;
+ foreach my $line (@$log) {
+ # print only one empty line
+ # do not print empty line after signoff
+ if ($line eq "") {
+ next if ($empty || $signoff);
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ $signoff = 1;
+ print "<span class=\"signoff\">" . esc_html($line) . "</span><br/>\n";
+ } else {
+ $signoff = 0;
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ }
+}
+
+sub git_print_simplified_log {
+ my $log = shift;
+ my $remove_title = shift;
+
+ shift @$log if $remove_title;
+ # remove leading empty lines
+ while (defined $log->[0] && $log->[0] eq "") {
+ shift @$log;
+ }
+
+ # simplify and print log
+ my $empty = 0;
+ foreach my $line (@$log) {
+ # remove signoff lines
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ next;
+ }
+ # print only one empty line
+ if ($line eq "") {
+ next if $empty;
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ # end with single empty line
+ print "<br/>\n" unless $empty;
+}
+
## ......................................................................
## functions printing large fragments of HTML
@@ -2155,27 +2215,10 @@ sub git_log {
"<br/>\n" .
"</div>\n" .
"<i>" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .
- "</div>\n" .
- "<div class=\"log_body\">\n";
- my $comment = $co{'comment'};
- my $empty = 0;
- foreach my $line (@$comment) {
- if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
- next;
- }
- if ($line eq "") {
- if ($empty) {
- next;
- }
- $empty = 1;
- } else {
- $empty = 0;
- }
- print format_log_line_html($line) . "<br/>\n";
- }
- if (!$empty) {
- print "<br/>\n";
- }
+ "</div>\n";
+
+ print "<div class=\"log_body\">\n";
+ git_print_simplified_log($co{'comment'});
print "</div>\n";
}
git_footer_html();
@@ -2256,28 +2299,9 @@ sub git_commit {
}
print "</table>".
"</div>\n";
+
print "<div class=\"page_body\">\n";
- my $comment = $co{'comment'};
- my $empty = 0;
- my $signed = 0;
- foreach my $line (@$comment) {
- # print only one empty line
- if ($line eq "") {
- if ($empty || $signed) {
- next;
- }
- $empty = 1;
- } else {
- $empty = 0;
- }
- if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
- $signed = 1;
- print "<span class=\"signoff\">" . esc_html($line) . "</span><br/>\n";
- } else {
- $signed = 0;
- print format_log_line_html($line) . "<br/>\n";
- }
- }
+ git_print_log($co{'comment'});
print "</div>\n";
git_difftree_body(\@difftree, $parent);
@@ -2343,29 +2367,7 @@ sub git_commitdiff {
git_print_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);
print "<div class=\"page_body\">\n";
- my $comment = $co{'comment'};
- my $empty = 0;
- my $signed = 0;
- my @log = @$comment;
- # remove first and empty lines after that
- shift @log;
- while (defined $log[0] && $log[0] eq "") {
- shift @log;
- }
- foreach my $line (@log) {
- if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
- next;
- }
- if ($line eq "") {
- if ($empty) {
- next;
- }
- $empty = 1;
- } else {
- $empty = 0;
- }
- print format_log_line_html($line) . "<br/>\n";
- }
+ git_print_simplified_log($co{'comment'}, 1); # skip title
print "<br/>\n";
foreach my $line (@difftree) {
# ':100644 100644 03b218260e99b78c6df0ed378e59ed9205ccc96d 3b93d5e7cc7f7dd4ebed13a5cc1a4ad976fc94d8 M ls-files.c'
--
1.4.1.1
^ permalink raw reply related
* [PATCH 4/7] gitweb: Expand href() function to use key as param name for no mapping
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
Expand href() function to use key name of params hash as a query param
name, if there is no mapping for given key name.
It is now safer to use href(); no errors, but links might not work
correctly if caller didn't provide correct arguments.
Future proofing.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 143 +++++++++++++++++++++++++++-------------------------
1 files changed, 73 insertions(+), 70 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 86266da..d37e7f1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -204,8 +204,13 @@ sub href(%) {
my $href = "$my_uri?";
$href .= esc_param( join(";",
- map { "$mapping{$_}=$params{$_}" } keys %params
- ) );
+ map {
+ if (exists $mapping{$_}) {
+ "$mapping{$_}=$params{$_}";
+ } else {
+ "$_=$params{$_}";
+ }
+ } keys %params ) );
return $href;
}
@@ -1174,66 +1179,6 @@ sub git_print_page_path {
}
}
-sub git_print_log {
- my $log = shift;
-
- # remove leading empty lines
- while (defined $log->[0] && $log->[0] eq "") {
- shift @$log;
- }
-
- # print log
- my $signoff = 0;
- my $empty = 0;
- foreach my $line (@$log) {
- # print only one empty line
- # do not print empty line after signoff
- if ($line eq "") {
- next if ($empty || $signoff);
- $empty = 1;
- } else {
- $empty = 0;
- }
- if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
- $signoff = 1;
- print "<span class=\"signoff\">" . esc_html($line) . "</span><br/>\n";
- } else {
- $signoff = 0;
- print format_log_line_html($line) . "<br/>\n";
- }
- }
-}
-
-sub git_print_simplified_log {
- my $log = shift;
- my $remove_title = shift;
-
- shift @$log if $remove_title;
- # remove leading empty lines
- while (defined $log->[0] && $log->[0] eq "") {
- shift @$log;
- }
-
- # simplify and print log
- my $empty = 0;
- foreach my $line (@$log) {
- # remove signoff lines
- if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
- next;
- }
- # print only one empty line
- if ($line eq "") {
- next if $empty;
- $empty = 1;
- } else {
- $empty = 0;
- }
- print format_log_line_html($line) . "<br/>\n";
- }
- # end with single empty line
- print "<br/>\n" unless $empty;
-}
-
## ......................................................................
## functions printing large fragments of HTML
@@ -1322,7 +1267,7 @@ sub git_difftree_body {
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file)}, "blob");
if ($to_id ne $from_id) { # modified
- print " | " . $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$file)}, "diff");
+ print $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$file)}, "diff");
}
print " | " . $cgi->a({-href => href(action=>"history", hash_base=>$hash, file_name=>$file)}, "history") . "\n";
print "</td>\n";
@@ -2215,10 +2160,27 @@ sub git_log {
"<br/>\n" .
"</div>\n" .
"<i>" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]</i><br/>\n" .
- "</div>\n";
-
- print "<div class=\"log_body\">\n";
- git_print_simplified_log($co{'comment'});
+ "</div>\n" .
+ "<div class=\"log_body\">\n";
+ my $comment = $co{'comment'};
+ my $empty = 0;
+ foreach my $line (@$comment) {
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ next;
+ }
+ if ($line eq "") {
+ if ($empty) {
+ next;
+ }
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ if (!$empty) {
+ print "<br/>\n";
+ }
print "</div>\n";
}
git_footer_html();
@@ -2299,9 +2261,28 @@ sub git_commit {
}
print "</table>".
"</div>\n";
-
print "<div class=\"page_body\">\n";
- git_print_log($co{'comment'});
+ my $comment = $co{'comment'};
+ my $empty = 0;
+ my $signed = 0;
+ foreach my $line (@$comment) {
+ # print only one empty line
+ if ($line eq "") {
+ if ($empty || $signed) {
+ next;
+ }
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ $signed = 1;
+ print "<span class=\"signoff\">" . esc_html($line) . "</span><br/>\n";
+ } else {
+ $signed = 0;
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ }
print "</div>\n";
git_difftree_body(\@difftree, $parent);
@@ -2367,7 +2348,29 @@ sub git_commitdiff {
git_print_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);
print "<div class=\"page_body\">\n";
- git_print_simplified_log($co{'comment'}, 1); # skip title
+ my $comment = $co{'comment'};
+ my $empty = 0;
+ my $signed = 0;
+ my @log = @$comment;
+ # remove first and empty lines after that
+ shift @log;
+ while (defined $log[0] && $log[0] eq "") {
+ shift @log;
+ }
+ foreach my $line (@log) {
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ next;
+ }
+ if ($line eq "") {
+ if ($empty) {
+ next;
+ }
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ print format_log_line_html($line) . "<br/>\n";
+ }
print "<br/>\n";
foreach my $line (@difftree) {
# ':100644 100644 03b218260e99b78c6df0ed378e59ed9205ccc96d 3b93d5e7cc7f7dd4ebed13a5cc1a4ad976fc94d8 M ls-files.c'
--
1.4.1.1
^ permalink raw reply related
* [PATCH 3/7] gitweb: Fix typo in separation of git_difftree_body
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0d869f2..86266da 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1322,7 +1322,7 @@ sub git_difftree_body {
"<td class=\"link\">" .
$cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file)}, "blob");
if ($to_id ne $from_id) { # modified
- print $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$file)}, "diff");
+ print " | " . $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$file)}, "diff");
}
print " | " . $cgi->a({-href => href(action=>"history", hash_base=>$hash, file_name=>$file)}, "history") . "\n";
print "</td>\n";
--
1.4.1.1
^ permalink raw reply related
* [PATCH 7/7] gitweb: Uniquify version info output, add meta generator in page header
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d132aab..5467880 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1049,10 +1049,11 @@ sub git_header_html {
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
-<!-- git web interface v$version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
+<!-- git web interface version $version, (C) 2005-2006, Kay Sievers <kay.sievers\@vrfy.org>, Christian Gierke -->
<!-- git core binaries version $git_version -->
<head>
<meta http-equiv="content-type" content="$content_type; charset=utf-8"/>
+<meta name="generator" content="gitweb/$version git/$git_version"/>
<meta name="robots" content="index, nofollow"/>
<title>$title</title>
<link rel="stylesheet" type="text/css" href="$stylesheet"/>
--
1.4.1.1
^ permalink raw reply related
* [PATCH 6/7] gitweb: Sort query string parameters in href() function
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
Introduction of a href() function to generate an URL for the CGI,
while making it easier to change the encoding of actions into URLs,
changed also the ordering of parameters in query string, and in URL.
This patch tries to bring back old ordering of query string
parameters. Probably it is not worth the cost; this is an RFC.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b3f38bf..d132aab 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -197,8 +197,29 @@ sub href(%) {
hash_base => "hb",
page => "pg",
searchtext => "s",
+ order => "o",
);
+ my %ordering = (
+ project => 0,
+ action => 1,
+ order => 2,
+ hash => 10,
+ hash_parent => 11,
+ hash_base => 12,
+ page => 20,
+ file_name => 21,
+ searchtext => 22,
+ );
+
+ sub byordering ($$) {
+ if (exists $ordering{$_[0]} && exists $ordering{$_[1]}) {
+ return $ordering{$_[0]} <=> $ordering{$_[1]};
+ } else {
+ return $_[0] cmp $_[1];
+ }
+ }
+
my %params = @_;
$params{"project"} ||= $project;
@@ -210,7 +231,7 @@ sub href(%) {
} else {
"$_=$params{$_}";
}
- } keys %params ) );
+ } sort byordering keys %params ) );
return $href;
}
--
1.4.1.1
^ permalink raw reply related
* [PATCH 5/7] gitweb: Added parse_difftree_raw_line function for later use
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
Adds parse_difftree_raw_line function which parses one line of "raw"
format diff-tree output into a hash.
For later use in git_difftree_body, git_commitdiff and
git_commitdiff_plain, git_search.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d37e7f1..b3f38bf 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -851,6 +851,33 @@ sub parse_ref {
return %ref_item;
}
+sub parse_difftree_raw_line {
+ my $line = shift;
+ my %res;
+
+ # ':100644 100644 03b218260e99b78c6df0ed378e59ed9205ccc96d 3b93d5e7cc7f7dd4ebed13a5cc1a4ad976fc94d8 M ls-files.c'
+ # ':100644 100644 7f9281985086971d3877aca27704f2aaf9c448ce bc190ebc71bbd923f2b728e505408f5e54bd073a M rev-tree.c'
+ if ($line =~ m/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$/) {
+ $res{'from_mode'} = $1;
+ $res{'to_mode'} = $2;
+ $res{'from_id'} = $3;
+ $res{'to_id'} = $4;
+ $res{'status'} = $5;
+ $res{'similarity'} = $6;
+ if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
+ ($res{'from_file'}, $res{'to_file'}) = map(unquote, split("\t", $7));
+ } else {
+ $res{'file'} = unquote($7);
+ }
+ }
+ # 'c512b523472485aef4fff9e57b229d9d243c967f'
+ #elsif ($line =~ m/^([0-9a-fA-F]{40})$/) {
+ # $res{'commit'} = $1;
+ #}
+
+ return wantarray ? %res : \%res;
+}
+
## ......................................................................
## parse to array of hashes functions
--
1.4.1.1
^ permalink raw reply related
* [PATCH 1/7] gitweb: Add support for per project git URLs
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Aneesh Kumar K.V
In-Reply-To: <11558064883957-git-send-email-jnareb@gmail.com>
It is now possible for project to have individual clone/fetch URLs.
They are provided in new file 'cloneurl' added below project's
$GIT_DIR directory.
If there is no cloneurl file, concatenation of git base URLs with
project name is used.
This is merge of Jakub Narebski and David Rientjes
gitweb: Show project's git URL on summary page
with Aneesh Kumar
gitweb: Add support for cloneurl.
gitweb: Support multiple clone urls
patches.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
gitweb/gitweb.perl | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 37a6284..7c92ac3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -533,6 +533,16 @@ sub git_get_project_description {
return $descr;
}
+sub git_get_project_url_list {
+ my $path = shift;
+
+ open my $fd, "$projectroot/$path/cloneurl" or return undef;
+ my @git_project_url_list = map { chomp; $_ } <$fd>;
+ close $fd;
+
+ return wantarray ? @git_project_url_list : \@git_project_url_list;
+}
+
sub git_get_projects_list {
my @list;
@@ -1697,10 +1707,14 @@ sub git_summary {
"<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
"<tr><td>owner</td><td>$owner</td></tr>\n" .
"<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+ # use per project git URL list in $projectroot/$project/cloneurl
+ # or make project git URL from git base URL and project name
my $url_tag = "URL";
- foreach my $git_base_url (@git_base_url_list) {
- next unless $git_base_url;
- print "<tr><td>$url_tag</td><td>$git_base_url/$project</td></tr>\n";
+ my @url_list = git_get_project_url_list($project);
+ @url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
+ foreach my $git_url (@url_list) {
+ next unless $git_url;
+ print "<tr><td>$url_tag</td><td>$git_url</td></tr>\n";
$url_tag = "";
}
print "</table>\n";
--
1.4.1.1
^ permalink raw reply related
* [PATCH 0/7] A few gitweb cleanups and improvements
From: Jakub Narebski @ 2006-08-17 9:21 UTC (permalink / raw)
To: git
A few gitweb cleanups, refactoring, and improvements.
Based on 'master', 1c2a4f5addce479c619057c6cdc841802139982f
First patch in series was sent earlier.
gitweb/gitweb.perl | 80 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 74 insertions(+), 6 deletions(-)
Jakub Narebski:
gitweb: Add support for per project git URLs
gitweb: Refactor printing commit message
gitweb: Fix typo in separation of git_difftree_body
gitweb: Expand href() function to use key as param name for no mapping
gitweb: Added parse_difftree_raw_line function for later use
gitweb: Sort query string parameters in href() function
gitweb: Uniquify version info output, add meta generator in page header
--
Jakub Narebski
Poland
^ permalink raw reply
* [Possible bug] diff-tree --stat info does not count copies
From: Marco Costalba @ 2006-08-17 9:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT list
While testing qgit with the new rename/copy support I found this
(possible) bug playing on git tree.
$ git-diff-tree -r --stat 6973dca
6973dcaee76ef7b7bfcabd2f26e76205aae07858
Makefile | 2
diff-files.c | 212 +----
diff-lib.c | 1862 ++---------------------------------------
diff.c | 1795 ++++++++++++++++++++++++++++++++++++++++
diff.h | 7
t/t1001-read-tree-m-2way.sh | 2
t/t1002-read-tree-m-u-2way.sh | 2
7 files changed, 1929 insertions(+), 1953 deletions(-)
$ git-diff-tree -r --stat -C 6973dca
6973dcaee76ef7b7bfcabd2f26e76205aae07858
Makefile | 2
diff-files.c | 212 +----
diff-lib.c | 1862 ++---------------------------------------
diff-lib.c => diff.c | 0
diff.h | 7
t/t1001-read-tree-m-2way.sh | 2
t/t1002-read-tree-m-u-2way.sh | 2
7 files changed, 134 insertions(+), 1953 deletions(-)
IMHO the bug is
"diff-lib.c => diff.c | 0"
instead of
"diff-lib.c => diff.c | 1795"
because, after the patch applied, in the repository we have
1953-1929=24 lines of code more, not 1953-134= 1819 less.
Thanks
Marco
^ permalink raw reply
* Re: RFC: git pull <remote> making an octopus?
From: Alex Riesen @ 2006-08-17 9:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Michael S. Tsirkin, git
In-Reply-To: <7v1wrfu3tl.fsf@assigned-by-dhcp.cox.net>
On 8/17/06, Junio C Hamano <junkio@cox.net> wrote:
> >> Are you by any chance running a version of git that has some
> >> unofficial patches that affect the generation of not-for-merge
> >> markers?
> >
> > No, I just reproduced this on plain 1.4.2.
>
> Doesn't reproduce for me and I am getting worried.
> Has anybody else seen this?
>
I haven't. Michael, could you retry with "GIT_TRACE=1 sh -x -v git-pull" ?
I suspect invisible (like \r) character in your remotes. Missing last \n could
be interesting too.
^ permalink raw reply
* Re: [PATCH] remove inline iteration variable
From: Alex Riesen @ 2006-08-17 9:11 UTC (permalink / raw)
To: David Rientjes; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0608161441070.29566@chino.corp.google.com>
On 8/16/06, David Rientjes <rientjes@google.com> wrote:
> > > > > Remove unnecessary iteration variable in inline.
> > > > > - for (i = 0; i < in; i++) putchar(' ');
> > > > > + for (; in > 0; in--)
> > > >
> > > > while(in--) putchar(' ');
> > > >
> > >
> > > That goes into an infinite loop if the argument is negative because
> > > it emits a cmpl $0, x(%ebp). Should never happen, but there's no
> > > reason not to prevent it with a for loop.
> >
> > while (in-- > 0) putchar(' ');
> >
> > still shorter :)
> >
>
> It emits a slightly rearranged assembly with the same number of instructions.
>
oops. I should've looked at the output. But the point moot anyway, Junio says :)
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox