Annotation of freem/scripts/fmd-commit, revision 1.4
1.1 snw 1: #!/usr/bin/env bash
2:
3: #
1.4 ! snw 4: # $Id: fmd-commit,v 1.3 2025/04/04 18:19:13 snw Exp $
1.1 snw 5: # Commit to FreeM repository
6: #
7: #
8: # Author: Serena Willis <snw@coherent-logic.com>
9: # Copyright (C) 2025 Coherent Logic Development LLC
10: #
11: #
12: # This file is part of FreeM.
13: #
14: # FreeM is free software: you can redistribute it and/or modify
15: # it under the terms of the GNU Affero Public License as published by
16: # the Free Software Foundation, either version 3 of the License, or
17: # (at your option) any later version.
18: #
19: # FreeM is distributed in the hope that it will be useful,
20: # but WITHOUT ANY WARRANTY; without even the implied warranty of
21: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22: # GNU Affero Public License for more details.
23: #
24: # You should have received a copy of the GNU Affero Public License
25: # along with FreeM. If not, see <https://www.gnu.org/licenses/>.
26: #
1.2 snw 27: # $Log: fmd-commit,v $
1.4 ! snw 28: # Revision 1.3 2025/04/04 18:19:13 snw
! 29: # Fix fmd-commit call to fmd log
! 30: #
1.3 snw 31: # Revision 1.2 2025/04/04 18:14:56 snw
32: # Fix log and commit scripts
33: #
1.2 snw 34: # Revision 1.1 2025/04/04 18:00:01 snw
35: # *** empty log message ***
36: #
1.1 snw 37: #
38: # SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
39: # SPDX-License-Identifier: AGPL-3.0-or-later
40: #
41:
42: function usage() {
1.4 ! snw 43: echo
! 44: echo "Commits your changes to the FreeM CVS repository"
! 45: echo
! 46: echo "usage:"
! 47: echo
! 48: echo " fmd commit \"<commit-message>\""
! 49: echo
! 50: echo " <commit-message> should describe what this change does."
! 51: echo
! 52: echo "NOTE: the commit message will be added to the ChangeLog"
! 53: echo " prior to committing the repository."
! 54: echo
! 55: exit 0
1.1 snw 56: }
57:
1.4 ! snw 58: if [[ $1 == "help" ]]
! 59: then
! 60: usage
! 61: fi
! 62:
! 63:
1.1 snw 64: if [[ $# == 0 ]]
65: then
66: echo "commit: must be run from 'fmd commit'"
67: exit 1
68: fi
69:
70: if [[ ! -f sem.ver ]]
71: then
72: echo "Not in the root of the FreeM repository."
73: exit 1
74: fi
75:
76: if [[ $# != 2 ]]
77: then
78: usage
79: fi
80:
1.3 snw 81: FMD="$1"
1.2 snw 82: COMMIT_MESSAGE="$2"
1.1 snw 83:
1.4 ! snw 84: OLD_CVS_RSH="${CVS_RSH}"
! 85: OLD_CVSROOT="${CVSROOT}"
! 86:
! 87: export CVSROOT=":ext:${_fmd_cvsuser}@cvs.coherent-logic.com:/home/cvsroot"
! 88: export CVS_RSH="$(which ssh)"
! 89:
1.1 snw 90: ${FMD} log "${COMMIT_MESSAGE}"
91: cvs ci -m "${COMMIT_MESSAGE}"
92:
1.4 ! snw 93: export CVSROOT="${OLD_CVSROOT}"
! 94: export CVS_RSH="${OLD_CVS_RSH}"
! 95:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>