commit 2c898721c6a63b2b104e08588ee402882afea357
parent c30191e15cb3e3de4bb4a67a78d560e3be9c71ef
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 30 May 2025 15:26:13 +0200
git-publish: "force" option added
Force HTML page regeneration to handle all repository updates that may
not be taken into account due to caching mechanisms.
Diffstat:
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/git-publish b/git-publish
@@ -41,7 +41,7 @@ die()
synopsis()
{
>&2 printf \
-'usage: %s [-g dir_git] [-u base_url] [-w dir_www] repository ...\n' \
+'usage: %s [-f] [-g dir_git] [-u base_url] [-w dir_www] repository ...\n' \
"${0##*/}"
}
@@ -91,6 +91,7 @@ check_repo()
# - dir_git: directory where to publish the git repository
# - dir_www: directory where to publish the git repository's HTML pages
# - repo: git bare repository
+# - force: force generation of HTML pages from scratch
publish_repo()
{
repo_name=$(basename "${repo}" ".git")
@@ -102,6 +103,7 @@ publish_repo()
# Create directory publicly served by the WWW daemon
repo_www="${dir_www}/${repo_name}"
+ [ ! "${force}" -eq 0 ] && rm -rf "${repo_www}"
mkdir -p "${repo_www}"
# Generate HTML pages for the repository to be published
diff --git a/git-publish.1 b/git-publish.1
@@ -12,7 +12,7 @@
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
-.Dd May 26, 2025
+.Dd May 30, 2025
.Dt GIT-PUBLISH 1
.Os
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -22,6 +22,7 @@
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.Sh SYNOPSIS
.Nm
+.Op Fl f
.Op Fl g Ar dir_git
.Op Fl u Ar base_url
.Op Fl w Ar dir_www
@@ -55,6 +56,11 @@ an invalid URL.
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl f
+Force HTML generation from scratch.
+Enabling this option ensures that HTML pages take into account any
+changes in the repositories, such as their metadata
+.Pq see Sx FILES No section .
.It Fl g Ar dir_git
Directory in which git repositories are publicly exposed.
By default, the
@@ -107,9 +113,22 @@ The default is
.El
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.Sh FILES
-The following files are assumed to be in the
+In each bare repository, the content of follow files specifies its
+metadata:
+.Bl -tag -width Ds
+.It Pa description
+Brief description of the repository.
+.It Pa owner
+Owner of repository.
+.It Pa url
+Public URL from which the repository can be cloned.
+.El
+.Pp
+To control the appearance of HTML pages, the following files can be
+defined in the
.Ar dir_www
-directory:
+directory.
+Otherwise, the default files provided by git-publish will be used:
.Bl -tag -width Ds
.It Pa style.css
HTML stylesheet.