Pre step before SVN Merge

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Pre step before SVN Merge

Masood
Dear Team,

I would like to create a setup in which,
whenever we are doing merge in SVN then it should perform some task previous to merge action and if that
task completes successfully then merge should proceed.

Does anyone have some information on it ?

Thanks Ahead,

With Regards,
Masood
Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Thorsten Schöning
Guten Tag Masood,
am Mittwoch, 22. Januar 2014 um 12:50 schrieben Sie:

> Does anyone have some information on it ?

You should provide some more details about your use case, especially
if you need something user orientated before one starts with a merge
in whatever client one uses or something which can work after a merge
gets committed by a user etc. In most cases it's really helpful why
you need something as well, because people often make the mistake to
think they already know the best/only solution.

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning       E-Mail:[hidden email]
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Masood
Hi Thorsten,

Thanks for the reply.

Actually I want to execute a hook scripts before merge operation whenever user
start merge task(either from SVN merger command or from GUI). That hook script will perform the code analysis and if there there is any critical issue then it will abort the merge operation.

Any other information to perform this task will be useful to me.

Thanks Ahead,

With Regards,
Masood
Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Kyle Sluder
On Wed, Jan 22, 2014, at 09:35 PM, Masood wrote:
> Actually I want to execute a hook scripts before merge operation whenever
> user
> start merge task(either from SVN merger command or from GUI). That hook
> script will perform the code analysis and if there there is any critical
> issue then it will abort the merge operation.

You cannot execute hooks on a client machine. Hooks are server-side
only.

--Kyle Sluder
Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Masood
Dear Team,

Thanks for the reply.

Can I write hook scripts at server end to perform the task ?
If so, can i get any web link for it ?

Thanks Ahead,

With Regards,
Masood
Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Ben Reser
On 1/22/14, 9:49 PM, Masood wrote:
> Can I write hook scripts at server end to perform the task ?
> If so, can i get any web link for it ?

A merge is just a read operation as far as the server is concerned and we don't
have hooks for reads.

There actually is one Subversion client that supports client side hooks,
TortoiseSVN:
http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks

However, I don't think even they have a hook that is appropriate for what
you're trying to do.

My suggestion in your case would be to write a tool that users would use that
would do the actions you want and then run the merge via either bindings or by
driving the commandline client.

But even then there would be no way to enforce that the tool is used.
Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Thorsten Schöning
In reply to this post by Masood
Guten Tag Masood,
am Donnerstag, 23. Januar 2014 um 06:35 schrieben Sie:

> That hook
> script will perform the code analysis and if there there is any critical
> issue then it will abort the merge operation.

Which code analysis do you speak of and what are the critical issues
you may see? Are you really sure you want to re-implement the merge
logic? Because that would be needed if you want to do something before
the actual merge operation on the same data that the merge operation
would produce. Without doing the merge you simply can't know what the
result will be and if there's any "critical issue".

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning       E-Mail:[hidden email]
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Masood
Hi Thorsten,

Thanks for your reply.

Actually I have a trunk and some release(as branch).
When a person starts a merge operation(i.e to merge release code with trunk) then as pre-merge step
I want to perform Code Quality Analysis on release(SonarQube Analysis. Its a Code Quality Tool) and
if there is any critical violations reported by tool then whole process should be aborted. User need to fix those violations and then need to try again. If there will be no Code Quality Violations then process should continue and release code base should merge with Trunk.

I am looking for how to redirect to Code Quality Operation whenever a user want to perform merge on SVN.


Thanks Ahead.

With Regards,
Masood
Reply | Threaded
Open this post in threaded view
|

Re: Pre step before SVN Merge

Thorsten Schöning
Guten Tag Masood,
am Donnerstag, 23. Januar 2014 um 12:18 schrieben Sie:

> I want to perform Code Quality Analysis on release[...]

Write a server side pre commit hook and do such analysis on the
server, rejecting a commit on errors. The key point is that you want
to analyze the result of the merge, therefore you can't do something
before the user merges. But you don't necessarily want the result of
the merge in your repo and that's what server side pre-commit hooks
are made for.

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning       E-Mail:[hidden email]
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow