public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: <gcc@gcc.gnu.org>, <gcc-patches@gcc.gnu.org>
Cc: <overseers@gcc.gnu.org>
Subject: GCC wwwdocs move to git done
Date: Wed, 09 Oct 2019 00:27:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.21.1910090021470.32747@digraph.polyomino.org.uk> (raw)

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:cvs@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
joseph@codesourcery.com

             reply	other threads:[~2019-10-09  0:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09  0:27 Joseph Myers [this message]
2019-10-09  1:04 ` Frank Ch. Eigler
2019-10-09 15:06   ` Joseph Myers
2019-10-09 16:28     ` David Malcolm
2019-10-09  8:01 ` Thomas Schwinge
2019-10-09  9:44 ` Jonathan Wakely
2019-10-09 12:25   ` Iain Sandoe
2019-10-09 13:38     ` Christopher Faylor
2019-10-09 13:40       ` Iain Sandoe
2019-10-09 13:41       ` Christopher Faylor
2019-10-09 13:43       ` David Malcolm
2019-10-09 12:29   ` Mark Wielaard
2019-10-20 16:40 ` Gerald Pfeifer
2019-10-24  9:32 ` Jose E. Marchesi
2019-11-06 14:03 ` Georg-Johann Lay
2019-11-06 14:05   ` Georg-Johann Lay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1910090021470.32747@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=overseers@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).