I've done the move of GCC wwwdocs to git (using the previously posted and discussed scripts), including setting up the post-receive hook to do the same things previously covered by the old CVS hooks, and minimal updates to the web pages dealing with the CVS setup for wwwdocs.
Note 1: someone with the right access needs to create the symlink /sourceware/git/gcc-wwwdocs.git -> /sourceware/projects/gcc-home/wwwdocs.git (and anything else needed for anonymous git access to that repository). Once that's done I'll simplify the path given for git checkouts in about.html and restore instructions for anonymous checkout. Note 2: changes may be needed to the process for updating www.gnu.org and Gerald's validator. Note 3: I don't see any reason the automated process (see maintainer-scripts/update_web_docs_svn in the main GCC sources repository) for generating install/ documentation should be broken by this, but that will still need watching carefully to see if it works as expected. diff --git a/bin/post-receive b/bin/post-receive new file mode 100755 index 00000000..1114efcb --- /dev/null +++ b/bin/post-receive @@ -0,0 +1,55 @@ +#!/bin/bash + +# The post-receive hook receives, on standard input, a series of lines +# of the form: +# +# <old-value> SP <new-value> SP <ref-name> LF +# +# describing ref updates that have just occurred. In the case of this +# repository, only updates to refs/heads/master are expected, and only +# such updates should result in automatic website updates. + +TOP_DIR=/www/gcc + +exec >> "$TOP_DIR/updatelog" 2>&1 + +export QMAILHOST=gcc.gnu.org + +tmp=$(mktemp) +cat > "$tmp" + +# Send commit emails. Appropriate config values should be set in the +# git repository for this. +/sourceware/libre/infra/bin/post-receive-email < "$tmp" + +# Update web page checkouts, if applicable. +while read old_value new_value ref_name; do + if [ "$ref_name" != "refs/heads/master" ]; then + continue + fi + unset GIT_DIR + unset GIT_WORK_TREE + cd "$TOP_DIR/wwwdocs-checkout" + git pull --quiet + # $TOP_DIR/bin, $TOP_DIR/cgi-bin and $TOP_DIR/htdocs-preformatted + # should be symlinks into wwwdocs-checkout. + git diff --name-only "$old_value..$new_value" | while read file; do + case "$file" in + (htdocs/*) + ;; + (*) + continue + ;; + esac + dir="${file%/*}" + if ! [ -d "$TOP_DIR/$dir" ]; then + mkdir "$TOP_DIR/$dir" + chmod 2775 "$TOP_DIR/$dir" + fi + if [ -f "$file" ]; then + /www/gcc/bin/preprocess "${file#htdocs/}" + fi + done +done < "$tmp" + +rm "$tmp" diff --git a/bin/preprocess b/bin/preprocess index 2d09d548..56f83838 100755 --- a/bin/preprocess +++ b/bin/preprocess @@ -160,7 +160,7 @@ process_file() fi case $f in - */CVS|*\.cvsignore) + */.git|*\.gitignore) ;; *\.ihtml|*\.mhtml) ;; @@ -248,8 +248,8 @@ if [ $# -gt 0 ]; then done else # Process all files in the source tree, excluding files/directories - # called CVS. - for f in `find . \( -name CVS -prune \) -o -type f -print` ; do + # called .git. + for f in `find . \( -name .git -prune \) -o -type f -print` ; do process_file $f done fi diff --git a/htdocs/about.html b/htdocs/about.html index 19dd080c..30a5c943 100644 --- a/htdocs/about.html +++ b/htdocs/about.html @@ -19,7 +19,7 @@ many <a href="https://gcc.gnu.org/onlinedocs/gcc/Contributors.html">contributors </a>.</p> -<p>The web pages are under <a href="#cvs">CVS control</a>. +<p>The web pages are under <a href="#git">git control</a>. The pages on gcc.gnu.org are updated directly after a change has been committed. www.gnu.org is updated once a day at 4:00 -0700 (PDT).</p> @@ -48,20 +48,16 @@ a higher chance of being implemented soon. ;-)</p> <hr /> -<h2 id="cvs">Using the CVS repository</h2> +<h2 id="git">Using the git repository</h2> -<p>Assuming you have both CVS +<p>Assuming you have both git and SSH installed, you can check out the web pages as follows:</p> <ol> - <li>Set CVS_RSH in your environment to <code>ssh</code>.</li> - <li><code>cvs -q -d :ext:<i>username</i>@gcc.gnu.org:/cvs/gcc checkout --P wwwdocs</code> where <i>username</i> is your user name at gcc.gnu.org</li> + <li><code>git clone git+ssh://<i>username</i>@gcc.gnu.org/sourceware/projects/gcc-home/wwwdocs.git</code> + where <i>username</i> is your user name at gcc.gnu.org</li> </ol> -<p>For anonymous access, use -<code>-d :pserver:c...@gcc.gnu.org:/cvs/gcc</code> instead.</p> - <h3>Validating a change</h3> @@ -76,14 +72,14 @@ the <a href="https://validator.w3.org">W3 Validator</a>. Just use the and prefer that each checkin be of a complete, single logical change.</p> <ol> -<li>Sync your sources with the master repository via "<code>cvs -update</code>". +<li>Sync your sources with the master repository via "<code>git pull</code>". This will also identify any files in your local tree that you have modified.</li> -<li>We recommend reviewing the output of "<code>cvs diff</code>".</li> +<li>We recommend reviewing the output of "<code>git diff</code>".</li> -<li>Use "<code>cvs commit</code>" to check in the patch.</li> +<li>Use "<code>git commit</code>" and "<code>git push origin +master</code>" to check in the patch.</li> <li>Upon checkin a message will be sent to the gcc-cvs-wwwdocs mailing list.</li> diff --git a/htdocs/contribute.html b/htdocs/contribute.html index 91fa65ad..499dfe86 100644 --- a/htdocs/contribute.html +++ b/htdocs/contribute.html @@ -152,7 +152,7 @@ validator.</p> <p>Please mark patches with the tag [wwwdocs] in the subject line.</p> -<p>More <a href="about.html#cvs">about our web pages</a>.</p> +<p>More <a href="about.html#git">about our web pages</a>.</p> <h2 id="patches">Submitting Patches</h2> diff --git a/htdocs/svn.html b/htdocs/svn.html index 5e93115e..2b90966b 100644 --- a/htdocs/svn.html +++ b/htdocs/svn.html @@ -22,7 +22,7 @@ GCC that is in our repository.</p> <p>In addition you can <a href="https://gcc.gnu.org/viewcvs/gcc/">browse our SVN history online</a>.</p> -<p>(Our <a href="about.html#cvs">web pages are managed via CVS</a>.)</p> +<p>(Our <a href="about.html#git">web pages are managed via git</a>.)</p> <h2>Using the SVN repository</h2> diff --git a/htdocs/svnwrite.html b/htdocs/svnwrite.html index 057a66a9..1a22133a 100644 --- a/htdocs/svnwrite.html +++ b/htdocs/svnwrite.html @@ -12,7 +12,7 @@ <p>We have read/write access to the SVN repository available for maintainers and significant developers.</p> -<p>Our <a href="about.html#cvs">web pages are managed via CVS</a>.</p> +<p>Our <a href="about.html#git">web pages are managed via git</a>.</p> <hr /> <h2>Contents</h2> -- Joseph S. Myers jos...@codesourcery.com