You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Patrick Ben Koetter <p...@state-of-mind.de> on 2004/12/20 20:46:15 UTC

Which hook to check-in an automatically built ChangeLog?

I want to automatically create a ChangeLog from Subversions log using
svn2cl <http://tiefighter.et.tudelft.nl/~arthur/svn2cl/>.

Doing this manually works as expected.

Now I want subversion to do this for me, but I am not clear about which
hook I should use.

Here's what I want to have:
+ The ChangeLog should include my current commit.
+ The ChangeLog should be committed together with my current commit.

To me it looks as if "start-commit" is the right hook, because it "is
run before the commit transaction is even created".

Or is it "pre-commit", because it "is run when the transaction is
complete, but before it is committed"?


TIA

p@rick


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Which hook to check-in an automatically built ChangeLog?

Posted by Patrick Ben Koetter <p...@state-of-mind.de>.
* Kevin Williams <ke...@bantamtech.com>:
> 
> >So I would end up with two commits per regular commit. That sounds fishy
> >to me and would break a lot of revision number logic and would require
> >some workaround in order not to have the ChangeLog commit appear in the
> >ChangeLog.
> 
> Just a thought. If you need a change log with every single change that 
> has occurred in the repository (or sub-repository directory), doesn't 
> the "svn log" command give this already? What if you generate the 
> ChangeLog file on the fly in your build process from the "svn log" 
> command output?

Thanks Kevin! Eric Hanchrow also noted this in an OFFLIST reply to me. I
think both of you are right.

I was so absorbed by the idea of finding an automatism that I didn't
really think the whole thing of doing it automatically in the first.

Yes, I will build it during the build process.

Thanks all!

p@rick

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Which hook to check-in an automatically built ChangeLog?

Posted by Kevin Williams <ke...@bantamtech.com>.
> So I would end up with two commits per regular commit. That sounds fishy
> to me and would break a lot of revision number logic and would require
> some workaround in order not to have the ChangeLog commit appear in the
> ChangeLog.

Just a thought. If you need a change log with every single change that 
has occurred in the repository (or sub-repository directory), doesn't 
the "svn log" command give this already? What if you generate the 
ChangeLog file on the fly in your build process from the "svn log" 
command output?

----------
Scanned for viruses by ClamAV

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Which hook to check-in an automatically built ChangeLog?

Posted by Patrick Ben Koetter <p...@state-of-mind.de>.
* Garrett Rooney <ro...@electricjellyfish.net>:
> >Here's what I want to have:
> >+ The ChangeLog should include my current commit.
> >+ The ChangeLog should be committed together with my current commit.
> >
> >To me it looks as if "start-commit" is the right hook, because it "is
> >run before the commit transaction is even created".
> >
> >Or is it "pre-commit", because it "is run when the transaction is
> >complete, but before it is committed"?
> 
> You can't do that.  Neither start-commit or pre-commit can modify the 
> contents of the transaction, because the change has no way to be 
> communicated back to the client, so you would end up with a working copy 
> that thought it was up to date with the new revision you're committing 
> to the repository, but in actuality is not.  There are warnings in the 
> hook script templates about this problem.

A paradoxon. A "back to the future" problem... ;-)
I had something like this on my mind and that's why I asked.

> The best you can do is have a post-commit hook script modify and
> commit the ChangeLog, but you need to be sure that it doesn't fire on
> the commits it is performing, to avoid infinite loops.

So I would end up with two commits per regular commit. That sounds fishy
to me and would break a lot of revision number logic and would require
some workaround in order not to have the ChangeLog commit appear in the
ChangeLog.

Hmmm, I think that would add confusion where I was aiming for automated
clarification.

I'll probably do a post-commit for the Changelog only, but not add it
automatically afterwards.

Just out of curiosity: The current hooks cannot do this. Would it
theoretically be possible to add another event (hook) to get what I am
looking for?

Something like a hidden commit for the ChangeLog? But that would break
the whole idea of a versioning system...

p@rick



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: Which hook to check-in an automatically built ChangeLog?

Posted by James FitzGibbon <jf...@primustel.ca>.
I was trying to remember where I'd seen these warnings before.  Shouldn't
the subversion book be a little more clear about this limitation?  Reading
through the book from v1.1.1, there is nothing to make a new user think that
what Patrick wants to do isn't possible...

Regards

-----Original Message-----
From: Garrett Rooney [mailto:rooneg@electricjellyfish.net] 
Sent: Monday, December 20, 2004 3:51 PM
To: Patrick Ben Koetter
Cc: subversion-users
Subject: Re: Which hook to check-in an automatically built ChangeLog?

There are warnings in the hook script templates about this problem.

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.1 - Release Date: 12/20/2004
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.1 - Release Date: 12/20/2004
 



----------------------------------------------------------------------------
This electronic message contains information from Primus Telecommunications
Canada Inc. ("PRIMUS") , which may be legally privileged and confidential.
The information is intended to be for the use of the individual(s) or entity
named above. If you are not the intended recipient, be aware that any
disclosure, copying, distribution or use of the contents of this information
is prohibited. If you have received this electronic message in error, please
notify us by telephone or e-mail (to the number or address above)
immediately. Any views, opinions or advice expressed in this electronic
message are not necessarily the views, opinions or advice of PRIMUS.
It is the responsibility of the recipient to ensure that
any attachments are virus free and PRIMUS bears no responsibility
for any loss or damage arising in any way from the use
thereof.The term "PRIMUS" includes its affiliates.
----------------------------------------------------------------------------
Pour la version en français de ce message, veuillez voir
 http://www.primustel.ca/fr/legal/cs.htm
----------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Which hook to check-in an automatically built ChangeLog?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Patrick Ben Koetter wrote:
> I want to automatically create a ChangeLog from Subversions log using
> svn2cl <http://tiefighter.et.tudelft.nl/~arthur/svn2cl/>.
> 
> Doing this manually works as expected.
> 
> Now I want subversion to do this for me, but I am not clear about which
> hook I should use.
> 
> Here's what I want to have:
> + The ChangeLog should include my current commit.
> + The ChangeLog should be committed together with my current commit.
> 
> To me it looks as if "start-commit" is the right hook, because it "is
> run before the commit transaction is even created".
> 
> Or is it "pre-commit", because it "is run when the transaction is
> complete, but before it is committed"?

You can't do that.  Neither start-commit or pre-commit can modify the 
contents of the transaction, because the change has no way to be 
communicated back to the client, so you would end up with a working copy 
that thought it was up to date with the new revision you're committing 
to the repository, but in actuality is not.  There are warnings in the 
hook script templates about this problem.

The best you can do is have a post-commit hook script modify and commit 
the ChangeLog, but you need to be sure that it doesn't fire on the 
commits it is performing, to avoid infinite loops.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org