You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Shai Erera <se...@gmail.com> on 2010/12/18 04:45:06 UTC

Do we want 'nocommit' to fail the commit?

Hi

Out of curiosity, I searched if we can have a nocommit comment in the code
fail the commit. As far as I see, we try to avoid accidental commits (of say
debug messages) by putting a nocommit comment, but I don't know if "svn ci"
would fail in the presence of such comment - I guess not because we've seen
some accidental nocommits checked in already in the past.

So I Googled around and found that if we have control of the svn repo, we
can add a pre-commit hook that will check and fail the commit. Here is a
nice article that explains how to add pre-commit hooks in general (
http://wordaligned.org/articles/a-subversion-pre-commit-hook). I didn't try
it yet (on our local svn instance), so I cannot say how well it works, but
perhaps someone has experience with it ...

So if this is interesting, and is doable for Lucene (say, open a JIRA issue
for Infra?) I don't mind investigating it further and write the script
(which can be as simple as 'grep the changed files and fail on the presence
of nocommit string').

Shai

Re: Do we want 'nocommit' to fail the commit?

Posted by Earwin Burrfoot <ea...@gmail.com>.
But. Er. What if we happen to have "nocommit" in a string, or in some
docs, or as a name of variable?

On Sat, Dec 18, 2010 at 12:47, Michael McCandless
<lu...@mikemccandless.com> wrote:
> +1 this would be great :)
>
> Mike
>
> On Fri, Dec 17, 2010 at 10:45 PM, Shai Erera <se...@gmail.com> wrote:
>> Hi
>> Out of curiosity, I searched if we can have a nocommit comment in the code
>> fail the commit. As far as I see, we try to avoid accidental commits (of say
>> debug messages) by putting a nocommit comment, but I don't know if "svn ci"
>> would fail in the presence of such comment - I guess not because we've seen
>> some accidental nocommits checked in already in the past.
>> So I Googled around and found that if we have control of the svn repo, we
>> can add a pre-commit hook that will check and fail the commit. Here is a
>> nice article that explains how to add pre-commit hooks in general
>> (http://wordaligned.org/articles/a-subversion-pre-commit-hook). I didn't try
>> it yet (on our local svn instance), so I cannot say how well it works, but
>> perhaps someone has experience with it ...
>> So if this is interesting, and is doable for Lucene (say, open a JIRA issue
>> for Infra?) I don't mind investigating it further and write the script
>> (which can be as simple as 'grep the changed files and fail on the presence
>> of nocommit string').
>> Shai
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>



-- 
Kirill Zakharenko/Кирилл Захаренко (earwin@gmail.com)
Phone: +7 (495) 683-567-4
ICQ: 104465785

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Do we want 'nocommit' to fail the commit?

Posted by Michael McCandless <lu...@mikemccandless.com>.
+1 this would be great :)

Mike

On Fri, Dec 17, 2010 at 10:45 PM, Shai Erera <se...@gmail.com> wrote:
> Hi
> Out of curiosity, I searched if we can have a nocommit comment in the code
> fail the commit. As far as I see, we try to avoid accidental commits (of say
> debug messages) by putting a nocommit comment, but I don't know if "svn ci"
> would fail in the presence of such comment - I guess not because we've seen
> some accidental nocommits checked in already in the past.
> So I Googled around and found that if we have control of the svn repo, we
> can add a pre-commit hook that will check and fail the commit. Here is a
> nice article that explains how to add pre-commit hooks in general
> (http://wordaligned.org/articles/a-subversion-pre-commit-hook). I didn't try
> it yet (on our local svn instance), so I cannot say how well it works, but
> perhaps someone has experience with it ...
> So if this is interesting, and is doable for Lucene (say, open a JIRA issue
> for Infra?) I don't mind investigating it further and write the script
> (which can be as simple as 'grep the changed files and fail on the presence
> of nocommit string').
> Shai

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Do we want 'nocommit' to fail the commit?

Posted by Shai Erera <se...@gmail.com>.
I haven't seen nocommit in the code, neither as String nor as member. But we
can decide that we do @nocommit@ or something, which is less likely to be
contained in code :).

Uwe, I didn't understand your response - do you mean that if the code
contains a 'nocommit' in any of the .java files, Hudson will fail?

If we have no control on svn, we can create a special unit test that asserts
exactly that. If you run your tests before commit (as you should :)), it
will be detected. If not, Hudson will detect it (that is, unless it already
somehow detects it).

Shai

On Sat, Dec 18, 2010 at 11:56 AM, Uwe Schindler <uw...@thetaphi.de> wrote:

> I like this idea, too. But I think we have no control on this, it would be
> as complicated as the mergeprops...
>
> What we have: Hudson halfly hour builds fail when svn contains commits, so
> you see it latest 30 Min later.
>
> Uwe
>
>
>
> "Shai Erera" <se...@gmail.com> schrieb:
>
> >Hi
> >
> >Out of curiosity, I searched if we can have a nocommit comment in the
> >code
> >fail the commit. As far as I see, we try to avoid accidental commits
> >(of say
> >debug messages) by putting a nocommit comment, but I don't know if "svn
> >ci"
> >would fail in the presence of such comment - I guess not because we've
> >seen
> >some accidental nocommits checked in already in the past.
> >
> >So I Googled around and found that if we have control of the svn repo,
> >we
> >can add a pre-commit hook that will check and fail the commit. Here is
> >a
> >nice article that explains how to add pre-commit hooks in general (
> >http://wordaligned.org/articles/a-subversion-pre-commit-hook). I didn't
> >try
> >it yet (on our local svn instance), so I cannot say how well it works,
> >but
> >perhaps someone has experience with it ...
> >
> >So if this is interesting, and is doable for Lucene (say, open a JIRA
> >issue
> >for Infra?) I don't mind investigating it further and write the script
> >(which can be as simple as 'grep the changed files and fail on the
> >presence
> >of nocommit string').
> >
> >Shai
>
> --
> Uwe Schindler
> H.-H.-Meier-Allee 63, 28213 Bremen
> http://www.thetaphi.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Do we want 'nocommit' to fail the commit?

Posted by Uwe Schindler <uw...@thetaphi.de>.
I like this idea, too. But I think we have no control on this, it would be as complicated as the mergeprops...

What we have: Hudson halfly hour builds fail when svn contains commits, so you see it latest 30 Min later.

Uwe



"Shai Erera" <se...@gmail.com> schrieb:

>Hi
>
>Out of curiosity, I searched if we can have a nocommit comment in the
>code
>fail the commit. As far as I see, we try to avoid accidental commits
>(of say
>debug messages) by putting a nocommit comment, but I don't know if "svn
>ci"
>would fail in the presence of such comment - I guess not because we've
>seen
>some accidental nocommits checked in already in the past.
>
>So I Googled around and found that if we have control of the svn repo,
>we
>can add a pre-commit hook that will check and fail the commit. Here is
>a
>nice article that explains how to add pre-commit hooks in general (
>http://wordaligned.org/articles/a-subversion-pre-commit-hook). I didn't
>try
>it yet (on our local svn instance), so I cannot say how well it works,
>but
>perhaps someone has experience with it ...
>
>So if this is interesting, and is doable for Lucene (say, open a JIRA
>issue
>for Infra?) I don't mind investigating it further and write the script
>(which can be as simple as 'grep the changed files and fail on the
>presence
>of nocommit string').
>
>Shai

--
Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen
http://www.thetaphi.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org