From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Kumar Sunkara Subject: [PATCHv2] git-instaweb: Add option to reuse previous config file Date: Wed, 2 Jun 2010 03:29:49 +0530 Message-ID: <1275429589-30634-1-git-send-email-pavan.sss1991@gmail.com> Cc: Pavan Kumar Sunkara To: git@vger.kernel.org, jnareb@gmail.com, chriscool@tuxfamily.org, pasky@ucw.cz X-From: git-owner@vger.kernel.org Wed Jun 02 00:00:30 2010 connect(): No such file or directory Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OJZVb-00071M-TT for gcvg-git-2@lo.gmane.org; Wed, 02 Jun 2010 00:00:28 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757497Ab0FAWAA (ORCPT ); Tue, 1 Jun 2010 18:00:00 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:64598 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757338Ab0FAV76 (ORCPT ); Tue, 1 Jun 2010 17:59:58 -0400 Received: by pwj2 with SMTP id 2so1399441pwj.19 for ; Tue, 01 Jun 2010 14:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=ic8zuwefiZ4xGa/UXnOZc4FIbPxGZkRnTPNVHJBfggg=; b=w/JUOeVQvz0DD7aDx7ShGiA9ZFkX/Z+lMGBwPCONu+dweB9vyXE7oQMTLzSQRfDTI1 AttV1nw+ePP4ntA+KO4c0KmKeugoaZ+O00WkQV15GwwTpxRt9tKPewvPK0/W4F9Qli4T vgIPb3K1WBh6xdPwQhNFegbjq9we7dO0xLJUk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=R1xYJT+hPkXV9lS+1s5Vwfs9moS9sFlGUMmX2Z+vyKPETe/CL56E5x1wjtBfmQI7R+ T/WHBmmT17tb4GsjyaZfskp4YdgNEnJmxSEo51/upbvERU4BtDskyxVnrOuSjVyIC6lz ve6jy6MhtkirSWPKfuGfStFz7VzxubL7909HE= Received: by 10.140.55.13 with SMTP id d13mr5310575rva.119.1275429597806; Tue, 01 Jun 2010 14:59:57 -0700 (PDT) Received: from localhost.localdomain ([202.63.112.23]) by mx.google.com with ESMTPS id b10sm5648992rvn.3.2010.06.01.14.59.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Jun 2010 14:59:57 -0700 (PDT) X-Mailer: git-send-email 1.7.1.443.g62265.dirty Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Add an option to git-instaweb which allows the usage of the old gitweb_config.perl situated in '.git/gitweb' dir. When the option is in use, gitweb_config.perl generated by git-instaweb won't be overwritten. Usage: git instaweb --reuse-config Example: When I use git-instaweb, it is tiring to add customised configuration (like highlight featues enabling) to the gitweb_config.perl file everytime I initiate the server. With this,it's enough to use this option. Signed-off-by: Pavan Kumar Sunkara --- Documentation/git-instaweb.txt | 5 ++++- git-instaweb.sh | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt index 2c3c4d2..0e7e20b 100644 --- a/Documentation/git-instaweb.txt +++ b/Documentation/git-instaweb.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git instaweb' [--local] [--httpd=] [--port=] - [--browser=] + [--browser=] [--reuse-config] 'git instaweb' [--start] [--stop] [--restart] DESCRIPTION @@ -49,6 +49,9 @@ OPTIONS linkgit:git-web--browse[1] for more information about this. If the script fails, the URL will be printed to stdout. +--reuse-config:: + The previous gitweb_config.perl will not be overwritten. + --start:: Start the httpd instance and exit. This does not generate any of the configuration files for spawning a new instance. diff --git a/git-instaweb.sh b/git-instaweb.sh index 1af4d5a..1c704a3 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -13,6 +13,7 @@ p,port= the port to bind to d,httpd= the command to launch b,browser= the browser to launch m,module-path= the module path (only needed for apache2) +reuse-config reuse previous gitweb_config.perl from GIT_DIR Action stop stop the web server start start the web server @@ -27,6 +28,7 @@ httpd="$(git config --get instaweb.httpd)" root="$(git config --get instaweb.gitwebdir)" port=$(git config --get instaweb.port) module_path="$(git config --get instaweb.modulepath)" +no_reuse=true conf="$GIT_DIR/gitweb/httpd.conf" @@ -171,6 +173,10 @@ do shift module_path="$1" ;; + --reuse-config) + shift + no_reuse=false + ;; --) ;; *) @@ -551,7 +557,7 @@ our \$projects_list = \$projectroot; EOF } -gitweb_conf +test "$no_reuse" = true || test ! -e "$GITWEB_CONFIG" && gitweb_conf resolve_full_httpd mkdir -p "$fqgitdir/gitweb/$httpd_only" -- 1.7.1.443.g62265.dirty