This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

commitinfo script to check policy, issue warnings (and/or abort commit)

I wrote:

> In addition to any English description, a good place to document this
> policy might be in CVSROOT/commitinfo and a supporting script. [...]

I have finished updating this proposed commitinfo script based on
Gerald Pfeifer, Alexandre Oliva and Mark Mitchell's comments.  The
script has been completed based upon the initial idea and fully tested
in my environment, but someone with shell access to will
have to take over from here and build the contents of
CVSROOT/commitinfo based on the sample in the comment.  Notice that
the GCC Steering Committee can set policy along two lines.

Although I think it is a cool idea, I did not incorporate the
suggestion to open an X11 connection back to client to ask questions
since that would require other policy changes (someone could add this
later).  I also think it might be a good idea if this script used data
from external files instead of being fairly hard-coded (again, someone
could change it later - and the current method has the benefit of
being very straightforward code).

If we want to force people to use `cvs import' to bring libtool into
our source tree (i.e. prevent_commit=0), then this documentation
should appear in

Here is a correct way to use CVS vendor branches with the import
policy rules for libtool (this example for libtool only, but
config.guess, etc should be similar):

1. Create an empty directory (i.e. do not work in a checked-out CVS
   working tree).  Populate it with upgraded libtool files taken from
   the master repository on

   within the directory populated in step 1.

3. Ignore any merge warnings the first time this is done.

4. Run: cvs admin -bSUBVERSION ltconfig libtool.m4 ltcf-*.sh
   at the top level of a checked-out CVS working tree.

If we want to just warn when libtool files are changed
(i.e. prevent_commit=1), then the existing documentation should be OK.
The person's commit will succeed, but they will have been given a
message explaining why they might have broken protocol with a pointer
to more information.  Enabling e-mail (i.e. send_mail=0) only makes
sense when we do not prevent the commit.


# This commitinfo script warns a commiter of violations of the policy
# encoded in section
# "Upstream packages" and suggests actions to be handled outside CVS.
# Upon request, it may be configured to never prevent a commit and to
# send mail to
# Here are the sample contents of CVSROOT/commitinfo to support this
# script (the exact paths must be fully checked by the installer with
# knowledge of's CVS repository layout):
# /cvs/gcc/boehm-gc check-gcc-commit
# /cvs/gcc/fastjar check-gcc-commit
# /cvs/gcc/.* true
# /cvs/gcc check-gcc-commit

# GCC Steering Committee settable values
# (all booleans using UNIX shell conventions that 0 is true)

# Should this script prevent the commit if it detects a violation?

# Should this script send e-mail upon issuing a warning?

# Run environment settable values


# NO settable values past this point

# Handle warnings for commits into special subdirectories.  This is
# really just a memory aid since it is not wrong to commit these
# changes.
for i in `basename $1`; do case $i in
    echo "WARNING: Patches should be sent to, but it was"
    echo "WARNING: acceptable to check them in the GCC CVS tree before"
    echo "WARNING: getting them installed in the master tree."
    exit 0;;
    echo "WARNING: The master sources are at"
    echo "WARNING: Local patches should be sent upstream, but it was"
    echo "WARNING: acceptable to check them in the GCC CVS tree before"
    echo "WARNING: getting them installed in the master tree."
    exit 0;;
esac; done


shift; for i in $*; do case $i in
    echo "WARNING: $i should only be upgraded from the related external"
    echo "WARNING: master source repository using 'cvs import'."
    imported_files_committed="$imported_files_committed $i"
    echo "WARNING: $i should be synchronized with the corresponding file"
    echo "WARNING: in the src repository at"
esac; done

if (exit $message_emitted); then
  echo "WARNING: See for details."

if (exit $important_message_emitted); then
  if (exit $send_mail); then
    mail -s 'CVS commit operation to imported files' $send_mail_to <<EOF
Someone committed a change to the following file(s):

This is usually not the correct procedure to update these file(s).
See for complete details.
  if (exit $prevent_commit); then exit 1; fi

exit 0

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]