SVN commit and inspection checks?

Just wondering, but can we set up the SVN commit script to verify the file with our inspect program before a commit is allowed? No doubt folks will be greatly annoyed by this at first, but at least we should gradually get those inspection-failures fixed that way :-) John.

John Maddock wrote:
Just wondering, but can we set up the SVN commit script to verify the file with our inspect program before a commit is allowed? No doubt folks will be greatly annoyed by this at first, but at least we should gradually get those inspection-failures fixed that way :-)
Yes, we can. We're already doing checks for MIME types, end-of-line styles, and well-formed XML. Typically, I'd like to have all of the problems fixed for files in the repository before putting in a check for those problems, so that everything is consistent. However, this might be one case where it makes sense to put in the checks first. - Doug

2007/8/3, Douglas Gregor <dgregor@osl.iu.edu>:
John Maddock wrote:
Just wondering, but can we set up the SVN commit script to verify the file with our inspect program before a commit is allowed? No doubt folks will be greatly annoyed by this at first, but at least we should gradually get those inspection-failures fixed that way :-)
Yes, we can. We're already doing checks for MIME types, end-of-line styles, and well-formed XML.
Typically, I'd like to have all of the problems fixed for files in the repository before putting in a check for those problems, so that everything is consistent. However, this might be one case where it makes sense to put in the checks first.
I definitely agree. Everyone active enough to commit ought to be interested enough to fix warnings. /$

Henrik Sundberg wrote:
2007/8/3, Douglas Gregor <dgregor@osl.iu.edu>:
John Maddock wrote:
Just wondering, but can we set up the SVN commit script to verify the file with our inspect program before a commit is allowed? No doubt folks will be greatly annoyed by this at first, but at least we should gradually get those inspection-failures fixed that way :-)
Yes, we can. We're already doing checks for MIME types, end-of-line styles, and well-formed XML.
Typically, I'd like to have all of the problems fixed for files in the repository before putting in a check for those problems, so that everything is consistent. However, this might be one case where it makes sense to put in the checks first.
I definitely agree. Everyone active enough to commit ought to be interested enough to fix warnings.
Ditto. I think this is well worth pursuing. --Beman

Douglas Gregor wrote:
John Maddock wrote:
Just wondering, but can we set up the SVN commit script to verify the file with our inspect program before a commit is allowed? No doubt folks will be greatly annoyed by this at first, but at least we should gradually get those inspection-failures fixed that way :-)
Yes, we can. We're already doing checks for MIME types, end-of-line styles, and well-formed XML.
We just ran into a false positive with validating XML. The problem here, I believe, is that a pre-commit script simply invokes xmllint. That, however, may miss important variables that would otherwise be present (in a regular build). (The actual error is due to xmllint failing to find entity definitions from an .ent file.) To fix this properly, the validation would need to invoke the build system itself, since only there all the relevant variables are known. But is that really the right thing to do from within a pre-checkin validation script ? You don't invoke a C++ compiler to make sure a patched C++ file actually compiles, either... Regards, Stefan -- ...ich hab' noch einen Koffer in Berlin...

Stefan Seefeld wrote:
Douglas Gregor wrote:
John Maddock wrote:
Just wondering, but can we set up the SVN commit script to verify the file with our inspect program before a commit is allowed? No doubt folks will be greatly annoyed by this at first, but at least we should gradually get those inspection-failures fixed that way :-)
Yes, we can. We're already doing checks for MIME types, end-of-line styles, and well-formed XML.
We just ran into a false positive with validating XML. The problem here, I believe, is that a pre-commit script simply invokes xmllint. That, however, may miss important variables that would otherwise be present (in a regular build). (The actual error is due to xmllint failing to find entity definitions from an .ent file.)
To fix this properly, the validation would need to invoke the build system itself, since only there all the relevant variables are known. But is that really the right thing to do from within a pre-checkin validation script ? You don't invoke a C++ compiler to make sure a patched C++ file actually compiles, either...
Probably the only XML file we should be validating is the expected failures markup -- where we know the right command to use. - Volodya
participants (6)
-
Beman Dawes
-
Douglas Gregor
-
Henrik Sundberg
-
John Maddock
-
Stefan Seefeld
-
Vladimir Prus