File:  [Coherent Logic Development] / freem / scripts / fmd-commit
Revision 1.4: download - view: text, annotated - select for diffs
Sun Apr 6 03:38:05 2025 UTC (5 days ago) by snw
Branches: MAIN
CVS tags: HEAD
Prepare for adding packaging functionality to fmd

#!/usr/bin/env bash

#
#   $Id: fmd-commit,v 1.4 2025/04/06 03:38:05 snw Exp $
#    Commit to FreeM repository
#
#  
#   Author: Serena Willis <snw@coherent-logic.com>
#    Copyright (C) 2025 Coherent Logic Development LLC
#
#
#   This file is part of FreeM.
#
#   FreeM is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Affero Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   FreeM is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Affero Public License for more details.
#
#   You should have received a copy of the GNU Affero Public License
#   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
#
#   $Log: fmd-commit,v $
#   Revision 1.4  2025/04/06 03:38:05  snw
#   Prepare for adding packaging functionality to fmd
#
#   Revision 1.3  2025/04/04 18:19:13  snw
#   Fix fmd-commit call to fmd log
#
#   Revision 1.2  2025/04/04 18:14:56  snw
#   Fix log and commit scripts
#
#   Revision 1.1  2025/04/04 18:00:01  snw
#   *** empty log message ***
#
#
# SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
# SPDX-License-Identifier: AGPL-3.0-or-later
#

function usage() {
    echo
    echo "Commits your changes to the FreeM CVS repository"
    echo
    echo "usage:"
    echo
    echo "  fmd commit \"<commit-message>\""
    echo
    echo "  <commit-message> should describe what this change does."
    echo
    echo "NOTE: the commit message will be added to the ChangeLog"
    echo "      prior to committing the repository."
    echo
    exit 0
}

if [[ $1 == "help" ]]
then
    usage
fi


if [[ $# == 0 ]]
then
    echo "commit:  must be run from 'fmd commit'"
    exit 1
fi

if [[ ! -f sem.ver ]]
then
    echo "Not in the root of the FreeM repository."
    exit 1
fi

if [[ $# != 2 ]]
then
    usage
fi

FMD="$1"
COMMIT_MESSAGE="$2"

OLD_CVS_RSH="${CVS_RSH}"
OLD_CVSROOT="${CVSROOT}"

export CVSROOT=":ext:${_fmd_cvsuser}@cvs.coherent-logic.com:/home/cvsroot"
export CVS_RSH="$(which ssh)"

${FMD} log "${COMMIT_MESSAGE}"
cvs ci -m "${COMMIT_MESSAGE}"

export CVSROOT="${OLD_CVSROOT}"
export CVS_RSH="${OLD_CVS_RSH}"


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>