[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: how to usage check-mime-type.pl?

From: Zoom Quiet <zoom.quiet_at_gmail.com>
Date: 2006-01-10 08:17:17 CET

2006/1/9, Ryan Schmidt <subversion-2006Q1@ryandesign.com>:
> On Jan 9, 2006, at 04:49, Zoom Quiet wrote:
>
> >> so usage http://subversion.tigris.org/faq.html#auto-props
> >> i open pre-commit hook for alert empty commit-log,
> >> so it work... but not any message return TortoiseSVN, like snap
> >> img in atta.
> >
> > i means if, there return::
> > 'pre-commit' hook failed with error outpu:
> > u can not commit with wmpty log!
> >
> > is sweet! and enough...
>
> I don't know anything about check-mime-type.pl; from the name, I
> assume it checks files' MIME types.
>
> If you want to prevent empty commit messages, that can be
> accomplished simply with a Bash script; this is what we use in our
> pre-commit script:
>
>
> #!/bin/sh
>
> REPOS="$1"
> TXN="$2"
>
> # Make sure that the log message contains some text.
> SVNLOOK=/usr/bin/svnlook
> $SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null
>
> if [ $? != 0 ]; then
> echo "Commit message may not be empty." 1>&2
> exit 1
> fi
>
> # All checks passed, so allow the commit.
> exit 0
>
simple add u scipt into pre-commit hook;
it working, anti empty commit-log , but in TortoiseSVN not the alert message
"Commit message may not be empty." show!

the TortoiseSVN bad or the echo ... 1>&2 can not return?
My hook:
...
# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null || exit 1

if [ $? != 0 ]; then
        echo "$TXN $REPOS" 1>&2
        echo "Commit message may not be empty." 1>&2
        exit 1
fi

thanx for any suggest...
>

--
# Time is unimportant, only life important!
## 面朝开源,我心自由!
Received on Tue Jan 10 08:21:09 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.