Git development
 help / color / mirror / Atom feed
* Re: FEATURE REQUEST: Allow SSH style URLS (with extra colon)
From: Petr Baudis @ 2010-01-30 22:21 UTC (permalink / raw)
  To: Jari Aalto; +Cc: git
In-Reply-To: <87tyu3cyy3.fsf@jondo.cante.net>

On Sat, Jan 30, 2010 at 06:57:56PM +0200, Jari Aalto wrote:
> 
> According to git-clone[1] the SSH protocol is specied as:
> 
>     ssh://[user@]host.xz[:port]/path
> 
> It woudl be nice if the ":" were allowed, so that the familiar SSH style
> patch notation could be used, making the spec:
> 
>     ssh://[user@]host.xz[:[port]]/path
> 
> An example:
> 
>     ssh://foo@examplecom:/path
>                         |
>                         Allowed

But that's not an URL anymore. If you want to use ssh pathspec, write it
as a pathspec, not an URL. Just foo@example.com:/path works fine. ;-)

				Petr "Pasky" Baudis

^ permalink raw reply

* Re: [RFH] rpm packaging failure
From: Junio C Hamano @ 2010-01-30 22:22 UTC (permalink / raw)
  To: Todd Zullinger; +Cc: git, Johan Herland, Sverre Rabbelier
In-Reply-To: <20100130194746.GN29188@inocybe.localdomain>

Todd Zullinger <tmz@pobox.com> writes:

> Not shipping them if they aren't yet used/needed for anything other
> than folks working on remote helpers seems reasonable and the rm in
> the spec file should do the trick nicely.

Thanks.

To allow us to go forward a bit easier, I am planning to use the attached,
as we would need some parts of it when we do start generating a separate
package, I think.

-- >8 --
Subject: [PATCH] RPM packaging: don't include foreign-scm-helper bits yet

The files in /usr/lib/python* are only the support infrastructure for
foreign scm interface yet to be written and/or shipped with git.  Don't
include them in the binary package (this will also free us from Python
dependency).

When we ship with foreign scm interface, we will need to package these
files with it in a separate subpackage, but we are not there yet.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 git.spec.in |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/git.spec.in b/git.spec.in
index ab224f7..0a03108 100644
--- a/git.spec.in
+++ b/git.spec.in
@@ -98,6 +98,7 @@ BuildRequires:  perl(Error)
 Perl interface to Git
 
 %define path_settings ETC_GITCONFIG=/etc/gitconfig prefix=%{_prefix} mandir=%{_mandir} htmldir=%{_docdir}/%{name}-%{version}
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 %prep
 %setup -q
@@ -112,6 +113,7 @@ rm -rf $RPM_BUILD_ROOT
 make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \
      %{path_settings} \
      INSTALLDIRS=vendor install %{!?_without_docs: install-doc}
+test ! -d $RPM_BUILD_ROOT%{python_sitelib} || rm -fr $RPM_BUILD_ROOT%{python_sitelib}
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
 find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'
 find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'
@@ -190,6 +192,9 @@ rm -rf $RPM_BUILD_ROOT
 # No files for you!
 
 %changelog
+* Sat Jan 30 2010 Junio C Hamano <gitster@pobox.com>
+- We don't ship Python bits until a real foreign scm interface comes.
+
 * Mon Feb 04 2009 David J. Mellor <dmellor@whistlingcat.com>
 - fixed broken git help -w after renaming the git-core package to git.
 
-- 
1.7.0.rc1.141.gd3fd2

^ permalink raw reply related

* Re: FEATURE REQUEST: Allow SSH style URLS (with extra colon)
From: Junio C Hamano @ 2010-01-30 22:30 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Jari Aalto, git
In-Reply-To: <20100130222157.GI9553@machine.or.cz>

Petr Baudis <pasky@suse.cz> writes:

> On Sat, Jan 30, 2010 at 06:57:56PM +0200, Jari Aalto wrote:
>> 
>> An example:
>> 
>>     ssh://foo@examplecom:/path
>>                         |
>>                         Allowed
>
> But that's not an URL anymore. If you want to use ssh pathspec, write it
> as a pathspec, not an URL. Just foo@example.com:/path works fine. ;-)

The way URLs are defined is:

	<scheme>:<scheme-specific-part>

so if somebody defines his "ssh" scheme to allow any random garbage, its
their URL and you cannot say "that is not an URL", unless you qualify your
statement with "I want to keep ssh scheme consistent with the common
internet scheme syntax".

As I think "ssh://..." is simply moronic, I don't even care to "keep" the
scheme specific part consistent with the common internet scheme syntax to
begin with.  I agree with your conclusion, though ;-)

scp syntax works just fine.

^ permalink raw reply

* [PATCH 0/8] Miscelanous gitweb improvements from 'Gitweb caching v5' by J.H.
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski

This series of patches consist of improved and reordered, and rebased early
parts (1-7) of "[PATCH 0/9] Gitweb caching v5" thread by John 'Warthog9'
Hawley.  Those patches are also available from
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

I have added signoff where it was missing, and changed all authorship
of patches by J.H. to use @kernel.org email address.

Pull request:
~~~~~~~~~~~~~
The following changes since commit 3a985c27fe8bb9ed2fa9580a27c4b4dd7c7192ea:
  Junio C Hamano (1):
        Update draft release notes to 1.7.0

are available in the git repository at:

  git://repo.or.cz/git/jnareb-git.git gitweb/gitweb-ml-v5

Table of contents:
~~~~~~~~~~~~~~~~~~
 [PATCH 1/8] gitweb: Make running t9501 test with '--debug' reliable and usable
 [PATCH 2/8] gitweb: Load checking
 [PATCH 3/8] gitweb: Makefile improvements
 [PATCH 4/8] gitweb: Check that $site_header etc. are defined before using them
 [PATCH 5/8] gitweb: add a get function to compliment print_local_time
 [PATCH 6/8] gitweb: add a get function to compliment print_sort_th
 [PATCH 7/8] gitweb: Add optional extra parameter to die_error, for extended explanation
 [PATCH 8/8] gitweb: Add an option to force version match

First patch in series is my addition, made to be able to run t9501 test in
'debug' mode without it screwing terminal due to dumping (binary!) snapshot
to it.  All patches in series passes t9500, t9501 and t9502; it allowed to
find bugs in their implementation.

I have reordered patches so those that are less controversial and more
ready to be applied come first, and those that are a bit controversial and
perhaps less ready later (and also later those patches that introduce new
feature without any user for it).

The patches 5 and 6 "add a get function" introduce new format_* functions
which do not have yet any user in gitweb.

Patch 7 "optional extra parameter to die_error" is used only in patch 8,
but it would be I think good feature to have anyway.

In patch 8 the $git_versions_must_match variable is again set to 0 (off) by
default; Pasky's complaint in
  Message-ID: <20100124215924.GA9553@machine.or.cz>
  http://permalink.gmane.org/gmane.comp.version-control.git/137922
made me notice (see my reply to it) that it could be very hard to explain
how to setup gitweb to turn this feature off, in some rare cases.  So it is
again off, and with more detailed explanation of an error.

Note that like 'Gitweb caching v5' thread this series is missing
  gitweb: Optionally add "git" links in project list page
that was present in 'Gitweb caching v2' and 'Miscelanous gitweb
improvements from J.H.' threads.

Diffstat:
~~~~~~~~~
 Makefile                                 |   65 +++------------
 gitweb/Makefile                          |  129 ++++++++++++++++++++++++++++++
 gitweb/README                            |   12 +++-
 gitweb/gitweb.perl                       |  121 ++++++++++++++++++++++++----
 t/gitweb-lib.sh                          |    2 +
 t/t9501-gitweb-standalone-http-status.sh |   57 ++++++++++++-
 6 files changed, 309 insertions(+), 77 deletions(-)
 create mode 100644 gitweb/Makefile

-- 
Jakub Narebski
Poland

^ permalink raw reply

* [PATCH 1/8 v1] gitweb: Make running t9501 test with '--debug' reliable and usable
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

Remove test_debug lines after 'snapshots: tgz only default format
enabled' and 'snapshots: all enabled in default, use default disabled
value' tests.  Those tests constitute of multiple gitweb_run
invocation, therefore outputting gitweb.output for the last gitweb_run
wouldn't help much in debugging test failure, and can only confuse.

For snapshot tests which check for "200 OK" status, change
  test_debug 'cat gitweb.output'
to
  test_debug 'cat gitweb.headers'
Otherwise when running this test with '--debug' option,
t/t9501-gitweb-standalone-http-status.sh would dump *binary data* (the
snapshot itself) to standard output, which can mess up state of terminal
due to term control characters which can be embedded in output.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch appears in this series for the first time.

I have decided against cleaning up t/t9501-gitweb-standalone-http-status.sh
by conforming to single style of quoting and whitespaces, and by putting 
initial test_commit inside test_expect_success setup.  This is the minimal
change.

 t/t9501-gitweb-standalone-http-status.sh |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 0688a57..9e8bc01 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -33,7 +33,6 @@ test_expect_success \
     grep "403 - Snapshot format not allowed" gitweb.output &&
     gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
     grep "403 - Unsupported snapshot format" gitweb.output'
-test_debug 'cat gitweb.output'
 
 
 cat >>gitweb_config.perl <<\EOF
@@ -50,7 +49,6 @@ test_expect_success \
     grep "403 - Snapshot format not allowed" gitweb.output &&
     gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&
     grep "Status: 200 OK" gitweb.output'
-test_debug 'cat gitweb.output'
 
 
 cat >>gitweb_config.perl <<\EOF
@@ -72,7 +70,7 @@ test_expect_success \
     'snapshots: tgz explicitly enabled' \
     'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
     grep "Status: 200 OK" gitweb.output'
-test_debug 'cat gitweb.output'
+test_debug 'cat gitweb.headers'
 
 
 # ----------------------------------------------------------------------
@@ -82,7 +80,7 @@ test_expect_success 'snapshots: good tree-ish id' '
 	gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
-test_debug 'cat gitweb.output'
+test_debug 'cat gitweb.headers'
 
 test_expect_success 'snapshots: bad tree-ish id' '
 	gitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&
@@ -105,7 +103,7 @@ test_expect_success 'snapshots: good object id' '
 	gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
 	grep "Status: 200 OK" gitweb.output
 '
-test_debug 'cat gitweb.output'
+test_debug 'cat gitweb.headers'
 
 test_expect_success 'snapshots: bad object id' '
 	gitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 2/8 v6] gitweb: Load checking
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

This changes slightly the behavior of gitweb, so that it verifies
that the box isn't inundated with before attempting to serve gitweb.
If the box is overloaded, it basically returns a 503 Server Unavailable
until the load falls below the defined threshold.  This helps dramatically
if you have a box that's I/O bound, reaches a certain load and you
don't want gitweb, the I/O hog that it is, increasing the pain the
server is already undergoing.

This behavior is controlled by $maxload configuration variable.
Default is a load of 300, which for most cases should never be hit.
Unset it (set it to undefined value, i.e. undef) to turn off checking.

Currently it requires that '/proc/loadavg' file exists, otherwise the
load check is bypassed (load is taken to be 0).  So platforms that do
not implement '/proc/loadavg' currently cannot use this feature
(provisions are included for additional checks to be added by others).

There is simple test in t/t9501-gitweb-standalone-http-status.sh to
check that it correctly returns "503 Service Unavailable" if load is
too high, and also if there are any Perl warnings or errors.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Changes from version from 'Gitweb caching v5' and
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

* Load checking was moved after setting $git_version, as this variable
  is used in git_header_html, which in turn is used in die_error.  
  Otherwise we would get "Use of unitialized value" warning.

* In git_footer_html we check if $action is defined before comparing
  it with 'blame_incremental'.  This is first time that git_footer_html
  can be called (via die_error) with $action undefined; earlier all calls
  to git_footer_html were after dispatch, which set $action to appropriate
  default value if it was not set (actionless gitweb URL, e.g. projects
  list or project summary).  Otherise we would get "Use of unitialized
  value" warning.

* t/gitweb-lib.sh turns off load checking, just in case.

* There was added test for this feature to t9501, for the simplest case
  of $maxload set to 0.


 gitweb/README                            |    7 ++++-
 gitweb/gitweb.perl                       |   48 ++++++++++++++++++++++++++---
 t/gitweb-lib.sh                          |    1 +
 t/t9501-gitweb-standalone-http-status.sh |   22 +++++++++++++
 4 files changed, 72 insertions(+), 6 deletions(-)
 mode change 100644 => 100755 t/gitweb-lib.sh

diff --git a/gitweb/README b/gitweb/README
index e34ee79..6c2c8e1 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -174,7 +174,7 @@ not include variables usually directly set during build):
    Base URL for relative URLs in pages generated by gitweb,
    (e.g. $logo, $favicon, @stylesheets if they are relative URLs),
    needed and used only for URLs with nonempty PATH_INFO via
-   <base href="$base_url>.  Usually gitweb sets its value correctly,
+   <base href="$base_url">.  Usually gitweb sets its value correctly,
    and there is no need to set this variable, e.g. to $my_uri or "/".
  * $home_link
    Target of the home link on top of all pages (the first part of view
@@ -228,6 +228,11 @@ not include variables usually directly set during build):
    repositories from launching cross-site scripting (XSS) attacks.  Set this
    to true if you don't trust the content of your repositories. The default
    is false.
+ * $maxload
+   Used to set the maximum load that we will still respond to gitweb queries.
+   If server load exceed this value then return "503 Service Unavaliable" error.
+   Server load is taken to be 0 if gitweb cannot determine its value.  Set it to
+   undefined value to turn it off.  The default is 300.
 
 
 Projects list file format
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7e477af..e2522cc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -221,6 +221,12 @@ our %avatar_size = (
 	'double'  => 32
 );
 
+# Used to set the maximum load that we will still respond to gitweb queries.
+# If server load exceed this value then return "503 server busy" error.
+# If gitweb cannot determined server load, it is taken to be 0.
+# Leave it undefined (or set to 'undef') to turn off load checking.
+our $maxload = 300;
+
 # You define site-wide feature defaults here; override them with
 # $GITWEB_CONFIG as necessary.
 our %feature = (
@@ -551,12 +557,38 @@ if (-e $GITWEB_CONFIG) {
 	do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
 }
 
+# Get loadavg of system, to compare against $maxload.
+# Currently it requires '/proc/loadavg' present to get loadavg;
+# if it is not present it returns 0, which means no load checking.
+sub get_loadavg {
+	if( -e '/proc/loadavg' ){
+		open my $fd, '<', '/proc/loadavg'
+			or return 0;
+		my @load = split(/\s+/, scalar <$fd>);
+		close $fd;
+
+		# The first three columns measure CPU and IO utilization of the last one,
+		# five, and 10 minute periods.  The fourth column shows the number of
+		# currently running processes and the total number of processes in the m/n
+		# format.  The last column displays the last process ID used.
+		return $load[0] || 0;
+	}
+	# additional checks for load average should go here for things that don't export
+	# /proc/loadavg
+
+	return 0;
+}
+
 # version of the core git binary
 our $git_version = qx("$GIT" --version) =~ m/git version (.*)$/ ? $1 : "unknown";
 $number_of_git_cmds++;
 
 $projects_list ||= $projectroot;
 
+if (defined $maxload && get_loadavg() > $maxload) {
+	die_error(503, "The load average on the server is too high");
+}
+
 # ======================================================================
 # input validation and dispatch
 
@@ -3328,7 +3360,8 @@ sub git_footer_html {
 	}
 
 	print qq!<script type="text/javascript" src="$javascript"></script>\n!;
-	if ($action eq 'blame_incremental') {
+	if (defined $action &&
+	    $action eq 'blame_incremental') {
 		print qq!<script type="text/javascript">\n!.
 		      qq!startBlame("!. href(action=>"blame_data", -replay=>1) .qq!",\n!.
 		      qq!           "!. href() .qq!");\n!.
@@ -3354,14 +3387,19 @@ sub git_footer_html {
 # 500: The server isn't configured properly, or
 #      an internal error occurred (e.g. failed assertions caused by bugs), or
 #      an unknown error occurred (e.g. the git binary died unexpectedly).
+# 503: The server is currently unavailable (because it is overloaded,
+#      or down for maintenance).  Generally, this is a temporary state.
 sub die_error {
 	my $status = shift || 500;
 	my $error = shift || "Internal server error";
 
-	my %http_responses = (400 => '400 Bad Request',
-			      403 => '403 Forbidden',
-			      404 => '404 Not Found',
-			      500 => '500 Internal Server Error');
+	my %http_responses = (
+		400 => '400 Bad Request',
+		403 => '403 Forbidden',
+		404 => '404 Not Found',
+		500 => '500 Internal Server Error',
+		503 => '503 Service Unavailable',
+	);
 	git_header_html($http_responses{$status});
 	print <<EOF;
 <div class="page_body">
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
old mode 100644
new mode 100755
index 76d8b7b..5a734b1
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -25,6 +25,7 @@ our \$favicon = 'file:///$TEST_DIRECTORY/../gitweb/git-favicon.png';
 our \$projects_list = '';
 our \$export_ok = '';
 our \$strict_export = '';
+our \$maxload = undef;
 
 EOF
 
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 9e8bc01..7590f10 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -112,4 +112,26 @@ test_expect_success 'snapshots: bad object id' '
 test_debug 'cat gitweb.output'
 
 
+# ----------------------------------------------------------------------
+# load checking
+
+# always hit the load limit
+cat >>gitweb_config.perl <<\EOF
+our $maxload = 0;
+EOF
+
+test_expect_success 'load checking: load too high (default action)' '
+	gitweb_run "p=.git" &&
+	grep "Status: 503 Service Unavailable" gitweb.headers &&
+	grep "503 - The load average on the server is too high" gitweb.body
+'
+test_debug 'cat gitweb.log' # just in case
+test_debug 'cat gitweb.headers'
+
+# turn off load checking
+cat >>gitweb_config.perl <<\EOF
+our $maxload = undef;
+EOF
+
+
 test_done
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 4/8 v6] gitweb: Check that $site_header etc. are defined before using them
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

If one of $site_header, $site_footer or $home_text is not defined you
get extraneous errors in the web logs, for example (line wrapped for
better readibility):

 [Wed Jan 13 16:55:42 2010] [error] [client ::1] [Wed Jan 13 16:55:42 2010]
 gitweb.cgi: Use of uninitialized value $site_header in -f at
 /var/www/gitweb/gitweb.cgi line 3287., referer: http://git/gitweb.cgi

This ensures that those variables are defined before trying to use it.

Note that such error can happen only because of an error in gitweb
config file; building gitweb.cgi can make mentioned variables holding
empty string (it is even the default), but they not undefined.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Changes from version from 'Gitweb caching v5' and
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

* Check explicitly that $site_header is defined, and not only that it
  is false-ish
* Check also for $site_footer and $home_text being defined
* Slightly more detailed commit message


I have decided not to protect against undefined $projects_list, as
such check would have to be more complicated and quite different from
checks for $site_header, $site_footer and $home_text.

Note that it is purely defensive programming, as this should not
happen unless there are very strange errors in gitweb config file.

 gitweb/gitweb.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e2522cc..a4148d3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3254,7 +3254,7 @@ EOF
 	print "</head>\n" .
 	      "<body>\n";
 
-	if (-f $site_header) {
+	if (defined $site_header && -f $site_header) {
 		insert_file($site_header);
 	}
 
@@ -3355,7 +3355,7 @@ sub git_footer_html {
 		print "</div>\n"; # class="page_footer"
 	}
 
-	if (-f $site_footer) {
+	if (defined $site_footer && -f $site_footer) {
 		insert_file($site_footer);
 	}
 
@@ -4781,7 +4781,7 @@ sub git_project_list {
 	}
 
 	git_header_html();
-	if (-f $home_text) {
+	if (defined $home_text && -f $home_text) {
 		print "<div class=\"index_include\">\n";
 		insert_file($home_text);
 		print "</div>\n";
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 3/8 v6] gitweb: Makefile improvements
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

This commit adjust the main Makefile so you can simply run

     make gitweb

which in turn calls gitweb/Makefile.  This means that in order to
generate gitweb, you can simply run 'make' from gitweb subdirectory:

     cd gitweb
     make

Targets gitweb/gitweb.cgi and (dependent on JSMIN being defined)
gitweb/gitweb.min.js in main Makefile are preserved for backward
compatibility.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is unchanged from the version from 'Gitweb caching v5':
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

 Makefile        |   65 +++++----------------------
 gitweb/Makefile |  129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 141 insertions(+), 53 deletions(-)
 create mode 100644 gitweb/Makefile

diff --git a/Makefile b/Makefile
index af08c8f..eb0fffb 100644
--- a/Makefile
+++ b/Makefile
@@ -278,29 +278,6 @@ pathsep = :
 # JavaScript minifier invocation that can function as filter
 JSMIN =
 
-# default configuration for gitweb
-GITWEB_CONFIG = gitweb_config.perl
-GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
-GITWEB_HOME_LINK_STR = projects
-GITWEB_SITENAME =
-GITWEB_PROJECTROOT = /pub/git
-GITWEB_PROJECT_MAXDEPTH = 2007
-GITWEB_EXPORT_OK =
-GITWEB_STRICT_EXPORT =
-GITWEB_BASE_URL =
-GITWEB_LIST =
-GITWEB_HOMETEXT = indextext.html
-GITWEB_CSS = gitweb.css
-GITWEB_LOGO = git-logo.png
-GITWEB_FAVICON = git-favicon.png
-ifdef JSMIN
-GITWEB_JS = gitweb.min.js
-else
-GITWEB_JS = gitweb.js
-endif
-GITWEB_SITE_HEADER =
-GITWEB_SITE_FOOTER =
-
 export prefix bindir sharedir sysconfdir
 
 CC = gcc
@@ -1538,6 +1515,11 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
 	chmod +x $@+ && \
 	mv $@+ $@
 
+
+.PHONY: gitweb
+gitweb:
+	$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
+
 ifdef JSMIN
 OTHER_PROGRAMS += gitweb/gitweb.cgi   gitweb/gitweb.min.js
 gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
@@ -1545,30 +1527,13 @@ else
 OTHER_PROGRAMS += gitweb/gitweb.cgi
 gitweb/gitweb.cgi: gitweb/gitweb.perl
 endif
-	$(QUIET_GEN)$(RM) $@ $@+ && \
-	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-	    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
-	    -e 's|++GIT_BINDIR++|$(bindir)|g' \
-	    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
-	    -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
-	    -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
-	    -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
-	    -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
-	    -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
-	    -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
-	    -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
-	    -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
-	    -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
-	    -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
-	    -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
-	    -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
-	    -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
-	    -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
-	    -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
-	    -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
-	    $< >$@+ && \
-	chmod +x $@+ && \
-	mv $@+ $@
+	$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
+
+ifdef JSMIN
+gitweb/gitweb.min.js: gitweb/gitweb.js
+	$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
+endif # JSMIN
+
 
 git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js
 	$(QUIET_GEN)$(RM) $@ $@+ && \
@@ -1595,12 +1560,6 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
 	mv $@+ $@
 endif # NO_PERL
 
-
-ifdef JSMIN
-gitweb/gitweb.min.js: gitweb/gitweb.js
-	$(QUIET_GEN)$(JSMIN) <$< >$@
-endif # JSMIN
-
 ifndef NO_PYTHON
 $(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS
 $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
diff --git a/gitweb/Makefile b/gitweb/Makefile
new file mode 100644
index 0000000..c9eb1ee
--- /dev/null
+++ b/gitweb/Makefile
@@ -0,0 +1,129 @@
+# The default target of this Makefile is...
+all::
+
+# Define V=1 to have a more verbose compile.
+#
+# Define JSMIN to point to JavaScript minifier that functions as
+# a filter to have gitweb.js minified.
+#
+
+prefix ?= $(HOME)
+bindir ?= $(prefix)/bin
+RM ?= rm -f
+
+# JavaScript minifier invocation that can function as filter
+JSMIN ?=
+
+# default configuration for gitweb
+GITWEB_CONFIG = gitweb_config.perl
+GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
+GITWEB_HOME_LINK_STR = projects
+GITWEB_SITENAME =
+GITWEB_PROJECTROOT = /pub/git
+GITWEB_PROJECT_MAXDEPTH = 2007
+GITWEB_EXPORT_OK =
+GITWEB_STRICT_EXPORT =
+GITWEB_BASE_URL =
+GITWEB_LIST =
+GITWEB_HOMETEXT = indextext.html
+GITWEB_CSS = gitweb.css
+GITWEB_LOGO = git-logo.png
+GITWEB_FAVICON = git-favicon.png
+ifdef JSMIN
+GITWEB_JS = gitweb.min.js
+else
+GITWEB_JS = gitweb.js
+endif
+GITWEB_SITE_HEADER =
+GITWEB_SITE_FOOTER =
+
+# include user config
+-include ../config.mak.autogen
+-include ../config.mak
+
+# determine version
+../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
+	$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
+
+-include ../GIT-VERSION-FILE
+
+### Build rules
+
+SHELL_PATH ?= $(SHELL)
+PERL_PATH  ?= /usr/bin/perl
+
+# Shell quote;
+bindir_SQ = $(subst ','\'',$(bindir))         #'
+SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) #'
+PERL_PATH_SQ  = $(subst ','\'',$(PERL_PATH))  #'
+
+# Quiet generation (unless V=1)
+QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
+QUIET_SUBDIR1  =
+
+ifneq ($(findstring $(MAKEFLAGS),w),w)
+PRINT_DIR = --no-print-directory
+else # "make -w"
+NO_SUBDIR = :
+endif
+
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifndef V
+	QUIET          = @
+	QUIET_GEN      = $(QUIET)echo '   ' GEN $@;
+	QUIET_SUBDIR0  = +@subdir=
+	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
+	                 $(MAKE) $(PRINT_DIR) -C $$subdir
+	export V
+	export QUIET
+	export QUIET_GEN
+	export QUIET_SUBDIR0
+	export QUIET_SUBDIR1
+endif
+endif
+
+all:: gitweb.cgi
+
+ifdef JSMIN
+FILES=gitweb.cgi gitweb.min.js
+gitweb.cgi: gitweb.perl gitweb.min.js
+else # !JSMIN
+FILES=gitweb.cgi
+gitweb.cgi: gitweb.perl
+endif # JSMIN
+
+gitweb.cgi:
+	$(QUIET_GEN)$(RM) $@ $@+ && \
+	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
+	    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
+	    -e 's|++GIT_BINDIR++|$(bindir)|g' \
+	    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
+	    -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
+	    -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
+	    -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
+	    -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
+	    -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
+	    -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
+	    -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
+	    -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
+	    -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
+	    -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
+	    -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
+	    -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
+	    -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
+	    -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
+	    -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
+	    -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
+	    $< >$@+ && \
+	chmod +x $@+ && \
+	mv $@+ $@
+
+ifdef JSMIN
+gitweb.min.js: gitweb.js
+	$(QUIET_GEN)$(JSMIN) <$< >$@
+endif # JSMIN
+
+clean:
+	$(RM) $(FILES)
+
+.PHONY: all clean .FORCE-GIT-VERSION-FILE
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 7/8 v6] gitweb: Add optional extra parameter to die_error, for extended explanation
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

This is a small change that just adds a 3rd, optional, parameter to die_error
that allows for extended error information to be output along with what the
error was.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Changes from version from 'Gitweb caching v5' and
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

* Slightly changed commit summary (commit description).
* Align with spaces, instead of indenting with tab

Those changes are purely cosmetic; the commit is practically unchanged
from the version by J.H.

 gitweb/gitweb.perl |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 466fa8a..d0c3ff2 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3392,6 +3392,7 @@ sub git_footer_html {
 sub die_error {
 	my $status = shift || 500;
 	my $error = shift || "Internal server error";
+	my $extra = shift;
 
 	my %http_responses = (
 		400 => '400 Bad Request',
@@ -3406,8 +3407,13 @@ sub die_error {
 <br /><br />
 $status - $error
 <br />
-</div>
 EOF
+	if (defined $extra) {
+		print "<hr />\n" .
+		      "$extra\n";
+	}
+	print "</div>\n";
+
 	git_footer_html();
 	exit;
 }
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 8/8 v6] gitweb: Add an option to force version match
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

This adds $git_versions_must_match variable, which if set to true,
checks that we are running on the same version of git that we
shipped with, and if not throw '500 Internal Server Error' error.
What is checked is the version of gitweb (embedded in building
gitweb.cgi), against version of runtime git binary used.

Gitweb can usually run with a mismatched git install.  This is more
here to give an obvious warning as to what's going on vs. silently
failing.

By default this feature is turned off.

Add tests to t9501-gitweb-standalone-http-status.sh that this feature
works correctly (as expected) if turned on, both in match and no match
case.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Changes from version from 'Gitweb caching v5' and
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

* Again turned off by default
* More detailed error description, as requested by Petr 'Pasky' Baudis
  in http://permalink.gmane.org/gmane.comp.version-control.git/137922
* Which in turn required to set $GITWEB_CONFIG_SYSTEM to be able to
  use its value in error description; otherwise we would get 'Variable 
  "$GITWEB_CONFIG_SYSTEM" is not imported' error.
* Turn off forcing version matching in t/gitweb-lib.sh
* Add some tests for this feature in t9501-gitweb-standalone-http-status.sh

 gitweb/README                            |    5 +++++
 gitweb/gitweb.perl                       |   29 ++++++++++++++++++++++++++++-
 t/gitweb-lib.sh                          |    1 +
 t/t9501-gitweb-standalone-http-status.sh |   27 +++++++++++++++++++++++++++
 4 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/gitweb/README b/gitweb/README
index 6c2c8e1..83a25a9 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -233,6 +233,11 @@ not include variables usually directly set during build):
    If server load exceed this value then return "503 Service Unavaliable" error.
    Server load is taken to be 0 if gitweb cannot determine its value.  Set it to
    undefined value to turn it off.  The default is 300.
+ * $git_versions_must_match
+   If set to true value, gitweb fails with "500 Internal Server Error" error
+   if the version of the gitweb doesn't match version of the git binary.
+   Gitweb can usually run with a mismatched git install.   The default is 0
+   (false).
 
 
 Projects list file format
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d0c3ff2..e69efeb 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -221,6 +221,9 @@ our %avatar_size = (
 	'double'  => 32
 );
 
+# If it is true, exit if gitweb version and git binary version don't match
+our $git_versions_must_match = 0;
+
 # Used to set the maximum load that we will still respond to gitweb queries.
 # If server load exceed this value then return "503 server busy" error.
 # If gitweb cannot determined server load, it is taken to be 0.
@@ -550,10 +553,10 @@ sub filter_snapshot_fmts {
 }
 
 our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
+our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
 if (-e $GITWEB_CONFIG) {
 	do $GITWEB_CONFIG;
 } else {
-	our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
 	do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
 }
 
@@ -583,6 +586,30 @@ sub get_loadavg {
 our $git_version = qx("$GIT" --version) =~ m/git version (.*)$/ ? $1 : "unknown";
 $number_of_git_cmds++;
 
+# Throw an error if git versions does not match, if $git_versions_must_match is true.
+if ($git_versions_must_match &&
+    $git_version ne $version) {
+	my $admin_contact =
+		defined $ENV{'SERVER_ADMIN'} ? ", $ENV{'SERVER_ADMIN'}," : '';
+	my $err_msg = <<EOT;
+<h1 align="center">*** Warning ***</h1>
+<p>
+This version of gitweb was compiled for <b>@{[esc_html($version)]}</b>,
+however git version <b>@{[esc_html($git_version)]}</b> was found on server,
+and administrator requested strict version checking by setting
+\$git_versions_must_match to @{[esc_html($git_versions_must_match)]}
+(true value) in gitweb configuration file,
+'@{[esc_path(-e $GITWEB_CONFIG ? $GITWEB_CONFIG : $GITWEB_CONFIG_SYSTEM)]}'.
+</p>
+<p>
+Please contact the server administrator${admin_contact} to either configure
+gitweb to allow mismatched versions, or update git or gitweb installation
+so that their versions do match.
+</p>
+EOT
+	die_error(500, 'Internal server error', $err_msg);
+}
+
 $projects_list ||= $projectroot;
 
 if (defined $maxload && get_loadavg() > $maxload) {
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 5a734b1..66a3e2d 100755
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -26,6 +26,7 @@ our \$projects_list = '';
 our \$export_ok = '';
 our \$strict_export = '';
 our \$maxload = undef;
+our \$git_versions_must_match = 0;
 
 EOF
 
diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh
index 7590f10..e195f97 100755
--- a/t/t9501-gitweb-standalone-http-status.sh
+++ b/t/t9501-gitweb-standalone-http-status.sh
@@ -133,5 +133,32 @@ cat >>gitweb_config.perl <<\EOF
 our $maxload = undef;
 EOF
 
+# ======================================================================
+# check $git_versions_must_match feature
+# should be last section, just in case
+cp -f gitweb_config.perl gitweb_config.perl.bak
+echo 'our $git_versions_must_match = 1;' >>gitweb_config.perl
+
+cat <<\EOF >>gitweb_config.perl
+our $version = "current";
+EOF
+test_expect_success 'force version match: no match' '
+	gitweb_run "p=.git" &&
+	grep "Status: 500 Internal Server Error" gitweb.headers &&
+	grep "500 - Internal server error" gitweb.body
+'
+test_debug 'cat gitweb.headers'
+
+cat <<\EOF >>gitweb_config.perl
+# must be kept in sync with code in gitweb/gitweb.perl
+our $version = qx("$GIT" --version) =~ m/git version (.*)$/ ? $1 : "unknown";
+EOF
+test_expect_success 'force version match: match' '
+	gitweb_run "p=.git" &&
+	grep "Status: 200 OK" gitweb.headers
+'
+test_debug 'cat gitweb.headers'
+
+mv -f gitweb_config.perl.bak gitweb_config.perl
 
 test_done
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 6/8 v6] gitweb: add a get function to compliment print_sort_th
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

This adds a get function (named format_sort_th) for print_sort_th,
so that the basic function can be used outside of their straight
printing operation.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Changes from version from 'Gitweb caching v5' and
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

* Change function name from get_* to format_*, following gitweb
  subroutine naming convention.

 gitweb/gitweb.perl |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index debaf55..466fa8a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4347,17 +4347,24 @@ sub fill_project_list_info {
 # print 'sort by' <th> element, generating 'sort by $name' replay link
 # if that order is not selected
 sub print_sort_th {
+	print format_sort_th(@_);
+}
+
+sub format_sort_th {
 	my ($name, $order, $header) = @_;
+	my $sort_th = "";
 	$header ||= ucfirst($name);
 
 	if ($order eq $name) {
-		print "<th>$header</th>\n";
+		$sort_th .= "<th>$header</th>\n";
 	} else {
-		print "<th>" .
-		      $cgi->a({-href => href(-replay=>1, order=>$name),
-		               -class => "header"}, $header) .
-		      "</th>\n";
+		$sort_th .= "<th>" .
+		            $cgi->a({-href => href(-replay=>1, order=>$name),
+		                     -class => "header"}, $header) .
+		            "</th>\n";
 	}
+
+	return $sort_th;
 }
 
 sub git_project_list_body {
-- 
1.6.6.1

^ permalink raw reply related

* [PATCH 5/8 v6] gitweb: add a get function to compliment print_local_time
From: Jakub Narebski @ 2010-01-30 22:30 UTC (permalink / raw)
  To: git
  Cc: John 'Warthog9' Hawley, John 'Warthog9' Hawley,
	Petr Baudis, Jakub Narebski
In-Reply-To: <1264890645-28310-1-git-send-email-jnareb@gmail.com>

From: John 'Warthog9' Hawley <warthog9@kernel.org>

This adds a get function (named format_local_time) for print_local_time,
so that the basic function can be used outside of their straight printing
operation.

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Changes from version from 'Gitweb caching v5' and
  git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v5

* Change function name from get_* to format_*, following gitweb
  subroutine naming convention.
* Add final ';'

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

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a4148d3..debaf55 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3509,14 +3509,21 @@ sub git_print_header_div {
 }
 
 sub print_local_time {
+	print format_local_time(@_);
+}
+
+sub format_local_time {
+	my $localtime = '';
 	my %date = @_;
 	if ($date{'hour_local'} < 6) {
-		printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
+		$localtime .= sprintf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
 			$date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
 	} else {
-		printf(" (%02d:%02d %s)",
+		$localtime .= sprintf(" (%02d:%02d %s)",
 			$date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
 	}
+
+	return $localtime;
 }
 
 # Outputs the author name and date in long form
-- 
1.6.6.1

^ permalink raw reply related

* [ANNOUNCE] Git 1.7.0.rc1
From: Junio C Hamano @ 2010-01-30 22:53 UTC (permalink / raw)
  To: git

A release candidate Git 1.7.0.rc1 is available at the usual places
for testing:

  http://www.kernel.org/pub/software/scm/git/

  git-1.7.0.rc1.tar.{gz,bz2}			(source tarball)
  git-htmldocs-1.7.0.rc1.tar.{gz,bz2}		(preformatted docs)
  git-manpages-1.7.0.rc1.tar.{gz,bz2}		(preformatted docs)

The RPM binary packages for a few architectures are found in:

  testing/git-*-1.7.0.rc1-1.fc11.$arch.rpm	(RPM)


Git v1.7.0 Release Notes (draft)
================================

Notes on behaviour change
-------------------------

 * "git push" into a branch that is currently checked out (i.e. pointed by
   HEAD in a repository that is not bare) is refused by default.

   Similarly, "git push $there :$killed" to delete the branch $killed
   in a remote repository $there, when $killed branch is the current
   branch pointed at by its HEAD, will be refused by default.

   Setting the configuration variables receive.denyCurrentBranch and
   receive.denyDeleteCurrent to 'ignore' in the receiving repository
   can be used to override these safety features.

 * "git send-email" does not make deep threads by default when sending a
   patch series with more than two messages.  All messages will be sent
   as a reply to the first message, i.e. cover letter.

   It has been possible to configure send-email to send "shallow thread"
   by setting sendemail.chainreplyto configuration variable to false.  The
   only thing this release does is to change the default when you haven't
   configured that variable.

 * "git status" is not "git commit --dry-run" anymore.  This change does
   not affect you if you run the command without pathspec.

 * "git diff" traditionally treated various "ignore whitespace" options
   only as a way to filter the patch output.  "git diff --exit-code -b"
   exited with non-zero status even if all changes were about changing the
   ammount of whitespace and nothing else.  and "git diff -b" showed the
   "diff --git" header line for such a change without patch text.

   In this release, the "ignore whitespaces" options affect the semantics
   of the diff operation.  A change that does not affect anything but
   whitespaces is reported with zero exit status when run with
   --exit-code, and there is no "diff --git" header for such a change.


Updates since v1.6.6
--------------------

(subsystems)

 * "git fast-import" updates; adds "option" and "feature" to detect the
   mismatch between fast-import and the frontends that produce the input
   stream.

 * "git svn" support of subversion "merge tickets" and miscellaneous fixes.

 * "gitk" updates.

(portability)

 * Some more MSVC portability patches for msysgit port.

 * Minimum Pthreads emulation for msysgit port.

(performance)

 * More performance improvement patches for msysgit port.

(usability, bells and whistles)

 * More commands learned "--quiet" and "--[no-]progress" options.

 * Various commands given by the end user (e.g. diff.type.textconv,
   and GIT_EDITOR) can be specified with command line arguments.  E.g. it
   is now possible to say "[diff "utf8doc"] textconv = nkf -w".

 * "sparse checkout" feature allows only part of the work tree to be
   checked out.

 * HTTP transfer can use authentication scheme other than basic
   (i.e./e.g. digest).

 * Switching from a version of superproject that used to have a submodule
   to another version of superproject that no longer has it did not remove
   the submodule directory when it should (namely, when you are not
   interested in the submodule at all and didn't clone/checkout).

 * A new attribute conflict-marker-size can be used to change the size of
   the conflict markers from the default 7; this is useful when tracked
   contents (e.g. git-merge documentation) have strings that resemble the
   conflict markers.

 * A new syntax "<branch>@{upstream}" can be used on the command line to
   substitute the name of the "upstream" of the branch.  Missing branch
   defaults to the current branch, so "git fetch && git merge @{upstream}"
   will be equivalent to "git pull".

 * "git branch --set-upstream" can be used to update the (surprise!) upstream
   i.e. where the branch is supposed to pull and merge from (or rebase onto).

 * "git checkout A...B" is a way to detach HEAD at the merge base between
   A and B.

 * "git checkout -m path" to reset the work tree file back into the
   conflicted state works even when you already ran "git add path" and
   resolved the conflicts.

 * "git commit --date='<date>'" can be used to override the author date
   just like "git commit --author='<name> <email>'" can be used to
   override the author identity.

 * "git commit --no-status" can be used to omit the listing of the index
   and the work tree status in the editor used to prepare the log message.

 * "git commit" warns a bit more aggressively until you configure user.email,
   whose default value almost always is not (and fundamentally cannot be)
   what you want.

 * "git difftool" has been extended to make it easier to integrate it
   with gitk.

 * "git fetch --all" can now be used in place of "git remote update".

 * "git grep" does not rely on external grep anymore.  It can use more than
   one threads to accelerate the operation.

 * "git grep" learned "--no-index" option, to search inside contents that
   are not managed by git.

 * "git grep" learned "--quiet" option.

 * "git log" and friends learned "--glob=heads/*" syntax that is a more
   flexible way to complement "--branches/--tags/--remotes".

 * "git merge" learned to pass options specific to strategy-backends.  E.g.

    - "git merge -Xsubtree=path/to/directory" can be used to tell the subtree
      strategy how much to shift the trees explicitly.

    - "git merge -Xtheirs" can be used to auto-merge as much as possible,
      while discarding your own changes and taking merged version in
      conflicted regions.

 * "git push" learned "git push origin --delete branch", a syntactic sugar
   for "git push origin :branch".

 * "git push" learned "git push --set-upstream origin forker:forkee" that
   lets you configure your "forker" branch to later pull from "forkee"
   branch at "origin".

 * "git rebase --onto A...B" means the history is replayed on top of the
   merge base between A and B.

 * "git rebase -i" learned new action "fixup", that squashes the change
   but does not affect existing log message.

 * "git rebase -i" also learned --autosquash option, that is useful
   together with the new "fixup" action.

 * "git remote" learned set-url subcommand, to update (surprise!) url
   for an existing remote nickname.

 * "git rerere" learned "forget path" subcommand.  Together with "git
   checkout -m path" it will be useful when you recorded a wrong
   resolution.

 * Use of "git reset --merge" has become easier when resetting away a
   conflicted mess left in the work tree.

 * "git rerere" had rerere.autoupdate configuration but there was no way
   to countermand it from the command line; --no-rerere-autoupdate option
   given to "merge", "revert", etc. fixes this.

 * "git status" learned "-s(hort)" output format.

(developers)

 * The infrastructure to build foreign SCM interface has been updated.

 * Many more commands are now built-in.

Fixes since v1.6.6
------------------

All of the fixes in v1.6.6.X maintenance series are included in this
release, unless otherwise noted.

 * "git branch -d branch" used to refuse deleting the branch even when
   the branch is fully merged to its upstream branch if it is not merged
   to the current branch.  It now deletes it in such a case.

 * "git config -f <relative path>" run from a subdirectory misbehaved.
   65807ee (builtin-config: Fix crash when using "-f <relative path>"
   from non-root dir, 2010-01-26) may be merged to older maintenance
   branches.

 * When "git diff" is asked to compare the work tree with something,
   it used to consider that a checked-out submodule with uncommitted
   changes is not modified; this could cause people to forget committing
   these changes in the submodule before committing in the superproject.
   It now considers such a change as a modification.

^ permalink raw reply

* Re: Custom git completion
From: David Rhodes Clymer @ 2010-01-30 23:00 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20100129151127.GA21821@spearce.org>

On Fri, Jan 29, 2010 at 10:11 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
> David Rhodes Clymer <david@zettazebra.com> wrote:
>> Unless I read it incorrectly, the completion script included with
>> git-core does not make it easy for users to write completion scripts
>> for custom git commands. I can extend git itself by creating a command
>> "git-foo", and placing it in my path.
>
> git config --global alias.foo /home/me/bin/my-git-foo
>
> git foo will now complete correctly.  No need to modify the
> completion code.

This doesn't do what I want. This workaround only allows the command
name itself to be completed. I want my _custom_ completion code  to be
used for my custom command.

-davidc

^ permalink raw reply

* Re: Custom git completion
From: David Rhodes Clymer @ 2010-01-30 23:03 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git
In-Reply-To: <20100129175950.GE21821@spearce.org>

On Fri, Jan 29, 2010 at 12:59 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Junio C Hamano <gitster@pobox.com> wrote:
>>
>> How does the completion code learn what options and arguments such aliases
>> and subcommands (e.g. "git foo") take without being told?
>
> Sure.  But the patch offered by the original poster also suffered
> from this problem, it didn't know how to complete arguments for
> the subcommand.
>

My patch allows custom completion code to be called if available. I
don't expect git completion to know anything about my new command.

-davidc

^ permalink raw reply

* migrating to git: keep subversion revision numbers (as tags?)
From: fkater @ 2010-01-30 23:08 UTC (permalink / raw)
  To: git

Hi,

I would like to completely migrate from subversion to git
(and NOT have subversion enabled anymore). However, I need
to be able to lookup the old subversion revision numbers
later from the git repository. The default seems to be
though, that they are replaced by git sha-1 keys.

It would be completely o.k. here to use git tags for all
those subversion revision numbers (if possible), so, to
create a tag for each subversion revision. However, I have
neither seen any option in git nor found a script which does
that upon cloning (converting) a subversion repo into a git
repo.

Is there a way to do so?

Thank You
 Felix

^ permalink raw reply

* Re: [PATCH] bash: support user-supplied completion scripts for user's  git commands
From: David Rhodes Clymer @ 2010-01-30 23:34 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Junio C Hamano, Shawn O. Pearce, git
In-Reply-To: <20100129190642.GA31303@neumann>

2010/1/29 SZEDER Gábor <szeder@ira.uka.de>:
> The bash completion script already provides support to complete
> aliases, options and refs for aliases (if the alias can be traced back
> to a supported git command by __git_aliased_command()), and the user's
> custom git commands, but it does not support the options of the user's
> custom git commands (of course; how could it know about the options of
> a custom git command?).  Users of such custom git commands could
> extend git's bash completion script by writing functions to support
> their commands, but they might have issues with it: they might not
> have the rights to modify a system-wide git completion script, and
> they will need to track and merge upstream changes in the future.
>
> This patch addresses this by providing means for users to supply
> custom completion scriplets for their custom git commands without
> modifying the main git bash completion script.
>
> Instead of having a huge hard-coded list of command-completion
> function pairs (in _git()), the completion script will figure out
> which completion function to call based on the command's name.  That
> is, when completing the options of 'git foo', the main completion
> script will check whether the function '_git_foo' is declared, and if
> declared, it will invoke that function to perform the completion.  If
> such a function is not declared, it will fall back to complete file
> names.  So, users will only need to provide this '_git_foo' completion
> function in a separate file, source that file, and it will be used the
> next time they press TAB after 'git foo '.
>
> There are two git commands (stage and whatchanged), for which the
> completion functions of other commands were used, therefore they
> got their own completion function.
>

Excellent! This looks just like what I was after. Among other things,
this is much better than my use of awk. ;o)

-davidc

^ permalink raw reply

* Re: migrating to git: keep subversion revision numbers (as tags?)
From: Jon Seymour @ 2010-01-30 23:35 UTC (permalink / raw)
  To: fkater@googlemail.com; +Cc: git
In-Reply-To: <20100130230829.GA3544@comppasch2>

On Sun, Jan 31, 2010 at 10:08 AM, fkater@googlemail.com
<fkater@googlemail.com> wrote:
> Hi,
>
> I would like to completely migrate from subversion to git
> (and NOT have subversion enabled anymore). However, I need
> to be able to lookup the old subversion revision numbers
> later from the git repository. The default seems to be
> though, that they are replaced by git sha-1 keys.
>
> It would be completely o.k. here to use git tags for all
> those subversion revision numbers (if possible), so, to
> create a tag for each subversion revision. However, I have
> neither seen any option in git nor found a script which does
> that upon cloning (converting) a subversion repo into a git
> repo.
>
> Is there a way to do so?
>

As I understand it, git-svn stores the SVN revision number in the git
commit message and git-svn log allows queries based on the SVN
revision number. I think you will find having one tag for each SVN
revision number is an abuse of the git tag facility - it makes it much
harder to use for its intended function in git.

jon.

^ permalink raw reply

* Re: migrating to git: keep subversion revision numbers (as tags?)
From: Jacob Helwig @ 2010-01-30 23:36 UTC (permalink / raw)
  To: fkater@googlemail.com; +Cc: git
In-Reply-To: <20100130230829.GA3544@comppasch2>

On Sat, Jan 30, 2010 at 15:08, fkater@googlemail.com
<fkater@googlemail.com> wrote:
> Hi,
>
> I would like to completely migrate from subversion to git
> (and NOT have subversion enabled anymore). However, I need
> to be able to lookup the old subversion revision numbers
> later from the git repository. The default seems to be
> though, that they are replaced by git sha-1 keys.
>
> It would be completely o.k. here to use git tags for all
> those subversion revision numbers (if possible), so, to
> create a tag for each subversion revision. However, I have
> neither seen any option in git nor found a script which does
> that upon cloning (converting) a subversion repo into a git
> repo.
>
> Is there a way to do so?
>
> Thank You
>  Felix
>

There's not really any need to tag every revision with the SVN
revision number.  If you use svn-all-fast-export, or git-svn to do the
SVN -> Git conversion, then the SVN revision numbers will end up as
part of the commit message when it is in Git.

-Jacob

^ permalink raw reply

* Re: [RFH] rpm packaging failure
From: Johan Herland @ 2010-01-31  0:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Todd Zullinger, git, Sverre Rabbelier
In-Reply-To: <7vsk9nsemh.fsf@alter.siamese.dyndns.org>

On Saturday 30 January 2010, Junio C Hamano wrote:
> The files that are problematic are only infrastructure bits to support
> "remote helpers written in Python" (which we don't ship at all yet).
> 
> Once we start shipping real remote helpers, separating Python bits out
> into its own package would make a lot of sense.  People who want to use
> foreign scm helpers that happen to be written in Python would need it,
>  and all others don't.
> 
> But I suspect that a safer alternative at least for 1.7.0 would be to
> leave these files out altogether.  As I understand the current state, it
> is an unused but required package dependency on Python, a downside
>  without an upside.  Is it Ok with "remote helpers in Python" folks (I
>  think Sverre and Johan are principal parties), or did I miss some reason
>  that these need to be installed/installable, perhaps to support third
>  party packages that already exist?

AFAICS, there's no reason why these should be installed without anything 
actually using them. Although I defer to Sverre, who did the last work in 
this area.


...Johan

^ permalink raw reply

* Re: [PATCH 5/8 v6] gitweb: add a get function to compliment print_local_time
From: Junio C Hamano @ 2010-01-31  0:21 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: git, John 'Warthog9' Hawley,
	John 'Warthog9' Hawley, Petr Baudis
In-Reply-To: <1264890645-28310-6-git-send-email-jnareb@gmail.com>

Jakub Narebski <jnareb@gmail.com> writes:

> This adds a get function (named format_local_time) for print_local_time,
> so that the basic function can be used outside of their straight printing
> operation.

I didn't particularly feel like giving praise to print-local-time nor
print-sort-th, so I rewrote the log message for these two commits ;-).

    gitweb: add a "string" variant of print_local_time
    
    Add a function (named format_local_time) that returns the string that
    print_local_time would print.

Thanks.  Now I can drop GIT_SKIP_TESTS=t95?? while building 'pu'.  All
pushed out to the usual places.

^ permalink raw reply

* Re: [RFH] rpm packaging failure
From: Sverre Rabbelier @ 2010-01-31  0:56 UTC (permalink / raw)
  To: Johan Herland; +Cc: Junio C Hamano, Todd Zullinger, git
In-Reply-To: <201001310106.52303.johan@herland.net>

Heya,

On Sun, Jan 31, 2010 at 01:06, Johan Herland <johan@herland.net> wrote:
> AFAICS, there's no reason why these should be installed without anything
> actually using them. Although I defer to Sverre, who did the last work in
> this area.

Agreed, no need to package the git_remote_helpers stuff yet in 1.7.0,
since it'll be 1.7.1 at the earliest that we'll include git-remote-hg
(and even that's assuming I'll find the time to work on it).

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply

* Re: [ANNOUNCE] Git 1.7.0.rc1
From: Sverre Rabbelier @ 2010-01-31  1:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vaavvi4r5.fsf@alter.siamese.dyndns.org>

Heya,

Feel free to tell me "go build 1.7.0.rc0 yourself and see" to any of
these, but I can't right now, and am curious :).

On Sat, Jan 30, 2010 at 23:53, Junio C Hamano <gitster@pobox.com> wrote:
>  * "git checkout A...B" is a way to detach HEAD at the merge base between
>   A and B.

Does 'git checkout -b mergebase-a-b A...B' work as expected?

>  * "git log" and friends learned "--glob=heads/*" syntax that is a more
>   flexible way to complement "--branches/--tags/--remotes".

Not --glob=refs/*?

>  * "git rebase --onto A...B" means the history is replayed on top of the
>   merge base between A and B.

Oh wow, neat, I guess that complements the 'git checkout A...B'
behavior? Is there anywhere else that we could/should support this new
syntax, but don't?

>  * "git rebase -i" also learned --autosquash option, that is useful
>   together with the new "fixup" action.

Did we add a config option for this?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply

* Re: [PATCH] Make NO_PTHREADS the sole thread configuration variable
From: Nicolas Pitre @ 2010-01-31  1:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Dan McGee, git
In-Reply-To: <7vwryzqyjb.fsf@alter.siamese.dyndns.org>

On Sat, 30 Jan 2010, Junio C Hamano wrote:

> Dan McGee <dpmcgee@gmail.com> writes:
> 
> > When the first piece of threaded code was introduced in commit 8ecce684, it
> > came with its own THREADED_DELTA_SEARCH Makefile option. Since this time,
> > more threaded code has come into the codebase and a NO_PTHREADS option has
> > also been added. Get rid of the original option as the newer, more generic
> > option covers everything we need.
> 
> The patch is a good change but only in the "if it were like this from day
> one, things would have been much simpler" sense.  It is a breakage to
> existing users with customized THREADED_DELTA_SEARCH in their config.mak
> files, isn't it?

I think that the release of v1.7.0 is the perfect match for such a 
"breakage".  Unlike for the dashless move, I really doubt the majority 
of Git users are using a customized THREADED_DELTA_SEARCH in a 
config.mak if they do build Git themselves at all.  So very few people 
are likely to be inconvenienced, and yet the inconvenience can hardly be 
qualified as a breakage since nothing will stop working in any case.

> If we take only the part of your patch that applies to Makefile, but
> exclude the first hunk (description of THREADED_DELTA_SEARCH) and the last
> hunk (the necessary part to keep THREADED_DELTA_SEARCH working), and
> instead add something like:
> 
> 	ifndef NO_PTHREADS
>         	THREADED_DELTA_SEARCH = YesPlease
> 	endif
> 
> immediately before we include config.mak, would that be a workable
> solution to:
> 
>  (1) keep existing users happy;
> 
>  (2) remove the redundant logic to compute the default for two Make
>      variables; and
> 
>  (3) keep control over use of threading in general _and_ use of
>      threading in delta computation?

IMHO I wouldn't bother that much.  Simply mentioning in the 1.7.0 
release notes that THREADED_DELTA_SEARCH is no more should be fine.  
Like I said, the existing users who might be affected are certainly few, 
and the impact on them is rather trivial.


Nicolas

^ permalink raw reply

* Re: [PATCH] Make NO_PTHREADS the sole thread configuration variable
From: Dan McGee @ 2010-01-31  2:01 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Junio C Hamano, git
In-Reply-To: <alpine.LFD.2.00.1001302015120.1681@xanadu.home>

On Sat, Jan 30, 2010 at 7:29 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Sat, 30 Jan 2010, Junio C Hamano wrote:
>
>> Dan McGee <dpmcgee@gmail.com> writes:
>>
>> > When the first piece of threaded code was introduced in commit 8ecce684, it
>> > came with its own THREADED_DELTA_SEARCH Makefile option. Since this time,
>> > more threaded code has come into the codebase and a NO_PTHREADS option has
>> > also been added. Get rid of the original option as the newer, more generic
>> > option covers everything we need.
>>
>> The patch is a good change but only in the "if it were like this from day
>> one, things would have been much simpler" sense.  It is a breakage to
>> existing users with customized THREADED_DELTA_SEARCH in their config.mak
>> files, isn't it?
>
> I think that the release of v1.7.0 is the perfect match for such a
> "breakage".  Unlike for the dashless move, I really doubt the majority
> of Git users are using a customized THREADED_DELTA_SEARCH in a
> config.mak if they do build Git themselves at all.  So very few people
> are likely to be inconvenienced, and yet the inconvenience can hardly be
> qualified as a breakage since nothing will stop working in any case.
>
>> If we take only the part of your patch that applies to Makefile, but
>> exclude the first hunk (description of THREADED_DELTA_SEARCH) and the last
>> hunk (the necessary part to keep THREADED_DELTA_SEARCH working), and
>> instead add something like:
>>
>>       ifndef NO_PTHREADS
>>               THREADED_DELTA_SEARCH = YesPlease
>>       endif
>>
>> immediately before we include config.mak, would that be a workable
>> solution to:
>>
>>  (1) keep existing users happy;
>>
>>  (2) remove the redundant logic to compute the default for two Make
>>      variables; and
>>
>>  (3) keep control over use of threading in general _and_ use of
>>      threading in delta computation?
>
> IMHO I wouldn't bother that much.  Simply mentioning in the 1.7.0
> release notes that THREADED_DELTA_SEARCH is no more should be fine.
> Like I said, the existing users who might be affected are certainly few,
> and the impact on them is rather trivial.

This is everything I wanted to say as well. I just don't think this is
that big of a deal to "break compatibility" as I can think of no
reason why you would only want 2/3 of the pthreads code enabled (your
point 3). What this does do is set the precedent for any future
threads code to only use NO_PTHREADS and not introduce yet another
preprocessor define.

If this gets applied, it needs a small correction- I can resubmit, but
the only difference is this:

diff --git a/config.mak.in b/config.mak.in
index 67b12f7..6008ac9 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -56,5 +56,4 @@ NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
 FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
 SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
 NO_PTHREADS=@NO_PTHREADS@
-THREADED_DELTA_SEARCH=@THREADED_DELTA_SEARCH@
 PTHREAD_LIBS=@PTHREAD_LIBS@


-Dan

^ permalink raw reply related


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