Skip to contentSkip to conversation

Improving gitweb documentation, creating manpages

PATCH In review Jakub Narebski 4 participants 23 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

cover Improving gitweb documentation, creating manpages

This is yet a work in progress.

0. The first three patches are improvements to gitweb's INSTALL and README files, before moving or copying most of the contents to gitweb.txt and gitweb.conf.txt i.e. newly introduced gitweb's manpages.

The first two were sent to git mailing list as

[PATCH 0/2] Improving gitweb documentation
http://thread.gmane.org/gmane.comp.version-control.git/174954

Third one was sent as reply in thread mentioned above

[PATCH 3/2] gitweb: Move "Requirements" up in gitweb/INSTALL
http://thread.gmane.org/gmane.comp.version-control.git/174954/focus=175016

1. The man page for /etc/gitweb.conf is modified, extended and improved version of patch by Drew Northup from

"[PATCH/WIP] Starting work on a man page for /etc/gitweb.conf"
http://thread.gmane.org/gmane.comp.version-control.git/173422

Drew version was mostly pulled directly from the README and INSTALL files of gitweb. I have tried to incorporate comments in mentioned thread, and to group config variables by category.

This version now moves, rather than copies, contents from gitweb/README file.

2. The man page for gitweb is slightly extended version of patch I have sent to git mailing list as

"[RFC/PATCH] gitweb: Starting work on a man page for gitweb (WIP)"
http://thread.gmane.org/gmane.comp.version-control.git/173422/focus=173625

This version now moves, rather than copies, contents from gitweb/README and gitweb/INSTALL files.

......................................................................

The part that is left is turn references to chapters/sections into hyperlinks, fix and unify AsciiDoc formatting (it is quite inconsistent now), checking for leftover unintended duplication, cleaning up gitweb/README.

NOTE also that I have only tested that both generated manpages _looks_ (halfway) reasonable. I didn't check HTML output.

Those commits also available in 'gitweb/doc' branch in both of my repositories:

git://repo.or.cz/git/jnareb-git.git
git://github.com/jnareb/git.git

Shortlog:
~~~~~~~~~
Drew Northup (1):
gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

The one that started this. Drew, could you comment on this thread? Thanks in advance.

Jakub Narebski (4):
gitweb: Move information about installation from README to INSTALL
gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
gitweb: Move "Requirements" up in gitweb/INSTALL
gitweb: Starting work on a man page for gitweb (WIP)

My contributions.

Table of contents:
~~~~~~~~~~~~~~~~~~
[PATCHv3 1/5] gitweb: Move information about installation from [PATCHv3 2/5] gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL [PATCHv3 3/5] gitweb: Move "Requirements" up in gitweb/INSTALL [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP) [RFC/PATCHv3 5/5] gitweb: Starting work on a man page for gitweb (WIP)

Diffstat:
~~~~~~~~~

 Documentation/Makefile        |    9 +-
 Documentation/gitweb.conf.txt |  724 +++++++++++++++++++++++++++++++++++++++++
 Documentation/gitweb.txt      |  702 +++++++++++++++++++++++++++++++++++++++
 gitweb/INSTALL                |  246 ++++++++------
 gitweb/Makefile               |    7 +-
 gitweb/README                 |  519 +----------------------------
 6 files changed, 1599 insertions(+), 608 deletions(-)
 create mode 100644 Documentation/gitweb.conf.txt
 create mode 100644 Documentation/gitweb.txt

Dirstat:
~~~~~~~~
62.4% Documentation/
37.5% gitweb/

Signature · 1 line
1.7.5
#1 lore raw

PATCH v3 1/5 gitweb: Move information about installation from README to INSTALL

Almost straightformard moving of "How to configure gitweb for your local system" section from gitweb/README to gitweb/INSTALL, as it is about build time configuration. Updated references to it.

---
No differences from previous version.

 gitweb/INSTALL |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 gitweb/README  |  114 -------------------------------------------------------
 2 files changed, 113 insertions(+), 116 deletions(-)
gitweb/INSTALL +113 -2
index 4964a67..32a52b7 100644
@@ -28,8 +28,7 @@ scripts).
 Build time configuration
 ------------------------
 
-See also "How to configure gitweb for your local system" in README
-file for gitweb (in gitweb/README).
+See also "How to configure gitweb for your local system" section below.
 
 - There are many configuration variables which affect building of
   gitweb.cgi; see "default configuration for gitweb" section in main
@@ -73,6 +72,118 @@ file for gitweb (in gitweb/README).
   substitute gitweb.min.js and gitweb.min.css for all uses of gitweb.js and
   gitweb.css in the help files.
 
+
+How to configure gitweb for your local system
+---------------------------------------------
+
+You can specify the following configuration variables when building GIT:
+
+ * GIT_BINDIR
+   Points where to find the git executable.  You should set it up to
+   the place where the git binary was installed (usually /usr/bin) if you
+   don't install git from sources together with gitweb.  [Default: $(bindir)]
+ * GITWEB_SITENAME
+   Shown in the title of all generated pages, defaults to the server name
+   (SERVER_NAME CGI environment variable) if not set. [No default]
+ * GITWEB_PROJECTROOT
+   The root directory for all projects shown by gitweb. Must be set
+   correctly for gitweb to find repositories to display.  See also
+   "Gitweb repositories" in the INSTALL file for gitweb.  [Default: /pub/git]
+ * GITWEB_PROJECT_MAXDEPTH
+   The filesystem traversing limit for getting the project list; the number
+   is taken as depth relative to the projectroot.  It is used when
+   GITWEB_LIST is a directory (or is not set; then project root is used).
+   This is meant to speed up project listing on large work trees by limiting
+   search depth.  [Default: 2007]
+ * GITWEB_LIST
+   Points to a directory to scan for projects (defaults to project root
+   if not set / if empty) or to a file with explicit listing of projects
+   (together with projects' ownership). See "Generating projects list
+   using gitweb" in INSTALL file for gitweb to find out how to generate
+   such file from scan of a directory. [No default, which means use root
+   directory for projects]
+ * GITWEB_EXPORT_OK
+   Show repository only if this file exists (in repository).  Only
+   effective if this variable evaluates to true.  [No default / Not set]
+ * GITWEB_STRICT_EXPORT
+   Only allow viewing of repositories also shown on the overview page.
+   This for example makes GITWEB_EXPORT_OK to decide if repository is
+   available and not only if it is shown.  If GITWEB_LIST points to
+   file with list of project, only those repositories listed would be
+   available for gitweb.  [No default]
+ * GITWEB_HOMETEXT
+   Points to an .html file which is included on the gitweb project
+   overview page ('projects_list' view), if it exists.  Relative to
+   gitweb.cgi script.  [Default: indextext.html]
+ * GITWEB_SITE_HEADER
+   Filename of html text to include at top of each page.  Relative to
+   gitweb.cgi script.  [No default]
+ * GITWEB_SITE_FOOTER
+   Filename of html text to include at bottom of each page.  Relative to
+   gitweb.cgi script.  [No default]
+ * GITWEB_HOME_LINK_STR
+   String of the home link on top of all pages, leading to $home_link
+   (usually main gitweb page, which means projects list).  Used as first
+   part of gitweb view "breadcrumb trail": <home> / <project> / <view>.
+   [Default: projects]
+ * GITWEB_SITENAME
+   Name of your site or organization to appear in page titles.  Set it
+   to something descriptive for clearer bookmarks etc.  If not set
+   (if empty) gitweb uses "$SERVER_NAME Git", or "Untitled Git" if
+   SERVER_NAME CGI environment variable is not set (e.g. if running
+   gitweb as standalone script).  [No default]
+ * GITWEB_BASE_URL
+   Git base URLs used for URL to where fetch project from, i.e. full
+   URL is "$git_base_url/$project".  Shown on projects summary page.
+   Repository URL for project can be also configured per repository; this
+   takes precedence over URLs composed from base URL and a project name.
+   Note that you can setup multiple base URLs (for example one for
+   git:// protocol access, another for http:// access) from the gitweb
+   config file.  [No default]
+ * GITWEB_CSS
+   Points to the location where you put gitweb.css on your web server
+   (or to be more generic, the URI of gitweb stylesheet).  Relative to the
+   base URI of gitweb.  Note that you can setup multiple stylesheets from
+   the gitweb config file.  [Default: static/gitweb.css (or
+   static/gitweb.min.css if the CSSMIN variable is defined / CSS minifier
+   is used)]
+ * GITWEB_LOGO
+   Points to the location where you put git-logo.png on your web server
+   (or to be more generic URI of logo, 72x27 size, displayed in top right
+   corner of each gitweb page, and used as logo for Atom feed).  Relative
+   to base URI of gitweb.  [Default: static/git-logo.png]
+ * GITWEB_FAVICON
+   Points to the location where you put git-favicon.png on your web server
+   (or to be more generic URI of favicon, assumed to be image/png type;
+   web browsers that support favicons (website icons) may display them
+   in the browser's URL bar and next to site name in bookmarks).  Relative
+   to base URI of gitweb.  [Default: static/git-favicon.png]
+ * GITWEB_JS
+   Points to the location where you put gitweb.js on your web server
+   (or to be more generic URI of JavaScript code used by gitweb).
+   Relative to base URI of gitweb.  [Default: static/gitweb.js (or
+   static/gitweb.min.js if JSMIN build variable is defined / JavaScript
+   minifier is used)]
+ * GITWEB_CONFIG
+   This Perl file will be loaded using 'do' and can be used to override any
+   of the options above as well as some other options -- see the "Runtime
+   gitweb configuration" section below, and top of 'gitweb.cgi' for their
+   full list and description.  If the environment variable GITWEB_CONFIG
+   is set when gitweb.cgi is executed, then the file specified in the
+   environment variable will be loaded instead of the file specified
+   when gitweb.cgi was created.  [Default: gitweb_config.perl]
+ * GITWEB_CONFIG_SYSTEM
+   This Perl file will be loaded using 'do' as a fallback if GITWEB_CONFIG
+   does not exist.  If the environment variable GITWEB_CONFIG_SYSTEM is set
+   when gitweb.cgi is executed, then the file specified in the environment
+   variable will be loaded instead of the file specified when gitweb.cgi was
+   created.  [Default: /etc/gitweb.conf]
+ * HIGHLIGHT_BIN
+   Path to the highlight executable to use (must be the one from
+   http://www.andre-simon.de due to assumptions about parameters and output).
+   Useful if highlight is not installed on your webserver's PATH.
+   [Default: highlight]
+
 Build example
 ~~~~~~~~~~~~~
 
gitweb/README +0 -114

120 lines not on this page · raw message

Signature · 1 line
1.7.5
#2 lore raw

Re: [PATCHv3 1/5] gitweb: Move information about installation from README to INSTALL

Quoted 5 lines · Jakub Narebski

Almost straightformard moving of "How to configure gitweb for your local system" section from gitweb/README to gitweb/INSTALL, as it is about build time configuration. Updated references to it.

s/Updated/Update/. The patch is obviously good; thanks for taking care of it.

#3 lore raw

PATCH v3 2/5 gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL

In reply to Jakub Narebski

The build-time configuration variables JSMIN and CSSMIN were mentioned only in Makefile; add their description to gitweb/INSTALL.

This required moving description of GITWEB_JS up, near GITWEB_CSS and just introduced CSMIN and JSMIN.

---
No differences from previous version.

 gitweb/INSTALL |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
gitweb/INSTALL +13 -6
index 32a52b7..2346aad 100644
@@ -147,6 +147,19 @@ You can specify the following configuration variables when building GIT:
    the gitweb config file.  [Default: static/gitweb.css (or
    static/gitweb.min.css if the CSSMIN variable is defined / CSS minifier
    is used)]
+ * GITWEB_JS
+   Points to the location where you put gitweb.js on your web server
+   (or to be more generic URI of JavaScript code used by gitweb).
+   Relative to base URI of gitweb.  [Default: static/gitweb.js (or
+   static/gitweb.min.js if JSMIN build variable is defined / JavaScript
+   minifier is used)]
+ * CSSMIN, JSMIN
+   Invocation of a CSS minifier or a JavaScript minifier, respectively,
+   working as a filter (source on standard input, minified result on
+   standard output).  If set, it is used to generate a minified version of
+   'static/gitweb.css' or 'static/gitweb.js', respectively.  *Note* that
+   minified files would have *.min.css and *.min.js extension, which is
+   important if you also set GITWEB_CSS and/or GITWEB_JS.  [No default]
  * GITWEB_LOGO
    Points to the location where you put git-logo.png on your web server
    (or to be more generic URI of logo, 72x27 size, displayed in top right
@@ -158,12 +171,6 @@ You can specify the following configuration variables when building GIT:
    web browsers that support favicons (website icons) may display them
    in the browser's URL bar and next to site name in bookmarks).  Relative
    to base URI of gitweb.  [Default: static/git-favicon.png]
- * GITWEB_JS
-   Points to the location where you put gitweb.js on your web server
-   (or to be more generic URI of JavaScript code used by gitweb).
-   Relative to base URI of gitweb.  [Default: static/gitweb.js (or
-   static/gitweb.min.js if JSMIN build variable is defined / JavaScript
-   minifier is used)]
  * GITWEB_CONFIG
    This Perl file will be loaded using 'do' and can be used to override any
    of the options above as well as some other options -- see the "Runtime
Signature · 1 line
1.7.5
#4 lore raw

Re: [PATCHv3 2/5] gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL

Quoted 5 lines · Jakub Narebski

The build-time configuration variables JSMIN and CSSMIN were mentioned only in Makefile; add their description to gitweb/INSTALL.

This required moving description of GITWEB_JS up, near GITWEB_CSS and just introduced CSMIN and JSMIN.

Why does this require that? Ah, to make the analogy with GITWEB_CSS clear and because the JSMIN description refers to it.

Quoted 3 lines
gitweb/INSTALL +0 -0
@@ -147,6 +147,19 @@ You can specify the following configuration variables when building GIT:

[...]

gitweb/INSTALL You can specify the following configuration variables when building GIT: · line 162

Quoted 7 lines

+ * CSSMIN, JSMIN

gitweb/INSTALL +6 -0
+   Invocation of a CSS minifier or a JavaScript minifier, respectively,
+   working as a filter (source on standard input, minified result on
+   standard output).  If set, it is used to generate a minified version of
+   'static/gitweb.css' or 'static/gitweb.js', respectively.  *Note* that
+   minified files would have *.min.css and *.min.js extension, which is
+   important if you also set GITWEB_CSS and/or GITWEB_JS.  [No default]

When I first read this, I thought it meant these command lines were going to be cooked into the gitweb script and invoked at run time. Maybe (sorry for the rough text):

* CSSMIN, JSMIN
Command for a CSS minifier or a Javascript minifier, working as a filter [...]
These are used if defined to generate smaller, non human-readable versions of 'gitweb/gitweb.css' and 'static/gitweb.js' at 'static/gitweb.min.css' and 'static/gitweb.min.js'. Only the minified versions are installed, which is important if you also set GITWEB_CSS or GITWEB_JS. [No default]

Aside from that, looks good. Thanks.

#6 lore raw

PATCH v3 3/5 gitweb: Move "Requirements" up in gitweb/INSTALL

In reply to Jakub Narebski

This way you can examine prerequisites at first glance, before detailed instructions on installing gitweb. Straightforward code movement.

---
No differences from previous version.

 gitweb/INSTALL |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)
gitweb/INSTALL +15 -15
index 2346aad..c5236fe 100644
@@ -25,6 +25,21 @@ The above example assumes that your web server is configured to run
 scripts).
 
 
+Requirements
+------------
+
+ - Core git tools
+ - Perl
+ - Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
+ - web server
+
+The following optional Perl modules are required for extra features
+ - Digest::MD5 - for gravatar support
+ - CGI::Fast and FCGI - for running gitweb as FastCGI script
+ - HTML::TagCloud - for fancy tag cloud in project list view
+ - HTTP::Date or Time::ParseDate - to support If-Modified-Since for feeds
+
+
 Build time configuration
 ------------------------
 
@@ -347,21 +362,6 @@ $projects_list variable in gitweb config):
 	perl -- /var/www/cgi-bin/gitweb.cgi
 
 
-Requirements
-------------
-
- - Core git tools
- - Perl
- - Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
- - web server
-
-The following optional Perl modules are required for extra features
- - Digest::MD5 - for gravatar support
- - CGI::Fast and FCGI - for running gitweb as FastCGI script
- - HTML::TagCloud - for fancy tag cloud in project list view
- - HTTP::Date or Time::ParseDate - to support If-Modified-Since for feeds
-
-
 Example web server configuration
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
1.7.5
#7 lore raw

Re: [PATCHv3 3/5] gitweb: Move "Requirements" up in gitweb/INSTALL

Quoted 1 line · Jakub Narebski

This way you can examine prerequisites at first glance

Yes, good idea.

#8 lore raw

PATCH 4/5 gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

In reply to Jakub Narebski

From: Drew Northup <[email protected]>

This is a work in progress. Much of what is in it has been pulled directly from the README and INSTALL files of gitweb. Some effort has been made to de-duplicate any of this.

To build gitweb documentation you can use

make -C gitweb doc

or

cd gitweb; make doc

TODO:
* Clean up README and INSTALL files
* Remove or rephrase redundant portions of original documentation
* A lot more...

---
Differences from previous version (v2):

* Much simpler "doc" target in gitweb/Makefile. Now instead of duplicating internal knowledge how Documentation/Makefile works we simply delegate task to "gitweb-doc" target (a la "full-svn-test" in t/Makefile) in Documentation/Makefile.

The "gitweb-doc" target is implemented in 2 lines, compared to previous version which needed 7 lines in gitweb's Makefile.

Thanks Junio for this bit of sanity.

* Added documentation: $project_maxdepth, %highlight_ext etc., new after rebase $project_list_group_categories etc.

* New chapter "Configuring gitweb features" about %feature hash.

* Link to non-existent yet linkgit:gitweb[1] (introduced in next commit).

* Removed duplicated contents from gitweb/README

- By accident moved change to git.spec.in to next commit. But perhaps it is better here, or even better in a separate commit on top of series.

 Documentation/Makefile        |    7 +-
 Documentation/gitweb.conf.txt |  716 +++++++++++++++++++++++++++++++++++++++++
 gitweb/Makefile               |    7 +-
 gitweb/README                 |  133 +--------
 4 files changed, 728 insertions(+), 135 deletions(-)
 create mode 100644 Documentation/gitweb.conf.txt
Documentation/Makefile +5 -2
index 36989b7..68d0ebb 100644
@@ -3,7 +3,7 @@ MAN1_TXT= \
 		$(wildcard git-*.txt)) \
 	gitk.txt git.txt
 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \
-	gitrepository-layout.txt
+	gitrepository-layout.txt gitweb.conf.txt
 MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \
 	gitcvs-migration.txt gitcore-tutorial.txt gitglossary.txt \
 	gitdiffcore.txt gitrevisions.txt gitworkflows.txt
@@ -170,6 +170,9 @@ info: git.info gitman.info
 
 pdf: user-manual.pdf
 
+GITWEB_DOC = $(filter gitweb.%,$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7))
+gitweb-doc: $(GITWEB_DOC)
+
 install: install-man
 
 install-man: man
@@ -334,4 +337,4 @@ quick-install-man:
 quick-install-html:
 	'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
 
-.PHONY: FORCE
+.PHONY: FORCE gitweb-doc
Documentation/gitweb.conf.txt new file +716 -0

716 lines not on this page · raw message

gitweb/Makefile +6 -1
index 5d20515..dfdefef 100644
@@ -172,6 +172,11 @@ test-installed:
 	GITWEB_TEST_INSTALLED='$(DESTDIR_SQ)$(gitwebdir_SQ)' \
 		$(MAKE) -C ../t gitweb-test
 
+### Documentation
+
+doc:
+	$(MAKE) -C ../Documentation gitweb-doc
+
 ### Installation rules
 
 install: all
@@ -185,5 +190,5 @@ install: all
 clean:
 	$(RM) gitweb.cgi static/gitweb.min.js static/gitweb.min.css GITWEB-BUILD-OPTIONS
 
-.PHONY: all clean install test test-installed .FORCE-GIT-VERSION-FILE FORCE
+.PHONY: all clean install test test-installed doc .FORCE-GIT-VERSION-FILE FORCE
 
gitweb/README +2 -133

141 lines not on this page · raw message

Signature · 1 line
1.7.5
#9 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quoted 2 lines · Jakub Narebski

Some effort has
been made to de-duplicate any of this.

:)

Quoted 4 lines

* Much simpler "doc" target in gitweb/Makefile. Now instead of duplicating internal knowledge how Documentation/Makefile works we simply delegate task to "gitweb-doc" target (a la "full-svn-test" in t/Makefile) in Documentation/Makefile.

Seems sensible as long as the main Makefile never learns

	gitweb-doc:
		$(MAKE) -C gitweb doc

The toplevel Makefile could do "$(MAKE) -C Documentation gitweb-doc" and still avoid the usual pitfalls of recursive make stepping on its own toes.

Longer term, I would like to try making gitweb/Makefile include a build-helpers/Makefile.doc library and moving this documentation back to the gitweb/ directory, which would make the gitweb directory self-contained again (except for the build-helpers/Makefile.doc file). Not sure what to do about that "except for..." bit. I don't think my half-baked long-term ideas should be allowed to slow this down. ;-)

Quoted 12 lines
Documentation/Makefile +1 -1
@@ -3,7 +3,7 @@ MAN1_TXT= \
 		$(wildcard git-*.txt)) \
 	gitk.txt git.txt
 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \
-	gitrepository-layout.txt
+	gitrepository-layout.txt gitweb.conf.txt
 MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \
 	gitcvs-migration.txt gitcore-tutorial.txt gitglossary.txt \
 	gitdiffcore.txt gitrevisions.txt gitworkflows.txt

Documentation/Makefile info: git.info gitman.info · line 174

Quoted 5 lines
Documentation/Makefile +2 -0
@@ -170,6 +170,9 @@ info: git.info gitman.info
 
 pdf: user-manual.pdf
 
+GITWEB_DOC = $(filter gitweb.%,$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7))
+gitweb-doc: $(GITWEB_DOC)

Nice.

Documentation/Makefile quick-install-man: · line 340

Quoted 6 lines
Documentation/Makefile +1 -1
@@ -334,4 +337,4 @@ quick-install-man:
 quick-install-html:
 	'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
 
-.PHONY: FORCE
+.PHONY: FORCE gitweb-doc

Is there any reason other phony targets (like "install" and "pdf") aren't listed here?

Documentation/gitweb.conf.txt line 6

Quoted 9 lines
Documentation/gitweb.conf.txt new file +6 -0
@@ -0,0 +1,716 @@
+gitweb.conf(5)
+==============
+
+NAME
+----
+gitweb.conf - Gitweb configuration file

I suppose the novice can look to the DESCRIPTION or SEE ALSO section to learn what gitweb is.

Documentation/gitweb.conf.txt line 12

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+SYNOPSIS
+--------
+[verse]
+'/etc/gitweb.conf'
+'$GITWEBDIR/gitweb_config.perl'

Micronit: a single line like

	SYNOPSIS
	--------
	$GITWEBDIR/gitweb_config.perl, /etc/gitweb.conf

might fit better with the pattern established by gitattributes(5) and its kin.

Documentation/gitweb.conf.txt line 26

Quoted 13 lines
Documentation/gitweb.conf.txt new file +13 -0
+DESCRIPTION
+-----------
+The gitweb CGI script for viewing Git repositories over the web uses a
+perl script fragment as its configuration file.  You can set variables
+using "`our $variable = value`"; text from a "#" character until the
+end of a line is ignored.  See *perlsyn*(1) for details.
+
+An example:
+
+    # gitweb configuration file for http://git.example.org
+    #
+    our $projectroot = "/srv/git"; # FHS recommendation
+    our $site_name = 'Example.org >> Repos';

Nice.

Documentation/gitweb.conf.txt

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The configuration file is used to override the default settings that
+were built into gitweb at the time 'gitweb.cgi' script was generated.
+
+While one could just alter the configuration settings in the gitweb
+CGI itself, those changes would be lost upon upgrade.

What if I upgrade using RCS "merge"? :) So maybe:

s/one could just alter/one can alter/
s/would be lost/could be lost/

to clarify that (1) editing the CGI script is allowed and fine but (2) it might be a pain to keep those changes.

Documentation/gitweb.conf.txt line 37

Quoted 5 lines

Configuration

Documentation/gitweb.conf.txt new file +4 -0
+settings might also be placed into a file in the same directory as the
+CGI script with the default name 'gitweb_config.perl' -- allowing
+one to have multiple gitweb instances with different configurations by
+the use of symlinks.

Might also in addition to what? Continuing the thought from before:

So gitweb allows settings to be placed in a separate file named 'gitweb_config.perl' in the same directory as the CGI script. This also allows one to set up multiple gitweb instances with different configurations by using symlinks to a common gitweb.cgi script.

Quoted 2 lines

+DISCUSSION
+----------

First, as a general thought, by the time I get this far I start thinking, "so where's the list of possible settings?". But there are certainly some more basic pieces of information to cover before then (like the global configuration file), so I think this part is in the right place. It just could benefit from being a little shorter.

Documentation/gitweb.conf.txt line 46

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The location of system-wide gitweb configuration file is defined at compile
+time using the configuration value `GITWEB_CONFIG_SYSTEM` and defaults to
+'/etc/gitweb.conf'.  The name of the per-instance configuration file is
+defined in gitweb by `GITWEB_CONFIG`, and defaults to 'gitweb_config.perl'
+(relative path means located in the same directory gitweb is installed).

Maybe:

In addition to the per-instance configuration file, there can be a system-wide configuration file to act as a fallback when the per-instance configuration file does not exist.

The system-wide configuration file is named /etc/gitweb.conf by default. Filenames for the system-wide and per-instance configuration variables can be overridden at compile time and run time; see the FILES section for details.

[...]

Documentation/gitweb.conf.txt line 55

Quoted 2 lines
Documentation/gitweb.conf.txt new file +2 -0
+Values defined in configuration files override built-in values found in the
+gitweb CGI.

Reasonable.

Documentation/gitweb.conf.txt line 59

Quoted 3 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

Documentation/gitweb.conf.txt line 65

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The syntax of the configuration files is that of Perl, as these files are
+indeed handled as fragments of Perl code (the language that gitweb itself is
+written in). Variables may be set using "`our $variable = value`"; text from
+"#" character until the end of a line is ignored. See the *perlsyn*(1) man
+page for more information.

Duplicates DESCRIPTION.

Documentation/gitweb.conf.txt line 69

Quoted 4 lines
Documentation/gitweb.conf.txt new file +4 -0
+
+Actually using `our` qualifier in `our $variable = <value>;` is a safety
+check: if newer gitweb does no longer use given variable, by using `our` we
+won't get syntax errors.

Maybe this could move to a later NOTES section?

Documentation/gitweb.conf.txt line 76

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+
+The default configuration with no configuration file at all may work
+perfectly well for some installations.  Still, a configuration file is
+useful for customizing or tweaking the behavior of gitweb in many ways, and
+some optional features will not be present unless explicitly enabled using
+the configurable `%features` variable (see also "Configuring gitweb
+features" section below).

I suppose this is based on the text

The most notable thing that is not configurable at compile time are the optional features, stored in the '%features' variable.

I'd suggest removing the paragraph.

Documentation/gitweb.conf.txt line 84

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+CONFIGURATION VARIABLES
+-----------------------
+Some of configuration variables have their default values (embedded in CGI
+file) set during building gitweb -- if that is the case, it is put in their
+description.  See gitweb's 'INSTALL' file for instructions on building and
+installing gitweb.

Reasonable. Nit: s/put/mentioned/

Documentation/gitweb.conf.txt line 89

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+
+Location of repositories
+~~~~~~~~~~~~~~~~~~~~~~~~
+Configuration variables described below control finding git repositories by
+gitweb, and control display and access to repositories.

The configuration variables described below determine where gitweb looks for repositories and which will be displayed.

(missing "The", elaboring on what it means to control repository search.)

Quoted 11 lines
Documentation/gitweb.conf.txt new file +11 -0
+
+$projectroot::
+	Absolute filesystem path which will be prepended to project path;
+	the path to repository is `$projectroot/$project`.  Set to
+	`$GITWEB_PROJECTROOT` during installation.  This variable has to be
+	set correctly for gitweb to find repositories.
++
+For example if `$projectroot` is set to "/srv/git" by putting the following
+in gitweb config file:
+----------------------------------------------------------------------------
+our $projectroot = "/srv/git";

Documentation/gitweb.conf.txt line 110

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+----------------------------------------------------------------------------
+then
+------------------------------------------------
+http://git.example.com/gitweb.cgi?p=foo/bar.git
+------------------------------------------------
+or its path_info based equivalent
+------------------------------------------------
+http://git.example.com/gitweb.cgi/foo/bar.git
+------------------------------------------------
+will map to path '/srv/git/foo/bar.git' on filesystem.

Nice. s/(path|filesystem)/the &/

Documentation/gitweb.conf.txt line 116

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+
+$project_maxdepth::
+	Filesystem traversing depth limit for recursively scanning for git
+	repositories, used if `$projects_list` (below) is unset.  The default
+	value of this variable is determined by build-time configuration
+	variable `GITWEB_PROJECT_MAXDEPTH`, which defaults to 2007.

gitweb/INSTALL says:

The filesystem traversing limit for getting the project list; the number is taken as depth relative to the projectroot. It is used when GITWEB_LIST is a directory (or is not set; then project root is used). This is meant to speed up project listing on large work trees by limiting search depth. [Default: 2007]

I'm still not clear on what it actually means. Is it used when $projects_list points to a directory or not? What if $projects_list points to a file with lines that name directories? What happens when listing forks of a repository?

Quoted 4 lines
Documentation/gitweb.conf.txt new file +4 -0
+
+$projects_list::
+	Plain text file listing projects or name of directory
+	to be scanned for projects.

Documentation/gitweb.conf.txt line 130

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+
+	Project list files should list one project per line, with each line
+	having the following format
+-----------------------------------------------------------------------------
+<URI-encoded filesystem path to repository> SP <URI-encoded repository owner>
+-----------------------------------------------------------------------------
+
+The default value of this variable is determined by the `GITWEB_LIST`
+makefile variable at installation time.  If this variable is empty, gitweb
+will fall back to scanning the `$projectroot` directory for repositories.

This gets formatted with the second and later paragraphs being unindented; presumably it needs a "+", like so:

		... paragraph 1 ...
	+
	--
	... remaining paragraphs ...
	--

Can't this point to a directory, too?

Documentation/gitweb.conf.txt line 135

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+
+$export_ok::
+	Show repository only if this file exists (in repository).  Only
+	effective if this variable evaluates to true.  Can be set during
+	building gitweb via `GITWEB_EXPORT_OK`.  [No default / Not set]

Am I supposed to show a repository? Ah, no, this is about what gitweb does. Maybe

Filename to look for in repositories to determine whether to show them. If this variable evaluates to true, gitweb will only show repositories that contain a magic file with that name; otherwise, which repositories gitweb shows is controlled by the $strict_export option. Can be set when building gitweb using the GITWEB_EXPORT_OK variable. [No default]

Might be simpler to put the documentation of $strict_export first. gitweb/INSTALL says:

gitweb
shows repositories only if this file exists in its object database (if directory has the magic file named $export_ok)

but I assume what was meant is the git dir, not .git/objects.

Incidentally, wouldn't it be more intuitive to treat all values of $export_ok as true (i.e., check "if (defined($export_ok))" instead of "if ($export_ok)") so the user doesn't need to know what values perl considers to be true?

Documentation/gitweb.conf.txt

Quoted 3 lines

+$export_auth_hook::

Documentation/gitweb.conf.txt new file +2 -0
+	Show repository only if this subroutine returns true, when given as
+	the only parameter the full path to the project.

Subroutine to decide whether to show a project. Its only parameter is the full filesystem path to the repository.
+
Example:

[...]

Documentation/gitweb.conf.txt line 153

Quoted 7 lines

+$strict_export::

Documentation/gitweb.conf.txt new file +6 -0
+	Only allow viewing of repositories also shown on the overview page.
+	This for example makes `$gitweb_export_ok` file decide if repository is
+	available and not only if it is shown.  If `$gitweb_list` points to
+	file with list of project, only those repositories listed would be
+	available for gitweb.  Can be set during building gitweb via
+	`GITWEB_STRICT_EXPORT`.  [No default / Not set]

I think I'd put this before $export_ok (because simpler) and steal text from INSTALL.

By default, even if a project is not visible on the projects list page, you can view it by hand-crafting a gitweb URL. Set the $strict_export variable to true if you want to only allow repositories shown on the overview page to be viewed. Can be set during ...

Documentation/gitweb.conf.txt line 160

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+Finding files
+~~~~~~~~~~~~~
+Those configuration variables tell gitweb where to find files.  Values of
+those variables are paths on filesystem.  Of those only `$GIT` is required
+to be (correctly) set for gitweb to be able to work; all the rest are
+required only for extra configuration or extra features.

Perhaps:

System paths
~~~~~~~~~~~~
These configuration variables tell gitweb where to find commands and system files. The values of these variables are commands or paths on the filesystem. Of these, only ...

(s/those/these/; add some wiggle room since $GIT = "git" is allowed; change the title to contrast with the repository location variables; add a comma.)

Documentation/gitweb.conf.txt line 167

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+
+$GIT::
+	Core git executable to use.  By default set to `$GIT_BINDIR/git`, which
+	in turn is by default set to `$(bindir)/git`.  If you use git from binary
+	package, set this to "/usr/bin/git".  This can just be "git" if your
+	webserver has a sensible PATH.  If you have multiple git versions installed
+	it can be used to choose which one to use.

A setting like $GIT = "git --exec-path=elsewhere" would not work because the entire string is used as the first argument to execvp. Not sure how to say it: maybe just

Command name to use when running git commands. By default this is set to ...

("command name" being a phrase I made up on the spot for "path or bare command name, suitable for passing to execvp".)

I think a better default would be "git", so if a newer git gets installed in /usr/local/bin then gitweb would notice automatically.

Documentation/gitweb.conf.txt line 171

Quoted 4 lines

+$mimetypes_file::

Documentation/gitweb.conf.txt new file +3 -0
+	File to use for (filename extension based) guessing of MIME types before
+	trying '/etc/mime.types'.  Path, if relative, is taken currently as
+	relative to the current git repository.  [Unset by default]

What makes $mimetypes_file fit in this section but not $export_ok? (I have no good answer. Maybe a separate section for MIME type guessing would be more discoverable?)

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+
+$highlight_bin::
+	Path to the highlight executable to use (must be the one from
+	http://www.andre-simon.de due to assumptions about parameters and output).
+	Useful if 'highlight' is not installed on your webserver's PATH.

Documentation/gitweb.conf.txt line 185

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+
+	*Note* that if you want to add support for new syntax (supported by
+	"highlight" but not used by gitweb), you need to modify `%highlight_ext`
+	or `%highlight_basename`, depending on whether you detect type of file
+	based on extension (for example "*.sh") or on its basename (for example
+	"Makefile").  Keys of those hashes are extension or basename,
+	respectively, and value for given key is name of syntax to be passed via
+	`--syntax <syntax>` to highlighter.
+
+	[Default: 'highlight']

Needs "+" continuation lines, presumably.

Documentation/gitweb.conf.txt line 193

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+Links and their targets
+~~~~~~~~~~~~~~~~~~~~~~~
+Configuration variables described below configure some of gitweb links:
+their target and their look (text or image), and where to find page
+prerequisites (stylesheet, favicon, images, scripts).  Usually they are left
+at their default values, with the possible exception of `@stylesheets`
+variable.

Does "Usually they are left at" mean "Usually there is no reason to change them from"? Aside from that, makes sense.

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+
+@stylesheets::
+	List of URIs of stylesheets (relative to base URI of a page). You
+	might specify more than one stylesheet, for example use gitweb.css
+	as base, with site specific modifications in separate stylesheet
+	to make it easier to upgrade gitweb. You can add a `site` stylesheet
+	for example by putting
+----------------------------------------------------------------------------
+push @stylesheets, "gitweb-site.css";
+----------------------------------------------------------------------------

Documentation/gitweb.conf.txt line 213

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+in the gitweb config file.  Those values that are relative paths, are
+relative to base URI of gitweb.
+
+This list should contain URI of gitweb's stylesheet.  The URI of gitweb
+stylesheet is set during build time via `GITWEB_CSS` variable.  It's default
+value is 'static/gitweb.css' (or 'static/gitweb.min.css' if the `CSSMIN`
+variable is defined, i.e. if CSS minifier is used during build.
+
+*Note*: there is also legacy `$stylesheet` configuration variable, which was
+used by older gitweb.

s/gitweb$/gitweb's/; s/It's/Its/. Missing closing paren, I think.

s/legacy/the legacy/. How does this interact with the legacy setting (e.g., if I am new on my job as gitweb administrator and encounter such a line, what does it mean and what would I want to change it to)?

Missing "+" continuation lines.

Documentation/gitweb.conf.txt line 222

Quoted 9 lines
Documentation/gitweb.conf.txt new file +9 -0
+
+$logo::
+	Points to the location where you put 'git-logo.png' on your web
+	server, or to be more generic URI of logo, 72x27 size).  This image
+	is displayed in top right corner of each gitweb page, and used as
+	logo for Atom feed.  Relative to base URI of gitweb (as a path).
+	Can be adjusted during building gitweb using `GITWEB_LOGO` variable
++
+	[Default: 'static/git-logo.png']

Re "as a path": can this be a URI pointing to another server if I want it to?

[...]

Documentation/gitweb.conf.txt line 247

Quoted 3 lines

+$home_link::

Documentation/gitweb.conf.txt new file +2 -0
+	Target of the home link on top of all pages (the first part of view
+	"breadcrumbs").  By default set to absolute URI of a page ($my_uri).

s/By default set to absolute URI of a page/The default is the absolute URI for the gitweb script/

Stopping here. Will resume later but since having something is better than nothing, I am tempted to say this should be applied e.g. to "next" so people can start using it right away and finding/fixing documentation bugs.

#10 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quoted 9 lines · Jonathan Nieder
Quoted 5 lines · Jakub Narebski

+SYNOPSIS
+--------
+[verse]
+'/etc/gitweb.conf'
+'$GITWEBDIR/gitweb_config.perl'

Quoted 8 lines

Micronit: a single line like

	SYNOPSIS
	--------
	$GITWEBDIR/gitweb_config.perl, /etc/gitweb.conf

might fit better with the pattern established by gitattributes(5) and its kin.

I thought that's how I had originally put it.

Quoted 25 lines
Quoted 4 lines
Documentation/gitweb.conf.txt new file +3 -0
+DESCRIPTION
+-----------
+The gitweb CGI script for viewing Git repositories over the web uses a

Documentation/gitweb.conf.txt line 26

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+perl script fragment as its configuration file.  You can set variables
+using "`our $variable = value`"; text from a "#" character until the
+end of a line is ignored.  See *perlsyn*(1) for details.
+
+An example:
+
+    # gitweb configuration file for http://git.example.org
+    #
+    our $projectroot = "/srv/git"; # FHS recommendation
+    our $site_name = 'Example.org >> Repos';

Nice.

Documentation/gitweb.conf.txt

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The configuration file is used to override the default settings that
+were built into gitweb at the time 'gitweb.cgi' script was generated.
+
+While one could just alter the configuration settings in the gitweb
+CGI itself, those changes would be lost upon upgrade.

What if I upgrade using RCS "merge"? :) So maybe:

Quoted 5 lines

s/one could just alter/one can alter/
s/would be lost/could be lost/

to clarify that (1) editing the CGI script is allowed and fine but (2) it might be a pain to keep those changes.

The point of this was originally if you were a mere mortal then upgrades of the gitweb CGI would flush all of the settings you just spent a week getting right down the drain. That's the point of the stronger language. It's meant to be a solid "If you do it that way you can expect it to hurt" message.

Quoted 8 lines

Documentation/gitweb.conf.txt line 37

Quoted 6 lines

Configuration

Documentation/gitweb.conf.txt new file +4 -0
+settings might also be placed into a file in the same directory as the
+CGI script with the default name 'gitweb_config.perl' -- allowing
+one to have multiple gitweb instances with different configurations by
+the use of symlinks.

Might also in addition to what?

This comment is nonsensical, please clarify it.

Quoted 7 lines

Continuing the thought from before:

So gitweb allows settings to be placed in a separate file named 'gitweb_config.perl' in the same directory as the CGI script. This also allows one to set up multiple gitweb instances with different configurations by using symlinks to a common gitweb.cgi script.

How is this any different from what I wrote?

Quoted 9 lines
Quoted 3 lines

+DISCUSSION
+----------

First, as a general thought, by the time I get this far I start thinking, "so where's the list of possible settings?". But there are certainly some more basic pieces of information to cover before then (like the global configuration file), so I think this part is in the right place. It just could benefit from being a little shorter.

I used resolv.conf(5) as the model here. I realized that without a little introduction most of the settings and the way they are applied didn't make a heck of a lot of sense if you've never seen them before.

Quoted 9 lines

Documentation/gitweb.conf.txt line 46

Quoted 6 lines
Documentation/gitweb.conf.txt new file +5 -0
+The location of system-wide gitweb configuration file is defined at compile
+time using the configuration value `GITWEB_CONFIG_SYSTEM` and defaults to
+'/etc/gitweb.conf'.  The name of the per-instance configuration file is
+defined in gitweb by `GITWEB_CONFIG`, and defaults to 'gitweb_config.perl'
+(relative path means located in the same directory gitweb is installed).

Maybe:

Quoted 8 lines

In addition to the per-instance configuration file, there can be a system-wide configuration file to act as a fallback when the per-instance configuration file does not exist.

The system-wide configuration file is named /etc/gitweb.conf by default. Filenames for the system-wide and per-instance configuration variables can be overridden at compile time and run time; see the FILES section for details.

This is the manpage for the system wide configuration file. If you'd like to scrap this effort in favor of something else please speak up.

Quoted 7 lines

[...]

Documentation/gitweb.conf.txt line 55

Quoted 2 lines
Documentation/gitweb.conf.txt new file +2 -0
+Values defined in configuration files override built-in values found in the
+gitweb CGI.

Reasonable.

Quoted 6 lines

Documentation/gitweb.conf.txt line 59

Quoted 3 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

If we were to change gitweb to handle configuration files like the rest of git (and in fact like most things we deal with daily, where settings are overridden one by one) then this section becomes moot. Until or unless that becomes the case it is important to loudly make note of it.

Also (and unfortunately), what appears to be truly over the top markup in plain text is just barely visible in the compiled manpage and is actually reasonable in the (X)HTML version. Please check the final output before complaining about my markup, if that is indeed your intent.

Quoted 8 lines

Documentation/gitweb.conf.txt line 65

Quoted 6 lines
Documentation/gitweb.conf.txt new file +5 -0
+The syntax of the configuration files is that of Perl, as these files are
+indeed handled as fragments of Perl code (the language that gitweb itself is
+written in). Variables may be set using "`our $variable = value`"; text from
+"#" character until the end of a line is ignored. See the *perlsyn*(1) man
+page for more information.

Duplicates DESCRIPTION.

Perhaps it does, but not everybody is a Perl coder. It was that way in the text I started from and I saw little point in changing it.

Quoted 7 lines

Documentation/gitweb.conf.txt line 69

Quoted 5 lines
Documentation/gitweb.conf.txt new file +4 -0
+
+Actually using `our` qualifier in `our $variable = <value>;` is a safety
+check: if newer gitweb does no longer use given variable, by using `our` we
+won't get syntax errors.

Maybe this could move to a later NOTES section?

Fine with me.

Quoted 11 lines

Documentation/gitweb.conf.txt line 76

Quoted 8 lines
Documentation/gitweb.conf.txt new file +7 -0
+
+The default configuration with no configuration file at all may work
+perfectly well for some installations.  Still, a configuration file is
+useful for customizing or tweaking the behavior of gitweb in many ways, and
+some optional features will not be present unless explicitly enabled using
+the configurable `%features` variable (see also "Configuring gitweb
+features" section below).

I suppose this is based on the text

Quoted 4 lines

The most notable thing that is not configurable at compile time are the optional features, stored in the '%features' variable.

I'd suggest removing the paragraph.

The motivation for this paragraph was actually the innumerable tutorials out there which tell people to mangle the CGI directly because:
(1) There didn't seem to be a standard documented configuration file
(2) There wasn't an appropriate place to shove %features settings that the author could find.
(3) It really needed to be said that you might not actually have to mess with anything.

Apparently you think that clearing these misconceptions up is a useless exercise, or at least it sounds a lot like it.

Quoted 10 lines

Documentation/gitweb.conf.txt line 193

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+Links and their targets
+~~~~~~~~~~~~~~~~~~~~~~~
+Configuration variables described below configure some of gitweb links:
+their target and their look (text or image), and where to find page
+prerequisites (stylesheet, favicon, images, scripts).  Usually they are left
+at their default values, with the possible exception of `@stylesheets`
+variable.

Does "Usually they are left at" mean "Usually there is no reason to change them from"? Aside from that, makes sense.

Yes, that's equivalent.

Quoted 5 lines

Stopping here. Will resume later but since having something is better than nothing, I am tempted to say this should be applied e.g. to "next" so people can start using it right away and finding/fixing documentation bugs.

And so am I [stopping], I suppose. I have had work to do for the past few weeks that really caused me to NEED my weekends for things other than writing code and flossing documentation. Unless I am needed for something I'm going to just let this live or die on it's own for now, as I cannot keep up with this pace of patching right now. (That was in large part the whole point of my flagging this as WIP.)

Signature · 4 lines
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
#11 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Hi,

Quoted 4 lines · Drew Northup
Quoted 2 lines · Jonathan Nieder

Micronit: a single line like

Quoted 8 lines
Quoted 6 lines
	SYNOPSIS
	--------
	$GITWEBDIR/gitweb_config.perl, /etc/gitweb.conf

might fit better with the pattern established by gitattributes(5) and its kin.

I thought that's how I had originally put it.

I take that as a "yes, it would work better".

To save others the trouble of digging previous rounds up for comparison:

- the original: http://thread.gmane.org/gmane.comp.version-control.git/173422
- v2: http://thread.gmane.org/gmane.comp.version-control.git/174700/focus=174701
- v3: http://thread.gmane.org/gmane.comp.version-control.git/175140/focus=175145

The original had one line but it didn't mention $GITWEBDIR/gitweb_config.perl. So we are slowly converging.

[...]

Quoted 11 lines
Quoted 11 lines

Documentation/gitweb.conf.txt

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The configuration file is used to override the default settings that
+were built into gitweb at the time 'gitweb.cgi' script was generated.
+
+While one could just alter the configuration settings in the gitweb
+CGI itself, those changes would be lost upon upgrade.

What if I upgrade using RCS "merge"? :) So maybe:

s/one could just alter/one can alter/
s/would be lost/could be lost/

Quoted 8 lines
Quoted 2 lines

to clarify that (1) editing the CGI script is allowed and fine but (2) it might be a pain to keep those changes.

The point of this was originally if you were a mere mortal then upgrades of the gitweb CGI would flush all of the settings you just spent a week getting right down the drain. That's the point of the stronger language. It's meant to be a solid "If you do it that way you can expect it to hurt" message.

Sorry, I suppose I was unclear. All I meant is that as a naïve reader, I found myself losing trust with "those changes would be lost upon upgrade". Oddly enough, by contrast something like:

While it would be possible to change the gitweb CGI directly instead, DON'T DO THAT! Your changes would be lost on upgrade!

would have worked fine for me, since there are enough cues to know I am reading hyperbole rather than an explanation of mechanism.

Anyway, it was just how I read it, and it's likely my proposed change would have made it worse in some other way.

Quoted 9 lines
Quoted 7 lines

Documentation/gitweb.conf.txt line 37

Quoted 5 lines

Configuration

Documentation/gitweb.conf.txt new file +4 -0
+settings might also be placed into a file in the same directory as the
+CGI script with the default name 'gitweb_config.perl' -- allowing
+one to have multiple gitweb instances with different configurations by
+the use of symlinks.

Might also in addition to what?

This comment is nonsensical, please clarify it.

I found the sentence starting with "Configuration settings" hard to understand because the "also" didn't have an obvious antecedent. Therefore I proposed some alternative phrasing:

Quoted 9 lines
Quoted 7 lines

Continuing the thought from before:

So gitweb allows settings to be placed in a separate file named 'gitweb_config.perl' in the same directory as the CGI script. This also allows one to set up multiple gitweb instances with different configurations by using symlinks to a common gitweb.cgi script.

How is this any different from what I wrote?

I'm starting to sense annoyance. Please feel free to ignore my comments if you think they're unhelpful; they're meant as a gift, not demands.

Anyway, the difference is in phrasing. Saying "So" is meant to make the relationship to the previous sentence clearer: we are explaining the purpose of the configuration file, by contrasting it with editing the CGI script directly. The next sentence is a separate thought, so I thought it might be clearer to put it in a separate sentence.

Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

+DISCUSSION
+----------

First, as a general thought, by the time I get this far I start thinking, "so where's the list of possible settings?". But there are certainly some more basic pieces of information to cover before then (like the global configuration file), so I think this part is in the right place. It just could benefit from being a little shorter.

Quoted 3 lines

I used resolv.conf(5) as the model here. I realized that without a little introduction most of the settings and the way they are applied didn't make a heck of a lot of sense if you've never seen them before.

Yes, I think the general structure is good.

Quoted 12 lines
Quoted 12 lines

Documentation/gitweb.conf.txt line 46

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The location of system-wide gitweb configuration file is defined at compile
+time using the configuration value `GITWEB_CONFIG_SYSTEM` and defaults to
+'/etc/gitweb.conf'.  The name of the per-instance configuration file is
+defined in gitweb by `GITWEB_CONFIG`, and defaults to 'gitweb_config.perl'
+(relative path means located in the same directory gitweb is installed).

Maybe:

In addition to the per-instance configuration file, there can be a system-wide configuration file to act as a fallback when the per-instance configuration file does not exist.

Quoted 7 lines
Quoted 4 lines

The system-wide configuration file is named /etc/gitweb.conf by default. Filenames for the system-wide and per-instance configuration variables can be overridden at compile time and run time; see the FILES section for details.

This is the manpage for the system wide configuration file. If you'd like to scrap this effort in favor of something else please speak up.

Huh?

Quoted 11 lines
Quoted 6 lines

Documentation/gitweb.conf.txt line 59

Quoted 3 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

If we were to change gitweb to handle configuration files like the rest of git (and in fact like most things we deal with daily, where settings are overridden one by one) then this section becomes moot. Until or unless that becomes the case it is important to loudly make note of it.

Does using three exclamation marks and italics make it clearer?

Previously there was no manpage documenting this at all, so I think explaining it is already a big and good step. If this needs to be so prominent that people just skimming through will notice it, then I'd suggest putting it in the DESCRIPTION section higher up. But I'm not the one writing this; others are free to disagree.

Quoted 1 line
Quoted 1 line
Quoted 1 line

+The syntax of the configuration files is that of Perl, as these files are

[...]

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

+page for more information.

Duplicates DESCRIPTION.

Perhaps it does, but not everybody is a Perl coder. It was that way in the text I started from and I saw little point in changing it.

No, the paragraph is actually repeated from the DESCRIPTION section.

[...]

Quoted 22 lines
Quoted 9 lines

Documentation/gitweb.conf.txt line 76

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+The default configuration with no configuration file at all may work
+perfectly well for some installations.  Still, a configuration file is
+useful for customizing or tweaking the behavior of gitweb in many ways, and
+some optional features will not be present unless explicitly enabled using
+the configurable `%features` variable (see also "Configuring gitweb
+features" section below).

I suppose this is based on the text

Quoted 4 lines

The most notable thing that is not configurable at compile time are the optional features, stored in the '%features' variable.

I'd suggest removing the paragraph.

The motivation for this paragraph was actually the innumerable tutorials out there which tell people to mangle the CGI directly because:
(1) There didn't seem to be a standard documented configuration file
(2) There wasn't an appropriate place to shove %features settings that the author could find.
(3) It really needed to be said that you might not actually have to mess with anything.

Quoted 2 lines

Apparently you think that clearing these misconceptions up is a useless exercise, or at least it sounds a lot like it.

What? I wrote exactly what I was thinking, which was that I thought this paragraph was based on the text I quoted from gitweb/INSTALL and that contrasting the run-time and compile-time configuration as that paragraph did didn't seem very important for the installed manpage (since the reader might not have been involved in the installation at all).

If the point was actually to say "Contrary to popular belief, you can set %features in the configuration file instead of hard-coding it in the CGI script itself", why not say that directly?

[...]

Quoted 1 line

I cannot keep up with this pace of patching right now.

No problem. For what it's worth, I skipped a couple of rounds of reading, too; I suppose they came quickly. Does that mean you don't want to be cc-ed on later incarnations of the patch, or would you like to stay notified?

It seems my review was not very useful; sorry about that. Thanks for some clarifications.

Ciao,
Jonathan

#12 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quoted 11 lines · Jonathan Nieder

Hi,

Quoted 8 lines · Drew Northup
Quoted 6 lines · Jonathan Nieder

Micronit: a single line like

	SYNOPSIS
	--------
	$GITWEBDIR/gitweb_config.perl, /etc/gitweb.conf
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

might fit better with the pattern established by gitattributes(5) and its kin.

I thought that's how I had originally put it.

I take that as a "yes, it would work better".

Agreed, it would.

Quoted 10 lines

To save others the trouble of digging previous rounds up for comparison:

- the original: http://thread.gmane.org/gmane.comp.version-control.git/173422
- v2: http://thread.gmane.org/gmane.comp.version-control.git/174700/focus=174701
- v3: http://thread.gmane.org/gmane.comp.version-control.git/175140/focus=175145

The original had one line but it didn't mention $GITWEBDIR/gitweb_config.perl. So we are slowly converging.

Thanks for looking that up (and the refs above).

Quoted 26 lines

[...]

Quoted 11 lines
Quoted 11 lines

Documentation/gitweb.conf.txt

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The configuration file is used to override the default settings that
+were built into gitweb at the time 'gitweb.cgi' script was generated.
+
+While one could just alter the configuration settings in the gitweb
+CGI itself, those changes would be lost upon upgrade.

What if I upgrade using RCS "merge"? :) So maybe:

s/one could just alter/one can alter/
s/would be lost/could be lost/

Quoted 8 lines
Quoted 2 lines

to clarify that (1) editing the CGI script is allowed and fine but (2) it might be a pain to keep those changes.

The point of this was originally if you were a mere mortal then upgrades of the gitweb CGI would flush all of the settings you just spent a week getting right down the drain. That's the point of the stronger language. It's meant to be a solid "If you do it that way you can expect it to hurt" message.

Sorry, I suppose I was unclear. All I meant is that as a naïve reader, I found myself losing trust with "those changes would be lost upon upgrade". Oddly enough, by contrast something like:

Quoted 8 lines

While it would be possible to change the gitweb CGI directly instead, DON'T DO THAT! Your changes would be lost on upgrade!

would have worked fine for me, since there are enough cues to know I am reading hyperbole rather than an explanation of mechanism.

Anyway, it was just how I read it, and it's likely my proposed change would have made it worse in some other way.

Your complaint is valid from the perspective you just outlined. The point I was trying to drive home was that you can expect the upgrade process to replace the executable because that's what upgrades do--they replace executables. Obviously stating it that plainly to somebody unfamiliar with how the whole install/upgrade process works at the filesystem level isn't going to be very helpful. Perhaps a combination of the "one can alter" and "are likely to be overwritten [upon upgrade]" would do the trick?

Quoted 29 lines
Quoted 10 lines
Quoted 8 lines

Documentation/gitweb.conf.txt line 37

Quoted 6 lines

Configuration

Documentation/gitweb.conf.txt new file +4 -0
+settings might also be placed into a file in the same directory as the
+CGI script with the default name 'gitweb_config.perl' -- allowing
+one to have multiple gitweb instances with different configurations by
+the use of symlinks.

Might also in addition to what?

This comment is nonsensical, please clarify it.

I found the sentence starting with "Configuration settings" hard to understand because the "also" didn't have an obvious antecedent. Therefore I proposed some alternative phrasing:

Quoted 9 lines
Quoted 7 lines

Continuing the thought from before:

So gitweb allows settings to be placed in a separate file named 'gitweb_config.perl' in the same directory as the CGI script. This also allows one to set up multiple gitweb instances with different configurations by using symlinks to a common gitweb.cgi script.

How is this any different from what I wrote?

I'm starting to sense annoyance. Please feel free to ignore my comments if you think they're unhelpful; they're meant as a gift, not demands.

Quoted 5 lines

Anyway, the difference is in phrasing. Saying "So" is meant to make the relationship to the previous sentence clearer: we are explaining the purpose of the configuration file, by contrasting it with editing the CGI script directly. The next sentence is a separate thought, so I thought it might be clearer to put it in a separate sentence.

Yes, annoyance would be the right word. I was trying very hard to find how what you were proposing was different and not finding it (other than what appeared to me to be dealing with the reader in a disrespectful manner). Now that I know where you were aiming I can think about an appropriate change. (I'm not there yet, but it may very well come to me.)
In any case, these are things that I'd need to see not in patch context, but as part of the larger file to make much sense of. I seem to recall that something is missing here that was prior to the words "Configuration settings" in my original, which I'll have to check on. If that is the case it would explain the lack antecedent clarity you noted. If not then the text could be made more clear unto itself.

Quoted 17 lines
Quoted 17 lines
Quoted 16 lines

Documentation/gitweb.conf.txt line 46

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The location of system-wide gitweb configuration file is defined at compile
+time using the configuration value `GITWEB_CONFIG_SYSTEM` and defaults to
+'/etc/gitweb.conf'.  The name of the per-instance configuration file is
+defined in gitweb by `GITWEB_CONFIG`, and defaults to 'gitweb_config.perl'
+(relative path means located in the same directory gitweb is installed).

Maybe:

In addition to the per-instance configuration file, there can be a system-wide configuration file to act as a fallback when the per-instance configuration file does not exist.

The system-wide configuration file is named /etc/gitweb.conf by default. Filenames for the system-wide and per-instance configuration variables can be overridden at compile time and run time; see the FILES section for details.

Quoted 4 lines
Quoted 2 lines

This is the manpage for the system wide configuration file. If you'd like to scrap this effort in favor of something else please speak up.

Huh?

If this is what you are proposing then we should be working on a "gitweb_config.perl" manpage and not a "gitweb.conf" manpage. I know a fair number of people around here put priority on the former and would just as soon ignore the latter. That's what your proposed change says to me (while I also understand that your own position is likely far more nuanced than that).

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

Documentation/gitweb.conf.txt line 59

Quoted 4 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

Quoted 6 lines
Quoted 4 lines

If we were to change gitweb to handle configuration files like the rest of git (and in fact like most things we deal with daily, where settings are overridden one by one) then this section becomes moot. Until or unless that becomes the case it is important to loudly make note of it.

Does using three exclamation marks and italics make it clearer?

That could probably be cut down to one, I'll grant you that. I was trying to avoid use of the <blink> tag.

Quoted 6 lines

Previously there was no manpage documenting this at all, so I think explaining it is already a big and good step. If this needs to be so prominent that people just skimming through will notice it, then I'd suggest putting it in the DESCRIPTION section higher up. But I'm not the one writing this; others are free to disagree.

I thought seriously about doing that but decided against it as it took this important bit of information out of the appropriate context. If I don't present that there's more than one way to configure gitweb first this text by itself doesn't make a whole lot of sense (and therefore will likely be ignored).

Quoted 11 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+The syntax of the configuration files is that of Perl, as these files are

[...]

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

+page for more information.

Duplicates DESCRIPTION.

Perhaps it does, but not everybody is a Perl coder. It was that way in the text I started from and I saw little point in changing it.

No, the paragraph is actually repeated from the DESCRIPTION section.

Well then, I suppose that is a problem! I don't recall doing that, but it should be corrected.
(As noted below and prior, I haven't been able to apply the interim patches to my @home working copy, so if it came from there I currently don't know it.)

Quoted 15 lines

[...]

Quoted 13 lines
Quoted 13 lines

Documentation/gitweb.conf.txt line 76

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+The default configuration with no configuration file at all may work
+perfectly well for some installations.  Still, a configuration file is
+useful for customizing or tweaking the behavior of gitweb in many ways, and
+some optional features will not be present unless explicitly enabled using
+the configurable `%features` variable (see also "Configuring gitweb
+features" section below).

I suppose this is based on the text

The most notable thing that is not configurable at compile time are the optional features, stored in the '%features' variable.

I'd suggest removing the paragraph.

<snip>

Quoted 11 lines
Quoted 3 lines

Apparently you think that clearing these misconceptions up is a useless exercise, or at least it sounds a lot like it.

What? I wrote exactly what I was thinking, which was that I thought this paragraph was based on the text I quoted from gitweb/INSTALL and that contrasting the run-time and compile-time configuration as that paragraph did didn't seem very important for the installed manpage (since the reader might not have been involved in the installation at all).

Quoted 3 lines

If the point was actually to say "Contrary to popular belief, you can set %features in the configuration file instead of hard-coding it in the CGI script itself", why not say that directly?

Ok, we can do that (or something very much like it, whatever ends up fitting best). Remember that this was sourced prior to our on-list discussion about what came from gitweb/INSTALL being primarily fodder for a different document. I haven't had the chance to modify it since, and I have the impression that Jakub has been busy working on other parts of this project (of which he's done quite a bit). Removing the paragraph wholesale doesn't fix the problem so far as I see it, but the presentation of the information can certainly be better tuned.

Quoted 8 lines

[...]

Quoted 1 line

I cannot keep up with this pace of patching right now.

No problem. For what it's worth, I skipped a couple of rounds of reading, too; I suppose they came quickly. Does that mean you don't want to be cc-ed on later incarnations of the patch, or would you like to stay notified?

I'd like to stay cc'd, I just haven't been able to apply the previous patch versions to my @home work tree before the next has come out, limiting my chances to be able to effectively review them.

I apologize for being a bit snappy, but sometimes I really do have a low tolerance for comments that just seem (to me) to be "this here is really useless" complaints and not suggestions of an upgrade.

Signature · 4 lines
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
#13 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quick reply; more detailed responses will follow.

Quoted 25 lines · Drew Northup
Quoted 24 lines · Jonathan Nieder
Quoted 22 lines · Drew Northup
Quoted 10 lines · Jonathan Nieder

Documentation/gitweb.conf.txt line 46

Quoted 5 lines · Jakub Narebski
Documentation/gitweb.conf.txt new file +5 -0
+The location of system-wide gitweb configuration file is defined at compile
+time using the configuration value `GITWEB_CONFIG_SYSTEM` and defaults to
+'/etc/gitweb.conf'.  The name of the per-instance configuration file is
+defined in gitweb by `GITWEB_CONFIG`, and defaults to 'gitweb_config.perl'
+(relative path means located in the same directory gitweb is installed).

Maybe:

Quoted 8 lines

In addition to the per-instance configuration file, there can be a system-wide configuration file to act as a fallback when the per-instance configuration file does not exist.

The system-wide configuration file is named /etc/gitweb.conf by default. Filenames for the system-wide and per-instance configuration variables can be overridden at compile time and run time; see the FILES section for details.

This is the manpage for the system wide configuration file. If you'd like to scrap this effort in favor of something else please speak up.

Quoted 8 lines
Quoted 1 line

Huh?

If this is what you are proposing then we should be working on a "gitweb_config.perl" manpage and not a "gitweb.conf" manpage. I know a fair number of people around here put priority on the former and would just as soon ignore the latter. That's what your proposed change says to me (while I also understand that your own position is likely far more nuanced than that).

I think this manpage is about both system-wide and per-instance config file, just like gitignore is about both in-tree .gitignore and private $GIT_DIR/info/exclude, like gitattributes is about both in-tree .gitattributes and $GIT_DIR/info/attributes,... just like ssh_config is about both system-wide ssh_config and per-user .ssh/config.

And like all of those manpages are named after one file, just like this manpage.

Perhaps we could even symlink/hardlink gitweb_config.perl manpage to gitweb.conf manpage...

P.S. I am sorry that I didn't state more clear that I modified Drew's original submission, and didn't write in more detail what I have changed. Some of mistakes are mine, not Drew...

Signature · 2 lines
Jakub Narebski
Poland
#14 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

In reply to Drew Northup
Quoted 8 lines · Drew Northup

On Tue, 2011-06-07 at 08:44 -0500, Jonathan Nieder wrote:
...
If this is what you are proposing then we should be working on a "gitweb_config.perl" manpage and not a "gitweb.conf" manpage. I know a fair number of people around here put priority on the former and would just as soon ignore the latter. That's what your proposed change says to me (while I also understand that your own position is likely far more nuanced than that).

Hmm, do you want to have two (and then three, see below) separate manpages that essentially describe the same thing, and refer to each other when they talk about the precedence order?

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 6 lines

Documentation/gitweb.conf.txt line 59

Quoted 3 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

If we were to change gitweb to handle configuration files like the rest of git (and in fact like most things we deal with daily, where settings are overridden one by one) then this section becomes moot. Until or unless that becomes the case it is important to loudly make note of it.

Quoted 4 lines
Quoted 1 line

Does using three exclamation marks and italics make it clearer?

That could probably be cut down to one, I'll grant you that. I was trying to avoid use of the <blink> tag.

I vaguely recall that there was an effort to document /etc/gitweb.conf as a mere "fallback default", not a "system-wide configuration file", which is what it is, and also to introduce a true "system-wide configuration" as a separate file, so that the system-wide one will be read, and then either per-instance gitweb_config.perl or the fallback default /etc/gitweb.conf will update it. What happened to that effort?

In any case, with the current design, /etc/gitweb.conf is _not_ the system-wide configuration file but it is a fallback default for instances that do not have per-instance configuration, so the quoted part would need rewording anyway, I think.

#15 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Drew Northup

On Tue, 2011-06-07 at 08:44 -0500, Jonathan Nieder wrote:
...
If this is what you are proposing then we should be working on a "gitweb_config.perl" manpage and not a "gitweb.conf" manpage. I know a fair number of people around here put priority on the former and would just as soon ignore the latter. That's what your proposed change says to me (while I also understand that your own position is likely far more nuanced than that).

Quoted 3 lines

Hmm, do you want to have two (and then three, see below) separate manpages that essentially describe the same thing, and refer to each other when they talk about the precedence order?

No, I am just saying that if this isn't primarily meant to be about /etc/gitweb.conf (which is what I was told to use here on this very list) then we shouldn't name it after gitweb.conf, nor should we focus on gitweb.conf (the removal of the gitweb.conf we are then effectively deprecating can be discussed later; I have already voiced my opinion on this strategy of ignoring /etc/gitweb.conf but still having it anyway and been summarily declared insane).

The change he made isn't, to me anyway, one of precedence order but is one of focus and theme. Perhaps most people around here aren't trained to hew so closely to the stated purpose of a work as I am and therefore don't see the change he suggested as starkly. So be it.
I really don't like starting work on something for a project because I was told that (1) it was needed and, (2) it would be welcome only to find that neither statement was particularly true. I'd strongly prefer to have been told from the outset "Don't bother to document that, as you're the only one using it that way," and, "Document this instead, as just because you're not using it doesn't mean that we don't think everyone else should be."

Quoted 18 lines
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 7 lines

Documentation/gitweb.conf.txt line 59

Quoted 4 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

If we were to change gitweb to handle configuration files like the rest of git (and in fact like most things we deal with daily, where settings are overridden one by one) then this section becomes moot. Until or unless that becomes the case it is important to loudly make note of it.

Quoted 4 lines
Quoted 1 line

Does using three exclamation marks and italics make it clearer?

That could probably be cut down to one, I'll grant you that. I was trying to avoid use of the <blink> tag.

Quoted 6 lines

I vaguely recall that there was an effort to document /etc/gitweb.conf as a mere "fallback default", not a "system-wide configuration file", which is what it is, and also to introduce a true "system-wide configuration" as a separate file, so that the system-wide one will be read, and then either per-instance gitweb_config.perl or the fallback default /etc/gitweb.conf will update it. What happened to that effort?

You shot it down, that's what. Or more correctly you shot down the use of /etc/gitweb.conf as a system-wide source of default settings instead proposing that it be used as a fallback (?) and that
an /etc/gitweb-defaults.conf (or something like that) be used as a per-item default (or at least that's what I got out of what was said). I'm not sure what to think of that, but I haven't had the chance to test that patch-set in any case, much less incorporate it into the documentation. All of that would come after I'm no longer confused as to what the intended end-result would be.

Quoted 5 lines

In any case, with the current design, /etc/gitweb.conf is _not_ the system-wide configuration file but it is a fallback default for instances that do not have per-instance configuration, so the quoted part would need rewording anyway, I think.

And THAT is the problem. If it isn't a system-wide configuration file then let's stop putting it in /etc, deprecate it, and get it over with. I didn't even know that to be the case when I started writing this, I was just trying to make more readily available the advice I'd been given on this list. Only after getting started did I learn that gitweb treats a file in /etc like nothing else I normally use (aside from adduser/useradd's use of /etc/skel as a directory template).

I'm crawling back into my hole now.

Signature · 4 lines
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
#16 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quoted 12 lines · Drew Northup
Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Drew Northup

On Tue, 2011-06-07 at 08:44 -0500, Jonathan Nieder wrote:
...
If this is what you are proposing then we should be working on a "gitweb_config.perl" manpage and not a "gitweb.conf" manpage. I know a fair number of people around here put priority on the former and would just as soon ignore the latter. That's what your proposed change says to me (while I also understand that your own position is likely far more nuanced than that).

Quoted 7 lines
Quoted 3 lines

Hmm, do you want to have two (and then three, see below) separate manpages that essentially describe the same thing, and refer to each other when they talk about the precedence order?

No, I am just saying that if this isn't primarily meant to be about /etc/gitweb.conf (which is what I was told to use here on this very list) then we shouldn't name it after gitweb.conf,

We have to name it somehow. For example ssh_config(5) is named after system-wide settings file, while it describes also user settings in .ssh/config. We would follow this example with gitweb.conf(5)

A bit closed, gitignore(5) and gitattributes(5) both are named after in-tree file '.gitignore' and '.gitattributes', but describe also private $GIT_DIR/info/exclude (not ignore!) and $GIT_DIR/info/attributes respectively.

Anyway we can use symlinks or hardlinks (or just a plain copy) to have this manpage under both gitweb.conf(5) and gitweb_config(5) or gitweb_config.perl(5). There is precedent: many function manpages are grouped together. For example printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf all use single printf(3) manpage.

But that is better left for a separate commit, if we decide to do this.

Quoted 1 line

nor should we focus on gitweb.conf

Manpage describing gitweb.conf also describes gitweb_conf.perl. The difference is minuscule, so it is IMVHO better to cover both with one manpage, and add a few paragraphs about precedence etc. Isn't it?

Quoted 4 lines

(the removal of the gitweb.conf we are then
effectively deprecating can be discussed later; I have already voiced my opinion on this strategy of ignoring /etc/gitweb.conf but still having it anyway and been summarily declared insane).

The problem is backward compatibility. To not repeat myself, see my thoughts on this issue later, at the end of this email.

Quoted 12 lines

The change he made isn't, to me anyway, one of precedence order but is one of focus and theme. Perhaps most people around here aren't trained to hew so closely to the stated purpose of a work as I am and therefore don't see the change he suggested as starkly. So be it.
I really don't like starting work on something for a project because I was told that (1) it was needed and, (2) it would be welcome only to find that neither statement was particularly true. I'd strongly prefer to have been told from the outset "Don't bother to document that, as you're the only one using it that way," and, "Document this instead, as just because you're not using it doesn't mean that we don't think everyone else should be."

Actually it both was needed and welcome. Thanks again for your work.

The fact that your hard and welcome work on gitweb.conf manpage with small additions (which you don't need to put yourself; we can do it instead) is more general manpage about gitweb config files is a happy thing.

Quoted 6 lines
Quoted 6 lines

I vaguely recall that there was an effort to document /etc/gitweb.conf as a mere "fallback default", not a "system-wide configuration file", which is what it is, and also to introduce a true "system-wide configuration" as a separate file, so that the system-wide one will be read, and then either per-instance gitweb_config.perl or the fallback default /etc/gitweb.conf will update it. What happened to that effort?

If the "version C" effort, namely introducing gitweb-common.conf in

[PATCH/RFC 2/2 (version C)] gitweb: Introduce common system-wide settings for convenience
Message-Id: <[email protected]>
http://thread.gmane.org/gmane.comp.version-control.git/174424/focus=174517

in thread titled

[PATCH 0/2] gitweb: Improve handling of configuration files

is not in cooking stage, but fell into cracks, I can always resend said patch.

Quoted 15 lines

You shot it down, that's what. Or more correctly you shot down the use of /etc/gitweb.conf as a system-wide source of default settings instead proposing that it be used as a fallback (?) and that
an /etc/gitweb-defaults.conf (or something like that) be used as a per-item default (or at least that's what I got out of what was said). I'm not sure what to think of that, but I haven't had the chance to test that patch-set in any case, much less incorporate it into the documentation. All of that would come after I'm no longer confused as to what the intended end-result would be.

Quoted 5 lines

In any case, with the current design, /etc/gitweb.conf is _not_ the system-wide configuration file but it is a fallback default for instances that do not have per-instance configuration, so the quoted part would need rewording anyway, I think.

Quoted 7 lines

And THAT is the problem. If it isn't a system-wide configuration file then let's stop putting it in /etc, deprecate it, and get it over with. I didn't even know that to be the case when I started writing this, I was just trying to make more readily available the advice I'd been given on this list. Only after getting started did I learn that gitweb treats a file in /etc like nothing else I normally use (aside from adduser/useradd's use of /etc/skel as a directory template).

What about /etc/bashrc ? Isn't is treated as fallback, and you have to source it explicitly?

Anyway, because of backward compatibility (bug-compatible) we have to name new system-wide config file /etc/gitweb-common.conf, fallback config be at /etc/gitweb.conf, and per-instance config file gitweb_config.perl Note that these are only defaults; they can be overridden at build time (though you cannot change names of respective environmental variables).

Perhaps at some flag day (1.8.0 is probably to close) we can change it so that system-wide config file is /etc/gitweb.conf, per-instance config file (overriding system-wide settings) is gitweb_config.perl, and fallback system-installed config file used if per-instance config file does not exists is /etc/gitweb_config.perl

But still the manpage should IMVHO be gitweb.conf(5)!

Signature · 2 lines
Jakub Narebski
Poland
#17 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

Quoted 11 lines · Jakub Narebski

Anyway, because of backward compatibility (bug-compatible) we have to name new system-wide config file /etc/gitweb-common.conf, fallback config be at /etc/gitweb.conf, and per-instance config file gitweb_config.perl Note that these are only defaults; they can be overridden at build time (though you cannot change names of respective environmental variables).

Perhaps at some flag day (1.8.0 is probably to close) we can change it so that system-wide config file is /etc/gitweb.conf, per-instance config file (overriding system-wide settings) is gitweb_config.perl, and fallback system-installed config file used if per-instance config file does not exists is /etc/gitweb_config.perl

I would not have asked that such a large change happen any sooner than that.

Signature · 4 lines
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
#19 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

In reply to Jonathan Nieder
Quoted 4 lines · Jonathan Nieder
Quoted 2 lines · Jakub Narebski

+$GIT::

Documentation/gitweb.conf.txt new file +1 -0
+	Core git executable to use.  By default set to `$GIT_BINDIR/git`, which

[...]

Quoted 2 lines

I think a better default would be "git", so if a newer git gets installed in /usr/local/bin then gitweb would notice automatically.

Wait, that's quite wrong. What I was forgetting about is the case where the webmaster does not control the web hosting but just has a place to drop CGI scripts under ~/public_html/cgi-bin. In such a case it would be very convenient that "make install-gitweb" just does the right thing (including using a private copy of git).

Sorry for the nonsense.

#22 lore raw

PATCH 5/5 gitweb: Starting work on a man page for gitweb (WIP)

In reply to Jakub Narebski

Gitweb documentation currently consist of gitweb/README, gitweb/INSTALL and comments in gitweb source code. This is harder to find, use and browse that manpages ("man gitweb" or "git help gitweb") and HTML documentation ("git help --web gitweb").

The goal is to move documentation out of gitweb/README to gitweb.txt and gitweb.conf.txt manpages, reducing its size 10x from around 500 to around 50 lines (two pages), and move information not related drectly to building and installing gitweb out of gitweb/INSTALL there.

To build gitweb documentation you can use

make -C gitweb doc

or

cd gitweb; make doc

This is a work in progress. Much of what is in it has been pulled directly from the README and INSTALL files of gitweb. Some effort has been made to de-duplicate any of this, i.e. to remove contents from gitweb/README and gitweb/INSTALL. The AsciiDoc might (and probably does) contain formatting errors.

Inspired and somewhat modelled by SVN::Web manpage.

---
As you can see it is now much longer (702 lines versus 334 in previous "skeleton" version).

Differences from previous version:

* Duplicated contents removed from gitweb/INSTALL and gitweb/README, but leaving simplest cases to make them a bit more self-contained.

* Added some references from gitweb.conf.txt to gitweb.txt

* Added "Generating projects list using gitweb", "Controlling access to git repositories", "Per-repository gitweb configuration" sections, and "Advanced web server setup" chapter.

 Documentation/Makefile        |    2 +-
 Documentation/gitweb.conf.txt |    8 +
 Documentation/gitweb.txt      |  702 +++++++++++++++++++++++++++++++++++++++++
 gitweb/INSTALL                |   96 +-----
 gitweb/README                 |  278 ++---------------
 5 files changed, 740 insertions(+), 346 deletions(-)
 create mode 100644 Documentation/gitweb.txt
Documentation/Makefile +1 -1
index 68d0ebb..2fcbeac 100644
@@ -1,7 +1,7 @@
 MAN1_TXT= \
 	$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
 		$(wildcard git-*.txt)) \
-	gitk.txt git.txt
+	gitk.txt gitweb.txt git.txt
 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt \
 	gitrepository-layout.txt gitweb.conf.txt
 MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \
Documentation/gitweb.conf.txt +8 -0
index 2bfe2e5..8dece6a 100644
@@ -36,6 +36,10 @@ CGI script with the default name 'gitweb_config.perl' -- allowing
 one to have multiple gitweb instances with different configurations by
 the use of symlinks.
 
+Note that some configuration can be controlled on per-repository rather than
+gitweb-wide basis: see "Per-repository gitweb configuration" subsection on
+linkgit:gitweb[1] manpage.
+
 
 DISCUSSION
 ----------
@@ -88,6 +92,8 @@ Location of repositories
 Configuration variables described below control finding git repositories by
 gitweb, and control display and access to repositories.
 
+See also "Repositories" and later subsections in linkgit:gitweb[1] manpage.
+
 $projectroot::
 	Absolute filesystem path which will be prepended to project path;
 	the path to repository is `$projectroot/$project`.  Set to
@@ -143,6 +149,8 @@ though the above might be done by using `$export_ok` instead
 ----------------------------------------------------------------------------
 our $export_ok = "git-daemon-export-ok";
 ----------------------------------------------------------------------------
+See also more involved example in "Controlling access to git repositories"
+subsection on linkgit:gitweb[1] manpage.
 
 $strict_export::
 	Only allow viewing of repositories also shown on the overview page.
Documentation/gitweb.txt new file +702 -0

702 lines not on this page · raw message

gitweb/INSTALL +9 -87

113 lines not on this page · raw message

gitweb/README +20 -258

295 lines not on this page · raw message

Signature · 1 line
1.7.5
#5 lore raw

Re: [PATCHv3 2/5] gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL

In reply to Jonathan Nieder

On Mon, 6 June 2011, Jonathan Nieder wrote:

Thank you very much for your review and comments.

Quoted 10 lines
Quoted 5 lines · Jakub Narebski

The build-time configuration variables JSMIN and CSSMIN were mentioned only in Makefile; add their description to gitweb/INSTALL.

This required moving description of GITWEB_JS up, near GITWEB_CSS and just introduced CSMIN and JSMIN.

Why does this require that? Ah, to make the analogy with GITWEB_CSS clear and because the JSMIN description refers to it.

Yes, moving description of GITWEB_JS was required because I wanted to cover both of CSSMIN and JSMIN with one entry, which entry of course refers to both GITWEB_CSS and GITWEB_JS.

Quoted 25 lines
Quoted 3 lines
gitweb/INSTALL +0 -0
@@ -147,6 +147,19 @@ You can specify the following configuration variables when building GIT:

[...]

gitweb/INSTALL You can specify the following configuration variables when building GIT: · line 162

Quoted 7 lines

+ * CSSMIN, JSMIN

gitweb/INSTALL +6 -0
+   Invocation of a CSS minifier or a JavaScript minifier, respectively,
+   working as a filter (source on standard input, minified result on
+   standard output).  If set, it is used to generate a minified version of
+   'static/gitweb.css' or 'static/gitweb.js', respectively.  *Note* that
+   minified files would have *.min.css and *.min.js extension, which is
+   important if you also set GITWEB_CSS and/or GITWEB_JS.  [No default]

When I first read this, I thought it meant these command lines were going to be cooked into the gitweb script and invoked at run time. Maybe (sorry for the rough text):

* CSSMIN, JSMIN
Command for a CSS minifier or a Javascript minifier, working as a filter [...]
These are used if defined to generate smaller, non human-readable versions of 'gitweb/gitweb.css' and 'static/gitweb.js' at 'static/gitweb.min.css' and 'static/gitweb.min.js'. Only the minified versions are installed, which is important if you also set GITWEB_CSS or GITWEB_JS. [No default]

Quoted 1 line

Aside from that, looks good. Thanks.

Thanks. I'll incorporate those comments in next round... or as a separate improvement (it is not that bad, I think, to not allow it to be fixed "in tree").

Anyway the description could use some improvements. We need to cover the following issues:

1. CSSMIN and JSMIN are invoked during building gitweb.

2. CSSMIN and JSMIN are interpreted as shell commands, so
* if you refer to script by full path, you need to quote spaces yourself, e.g.

JSMIN="'c:/Program Files/JSMin/jsmin.exe'"

* you can provide options, so you can e.g. use

JSMIN="perl -MJavaScript::Minifier=minify -we 'minify(input => *STDIN, output => *STDOUT);'"

3. CSSMIN and JSMIN must accept source on standard input, and print minified version to standard output, i.e. they are invoked as

     $(CSSMIN) <$< >$@

4. Minified files will be named static/gitweb.min.css and static/gitweb.min.js, respectively

5. If you do not set GITWEB_CSS and GITWEB_JS, but use CSS and/or JSMIN, they would be set to appropriate values automatically

6. The "install" target in gitweb Makefile, and "install-gitweb" target in main Makefile, would install minified versions (if any).

7. If you set both CSSMIN and GITWEB_CSS, you have to adjust GITWEB_CSS by yourself. Same for JSMIN and GITWEB_JS.

Help with wording those would be much appreciated, in more compact form. Thanks in advance.

Signature · 2 lines
Jakub Narebski
Poland (not native English speaker)
#20 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

In reply to Jonathan Nieder
Quoted 6 lines · Jonathan Nieder
Quoted 4 lines · Jonathan Nieder
Quoted 2 lines · Jakub Narebski

+$GIT::

Documentation/gitweb.conf.txt new file +1 -0
+	Core git executable to use.  By default set to `$GIT_BINDIR/git`, which

[...]

Quoted 8 lines
Quoted 2 lines

I think a better default would be "git", so if a newer git gets installed in /usr/local/bin then gitweb would notice automatically.

Wait, that's quite wrong. What I was forgetting about is the case where the webmaster does not control the web hosting but just has a place to drop CGI scripts under ~/public_html/cgi-bin. In such a case it would be very convenient that "make install-gitweb" just does the right thing (including using a private copy of git).

Right, "git" might not be in PATH of a web server (which can have reduced PATH for security reasons anyway).

Signature · 2 lines
Jakub Narebski
Poland
#21 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

In reply to Jonathan Nieder

On Tue, 7 Jun 2011, Jonathan Nieder wrote:

Thank you for your review and comments, and for participating in discussion!

Quoted 6 lines
Quoted 2 lines · Jakub Narebski

Some effort has
been made to de-duplicate any of this.

:)

Please excuse me, but I have noticed that I have "No effort has been made" just before sending patches. So this is unfortunate result of fixing it "on the go".

Quoted 5 lines
Quoted 4 lines

* Much simpler "doc" target in gitweb/Makefile. Now instead of duplicating internal knowledge how Documentation/Makefile works we simply delegate task to "gitweb-doc" target (a la "full-svn-test" in t/Makefile) in Documentation/Makefile.

Quoted 8 lines

Seems sensible as long as the main Makefile never learns

	gitweb-doc:
		$(MAKE) -C gitweb doc

The toplevel Makefile could do "$(MAKE) -C Documentation gitweb-doc" and still avoid the usual pitfalls of recursive make stepping on its own toes.

What do you mean about recursive make troubles here? There is no loop:
Makefile -> gitweb/Makefile -> Documentation/Makefile.

Do you means something like the following

  $ make -j 2 doc gitweb-doc

if main Makefile's "gitweb-doc" would delegate via gitweb/Makefile instead of straight to Documentation/Makefile?

Quoted 6 lines

Longer term, I would like to try making gitweb/Makefile include a build-helpers/Makefile.doc library and moving this documentation back to the gitweb/ directory, which would make the gitweb directory self-contained again (except for the build-helpers/Makefile.doc file). Not sure what to do about that "except for..." bit. I don't think my half-baked long-term ideas should be allowed to slow this down. ;-)

First, this would move dependency from Documentation/Makefile to build-helpers/Makefile-doc.inc

Second such helper would need to solve the ussue that currently in Documentation/Makefile one must specify explicitely to which man section given manpage belongs. You would have to come with some efficient way to get that information from AsciiDoc source and/or file position in hierarchy.

Third, we would still depend on t/Makefile for tests...

BTW. does anyone know any converter from AsciiDoc to POD, or POD formatter formatting to AsciiDoc?

Quoted 2 lines
Quoted 2 lines
Documentation/Makefile +0 -0

[...]

Quoted 8 lines

Documentation/Makefile info: git.info gitman.info · line 174

Quoted 6 lines
Documentation/Makefile +2 -0
@@ -170,6 +170,9 @@ info: git.info gitman.info
 
 pdf: user-manual.pdf
 
+GITWEB_DOC = $(filter gitweb.%,$(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7))
+gitweb-doc: $(GITWEB_DOC)

Nice.

I try... :-)

Quoted 9 lines

Documentation/Makefile quick-install-man: · line 340

Quoted 6 lines
Documentation/Makefile +1 -1
@@ -334,4 +337,4 @@ quick-install-man:
 quick-install-html:
 	'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
 
-.PHONY: FORCE
+.PHONY: FORCE gitweb-doc

Is there any reason other phony targets (like "install" and "pdf") aren't listed here?

I don't know; they weren't there.

Quoted 4 lines
Quoted 4 lines
Documentation/gitweb.conf.txt new file +1 -0
@@ -0,0 +1,716 @@
+gitweb.conf(5)
Quoted 8 lines

Documentation/gitweb.conf.txt line 6

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+==============
+
+NAME
+----
+gitweb.conf - Gitweb configuration file

I suppose the novice can look to the DESCRIPTION or SEE ALSO section to learn what gitweb is.

Well, we could write "Configuration file for git web interface"... but there are [much] more web interfaces for git than gitweb.

Quoted 6 lines

Documentation/gitweb.conf.txt line 12

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+SYNOPSIS
+--------
+[verse]
+'/etc/gitweb.conf'
+'$GITWEBDIR/gitweb_config.perl'
Quoted 8 lines

Micronit: a single line like

	SYNOPSIS
	--------
	$GITWEBDIR/gitweb_config.perl, /etc/gitweb.conf

might fit better with the pattern established by gitattributes(5) and its kin.

I'm sorry, that is my fault and not Drew's.

While Drew was styling gitweb.conf manpage after resolv.conf(5), I took ssh_config(5) as an example. But of course consistency within section 5 git manpages are more important.

Will fix.

Quoted 2 lines
Quoted 2 lines
Documentation/gitweb.conf.txt new file +2 -0
+DESCRIPTION
+-----------

[...]

Quoted 8 lines

Documentation/gitweb.conf.txt

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The configuration file is used to override the default settings that
+were built into gitweb at the time 'gitweb.cgi' script was generated.
+
+While one could just alter the configuration settings in the gitweb
+CGI itself, those changes would be lost upon upgrade.

What if I upgrade using RCS "merge"? :) So maybe:

Quoted 5 lines

s/one could just alter/one can alter/
s/would be lost/could be lost/

to clarify that (1) editing the CGI script is allowed and fine but (2) it might be a pain to keep those changes.

I can agree with 2nd change, but not the first. Besides who use rcsmerge for upgrading (and not something that looks like config file)?

Quoted 8 lines

Documentation/gitweb.conf.txt line 37

Quoted 5 lines

+[...] Configuration

Documentation/gitweb.conf.txt new file +4 -0
+settings might also be placed into a file in the same directory as the
+CGI script with the default name 'gitweb_config.perl' -- allowing
+one to have multiple gitweb instances with different configurations by
+the use of symlinks.

Might also in addition to what? Continuing the thought from before:

Quoted 5 lines

So gitweb allows settings to be placed in a separate file named 'gitweb_config.perl' in the same directory as the CGI script. This also allows one to set up multiple gitweb instances with different configurations by using symlinks to a common gitweb.cgi script.

I think your 2nd paragraph would better be put in notes, or in other separate (sub)section.

Quoted 8 lines
Quoted 2 lines

+DISCUSSION
+----------

First, as a general thought, by the time I get this far I start thinking, "so where's the list of possible settings?". But there are certainly some more basic pieces of information to cover before then (like the global configuration file), so I think this part is in the right place. It just could benefit from being a little shorter.

Right.

Quoted 8 lines

Documentation/gitweb.conf.txt line 46

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The location of system-wide gitweb configuration file is defined at compile
+time using the configuration value `GITWEB_CONFIG_SYSTEM` and defaults to
+'/etc/gitweb.conf'.  The name of the per-instance configuration file is
+defined in gitweb by `GITWEB_CONFIG`, and defaults to 'gitweb_config.perl'
+(relative path means located in the same directory gitweb is installed).

Maybe:

Quoted 8 lines

In addition to the per-instance configuration file, there can be a system-wide configuration file to act as a fallback when the per-instance configuration file does not exist.

The system-wide configuration file is named /etc/gitweb.conf by default. Filenames for the system-wide and per-instance configuration variables can be overridden at compile time and run time; see the FILES section for details.

O.K. Looks better.

Quoted 8 lines

[...]

Documentation/gitweb.conf.txt line 59

Quoted 3 lines
Documentation/gitweb.conf.txt new file +3 -0
+*NOTE:* If per-instance configuration file ('gitweb_config.perl') exists,
+then system-wide configuration file ('/etc/gitweb.conf') is _not used at
+all_!!!

Over the top. :) I think the best way to document this is to contrast it with /etc/gitweb-common.conf once the latter exists.

Well, perhaps it is to be reworded, and use ALL CAPS somewhere, but for the time being I'd rather have this information there.

Though the point might become moot, if (as you noticed) the patch introducing /etc/gitweb-common.conf is merged in before this series. Then this part would have to be reworded.

Quoted 7 lines

Documentation/gitweb.conf.txt line 65

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+The syntax of the configuration files is that of Perl, as these files are
+indeed handled as fragments of Perl code (the language that gitweb itself is
+written in). Variables may be set using "`our $variable = value`"; text from
+"#" character until the end of a line is ignored. See the *perlsyn*(1) man
+page for more information.

Duplicates DESCRIPTION.

Thanks for notocing this. I'd try to come up with shorter explanation in "Description", and longer and more detailed here.

Quoted 6 lines

Documentation/gitweb.conf.txt line 69

Quoted 4 lines
Documentation/gitweb.conf.txt new file +4 -0
+
+Actually using `our` qualifier in `our $variable = <value>;` is a safety
+check: if newer gitweb does no longer use given variable, by using `our` we
+won't get syntax errors.

Maybe this could move to a later NOTES section?

Good idea.

Quoted 10 lines

Documentation/gitweb.conf.txt line 76

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+
+The default configuration with no configuration file at all may work
+perfectly well for some installations.  Still, a configuration file is
+useful for customizing or tweaking the behavior of gitweb in many ways, and
+some optional features will not be present unless explicitly enabled using
+the configurable `%features` variable (see also "Configuring gitweb
+features" section below).

I suppose this is based on the text

Quoted 4 lines

The most notable thing that is not configurable at compile time are the optional features, stored in the '%features' variable.

I'd suggest removing the paragraph.

O.K., as this is in section that needs to be kept short, perhaps simplification is in order. Still, I'd like to mention %feature variable, and refer to later section describing it (which I forgot to add in this version).

Quoted 8 lines

Documentation/gitweb.conf.txt line 84

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+CONFIGURATION VARIABLES
+-----------------------
+Some of configuration variables have their default values (embedded in CGI
+file) set during building gitweb -- if that is the case, it is put in their
+description.  See gitweb's 'INSTALL' file for instructions on building and
+installing gitweb.

Reasonable. Nit: s/put/mentioned/

"Mentioned" is certainly better word here.

Quoted 10 lines

Documentation/gitweb.conf.txt line 89

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+
+Location of repositories
+~~~~~~~~~~~~~~~~~~~~~~~~
+Configuration variables described below control finding git repositories by
+gitweb, and control display and access to repositories.

The configuration variables described below determine where gitweb looks for repositories and which will be displayed.

(missing "The", elaboring on what it means to control repository search.)

Thanks.

I am not a native English speaker, and I seem to be missing "the" from time to time.

Quoted 14 lines

Documentation/gitweb.conf.txt line 116

Quoted 5 lines

+$project_maxdepth::

Documentation/gitweb.conf.txt new file +4 -0
+	Filesystem traversing depth limit for recursively scanning for git
+	repositories, used if `$projects_list` (below) is unset.  The default
+	value of this variable is determined by build-time configuration
+	variable `GITWEB_PROJECT_MAXDEPTH`, which defaults to 2007.

gitweb/INSTALL says:

The filesystem traversing limit for getting the project list; the number is taken as depth relative to the projectroot. It is used when GITWEB_LIST is a directory (or is not set; then project root is used). This is meant to speed up project listing on large work trees by limiting search depth. [Default: 2007]

Quoted 4 lines

I'm still not clear on what it actually means. Is it used when $projects_list points to a directory or not? What if $projects_list points to a file with lines that name directories? What happens when listing forks of a repository?

All right, I'd try to come up with clearer description.

The $project_maxdepth is used _only_ when recursively searching for git repositories, and it always counts depth relative to $projectroot (since the fix to "forks" that made it into git.git repository).

BTW. I don't know why 2007... ;-P

Quoted 18 lines
Quoted 4 lines
Documentation/gitweb.conf.txt new file +4 -0
+
+$projects_list::
+	Plain text file listing projects or name of directory
+	to be scanned for projects.

Documentation/gitweb.conf.txt line 130

Quoted 10 lines
Documentation/gitweb.conf.txt new file +10 -0
+
+	Project list files should list one project per line, with each line
+	having the following format
+-----------------------------------------------------------------------------
+<URI-encoded filesystem path to repository> SP <URI-encoded repository owner>
+-----------------------------------------------------------------------------
+
+The default value of this variable is determined by the `GITWEB_LIST`
+makefile variable at installation time.  If this variable is empty, gitweb
+will fall back to scanning the `$projectroot` directory for repositories.

This gets formatted with the second and later paragraphs being unindented; presumably it needs a "+", like so:

Quoted 5 lines
		... paragraph 1 ...
	+
	--
	... remaining paragraphs ...
	--

It looked all right when I was looking at asciidoc 7.1.3 formatted manpage. I'd have to check how other manpages solve the problem of literal blocks inside description list, and multi-paragraph description lists, and follow their examples.

Quoted 1 line

Can't this point to a directory, too?

*IMPORTANT ISSUE*

I am trying to _evade_ this issue, because of what I see is MISDESIGN of gitweb.

When $projects_list is a file, everything is clear -- pathnames in this file are relative to $projectroot.

But when $projects_list is a directory, it will be recursively scanned for git repositories, and gitweb would show in projects list page their pathnames retalive to $projects_list. But when viewing single repository it would compose full path out of _$projectroot_ and project "name".

Therefore what makes sense is either $projects_list set to file listing repositories, or $projects_list unset; then gitweb would use $projectroot for $projects_list, and scan $projectsroot.

Perhaps there are some rare changes where having $projects_list be set to a directory different from $projectroot has sense, but they are very, very rare (directory populated with symlinks to repositories comes to mind).

So that is why I am always taking here about either $projects_list set to path of plain text file listing repositories, or $projects_list unset. Though perhaps I should explain gitweb behavior in some "notes" (sub)section.

Quoted 9 lines

Documentation/gitweb.conf.txt line 135

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+
+$export_ok::
+	Show repository only if this file exists (in repository).  Only
+	effective if this variable evaluates to true.  Can be set during
+	building gitweb via `GITWEB_EXPORT_OK`.  [No default / Not set]

Am I supposed to show a repository? Ah, no, this is about what gitweb does. Maybe

Quoted 6 lines

Filename to look for in repositories to determine whether to show them. If this variable evaluates to true, gitweb will only show repositories that contain a magic file with that name; otherwise, which repositories gitweb shows is controlled by the $strict_export option. Can be set when building gitweb using the GITWEB_EXPORT_OK variable. [No default]

That is better way of stating this, thanks.

Perhaps s/evaluates to true/is set/ after fixing gitweb to use

  if (defined $export_ok) {

instead of

  if ($export_ok) {
Quoted 1 line

Might be simpler to put the documentation of $strict_export first.

I'd consider this.

Quoted 7 lines

gitweb/INSTALL says:

gitweb
shows repositories only if this file exists in its object database (if directory has the magic file named $export_ok)

but I assume what was meant is the git dir, not .git/objects.

Yes, I meant $GIT_DIR here. I need to somehow explain that this file is not searched for in projects working area. I'd take a look on how git-daemon(1) documents this...

Quoted 4 lines

Incidentally, wouldn't it be more intuitive to treat all values of $export_ok as true (i.e., check "if (defined($export_ok))" instead of "if ($export_ok)") so the user doesn't need to know what values perl considers to be true?

You are right.

Though this would need a separate commit, for easier review.

Quoted 12 lines

[...]

Documentation/gitweb.conf.txt line 153

Quoted 7 lines

+$strict_export::

Documentation/gitweb.conf.txt new file +6 -0
+	Only allow viewing of repositories also shown on the overview page.
+	This for example makes `$gitweb_export_ok` file decide if repository is
+	available and not only if it is shown.  If `$gitweb_list` points to
+	file with list of project, only those repositories listed would be
+	available for gitweb.  Can be set during building gitweb via
+	`GITWEB_STRICT_EXPORT`.  [No default / Not set]

I think I'd put this before $export_ok (because simpler) and steal text from INSTALL.

Quoted 5 lines

By default, even if a project is not visible on the projects list page, you can view it by hand-crafting a gitweb URL. Set the $strict_export variable to true if you want to only allow repositories shown on the overview page to be viewed. Can be set during ...

All right.

Quoted 15 lines

Documentation/gitweb.conf.txt line 160

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+Finding files
+~~~~~~~~~~~~~
+Those configuration variables tell gitweb where to find files.  Values of
+those variables are paths on filesystem.  Of those only `$GIT` is required
+to be (correctly) set for gitweb to be able to work; all the rest are
+required only for extra configuration or extra features.

Perhaps:

System paths
~~~~~~~~~~~~
These configuration variables tell gitweb where to find commands and system files. The values of these variables are commands or paths on the filesystem. Of these, only ...

Quoted 3 lines

(s/those/these/; add some wiggle room since $GIT = "git" is allowed; change the title to contrast with the repository location variables; add a comma.)

Thanks. I couldn't come with a good name for this section, and a good introductory paragraph.

Quoted 12 lines

Documentation/gitweb.conf.txt line 167

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+
+$GIT::
+	Core git executable to use.  By default set to `$GIT_BINDIR/git`, which
+	in turn is by default set to `$(bindir)/git`.  If you use git from binary
+	package, set this to "/usr/bin/git".  This can just be "git" if your
+	webserver has a sensible PATH.  If you have multiple git versions installed
+	it can be used to choose which one to use.

A setting like $GIT = "git --exec-path=elsewhere" would not work because the entire string is used as the first argument to execvp. Not sure how to say it: maybe just

Quoted 5 lines

Command name to use when running git commands. By default this is set to ...

("command name" being a phrase I made up on the spot for "path or bare command name, suitable for passing to execvp".)

I thought that "executable" impled name of a _file_, isn't it? But I'd consider your wording. Thanks.

Quoted 2 lines

I think a better default would be "git", so if a newer git gets installed in /usr/local/bin then gitweb would notice automatically.

I'd rather not we pick first "git" that happens to be in web server PATH. Though nowadays it should be much more rare to encounter "git" binary that is not our git (there was section named "other programs named git" somewhere, but I couldn't find it).

Quoted 8 lines

Documentation/gitweb.conf.txt line 171

Quoted 4 lines

+$mimetypes_file::

Documentation/gitweb.conf.txt new file +3 -0
+	File to use for (filename extension based) guessing of MIME types before
+	trying '/etc/mime.types'.  Path, if relative, is taken currently as
+	relative to the current git repository.  [Unset by default]

What makes $mimetypes_file fit in this section but not $export_ok? (I have no good answer. Maybe a separate section for MIME type guessing would be more discoverable?)

Because it is name of file to be found on filesystem, and not inside git repository. Perhaps I should have made it more clear that this section is not about files inside git repository that control gitweb look and behavior.

But perhaps separate section about MIME type handling, containing a three variables (IIRC) would be a better solution.

Quoted 10 lines

Documentation/gitweb.conf.txt line 193

Quoted 7 lines
Documentation/gitweb.conf.txt new file +7 -0
+Links and their targets
+~~~~~~~~~~~~~~~~~~~~~~~
+Configuration variables described below configure some of gitweb links:
+their target and their look (text or image), and where to find page
+prerequisites (stylesheet, favicon, images, scripts).  Usually they are left
+at their default values, with the possible exception of `@stylesheets`
+variable.

Does "Usually they are left at" mean "Usually there is no reason to change them from"? Aside from that, makes sense.

Yes, it does. Will fix.

Quoted 14 lines
Quoted 14 lines
Documentation/gitweb.conf.txt new file +14 -0
+
+@stylesheets::
+	List of URIs of stylesheets (relative to base URI of a page). You
+	might specify more than one stylesheet, for example use gitweb.css
+	as base, with site specific modifications in separate stylesheet
+	to make it easier to upgrade gitweb. You can add a `site` stylesheet
+	for example by putting
+----------------------------------------------------------------------------
+push @stylesheets, "gitweb-site.css";
+----------------------------------------------------------------------------
+in the gitweb config file.  Those values that are relative paths, are
+relative to base URI of gitweb.
+
+This list should contain URI of gitweb's stylesheet.  The URI of gitweb
Quoted 8 lines

Documentation/gitweb.conf.txt line 213

Quoted 6 lines
Documentation/gitweb.conf.txt new file +6 -0
+stylesheet is set during build time via `GITWEB_CSS` variable.  It's default
+value is 'static/gitweb.css' (or 'static/gitweb.min.css' if the `CSSMIN`
+variable is defined, i.e. if CSS minifier is used during build.
+
+*Note*: there is also legacy `$stylesheet` configuration variable, which was
+used by older gitweb.

s/gitweb$/gitweb's/; s/It's/Its/. Missing closing paren, I think.

O.K.

Quoted 3 lines

s/legacy/the legacy/. How does this interact with the legacy setting (e.g., if I am new on my job as gitweb administrator and encounter such a line, what does it mean and what would I want to change it to)?

Badly.

If $stylesheet variable is defined, it is used as gitweb's stylesheet, and @stylesheets variable is ignored.

If you as administrator encounter old gitweb config file with such a line, you should examine said file to check what was added to stock gitweb CSS, and put additions / changes in a separate file, which would be then separate entry in @stylesheets besides stock gitweb CSS

push @stylesheets, "gitweb-changes.css";

This way upgrading gitweb would upgrade stock part of CSS file.

I think on 1.8.0 boundary, or some other such, we could get rid of legacy $stylesheet variable, perhaps leaving comment here about how to update config file.

Quoted 4 lines
Quoted 4 lines
Documentation/gitweb.conf.txt new file +4 -0
+
+$logo::
+	Points to the location where you put 'git-logo.png' on your web
+	server, or to be more generic URI of logo, 72x27 size).  This image
Quoted 8 lines

Documentation/gitweb.conf.txt line 222

Quoted 5 lines
Documentation/gitweb.conf.txt new file +5 -0
+	is displayed in top right corner of each gitweb page, and used as
+	logo for Atom feed.  Relative to base URI of gitweb (as a path).
+	Can be adjusted during building gitweb using `GITWEB_LOGO` variable
++
+	[Default: 'static/git-logo.png']

Re "as a path": can this be a URI pointing to another server if I want it to?

Yes it can. This way you can serve static content (images, CSS, scripts) from some CDN (Content Delivery Network) on different host for a bit better performance.

Though you would have to install and upgrade such files yourself.

Note: URL can be 'path/to/file', or '/path/to/file', or even 'http://server/path/to/file'. Only last is absolute _URL_, IIRC.

Quoted 8 lines

[...]

Documentation/gitweb.conf.txt line 247

Quoted 3 lines

+$home_link::

Documentation/gitweb.conf.txt new file +2 -0
+	Target of the home link on top of all pages (the first part of view
+	"breadcrumbs").  By default set to absolute URI of a page ($my_uri).

s/By default set to absolute URI of a page/The default is the absolute URI for the gitweb script/

Quoted 4 lines

Stopping here. Will resume later but since having something is better than nothing, I am tempted to say this should be applied e.g. to "next" so people can start using it right away and finding/fixing documentation bugs.

Thanks.

Signature · 2 lines
Jakub Narebski
Poland
#18 lore raw

Re: [RFC/PATCHv3 4/5] gitweb: Starting work on a man page for /etc/gitweb.conf (WIP)

In reply to Drew Northup
Quoted 12 lines · Drew Northup
Quoted 11 lines · Jonathan Nieder
Quoted 5 lines · Jakub Narebski

+SYNOPSIS
+--------
+[verse]
+'/etc/gitweb.conf'
+'$GITWEBDIR/gitweb_config.perl'

Micronit: a single line like

Quoted 8 lines
Quoted 6 lines
	SYNOPSIS
	--------
	$GITWEBDIR/gitweb_config.perl, /etc/gitweb.conf

might fit better with the pattern established by gitattributes(5) and its kin.

I thought that's how I had originally put it.

I am very sorry. The fault is all mine, not Drew. This is my (wrong) change.

When working on gitweb.txt manpage, and actually moving contents from gitweb's README and INSTALL, I have also changed this patch to also remove duplicated contents. And I couldn't resist the temptation to bring further changes... though I should have probably left those for a separate commit, if still claiming this as of Drew's authorship.

[...]

Quoted 11 lines
Quoted 4 lines

Stopping here. Will resume later but since having something is better than nothing, I am tempted to say this should be applied e.g. to "next" so people can start using it right away and finding/fixing documentation bugs.

And so am I [stopping], I suppose. I have had work to do for the past few weeks that really caused me to NEED my weekends for things other than writing code and flossing documentation. Unless I am needed for something I'm going to just let this live or die on it's own for now, as I cannot keep up with this pace of patching right now. (That was in large part the whole point of my flagging this as WIP.)

Should I keep working on it then?

Signature · 2 lines
Jakub Narebski
Poland