Up: editinfo


C.6.1 editinfo 記述例

次に、ちょっとアホくさい editinfo の使用例を、 対応する rcsinfo、ログ・メッセージの雛型、 エディタ・スクリプトと併わせて紹介します。 まずログ・メッセージの雛型ですが、 最初の行に必ずバグ番号を記録するように促し、 残りは自由に記述してもらいます。 この雛型は /usr/cvssupport/tc.template に置くことにします。

     BugId:

ログ・メッセージを編集するため、 次のスクリプト /usr/cvssupport/bugid.edit を使用します。

     #!/bin/sh
     #
     #       bugid.edit filename
     #
     #  Call $EDITOR on FILENAME, and verify that the
     #  resulting file contains a valid bugid on the first
     #  line.
     if [ "x$EDITOR" = "x" ]; then EDITOR=vi; fi
     if [ "x$CVSEDITOR" = "x" ]; then CVSEDITOR=$EDITOR; fi
     $CVSEDITOR $1
     until head -1|grep '^BugId:[ ]*[0-9][0-9]*$' < $1
     do  echo -n  "No BugId found.  Edit again? ([y]/n)"
         read ans
         case ${ans} in
             n*) exit 1;;
         esac
         $CVSEDITOR $1
     done

ファイル editinfo には次の行を記述します:

     ^tc     /usr/cvssupport/bugid.edit

ファイル rcsinfo には次の行を記述します:

     ^tc     /usr/cvssupport/tc.template