You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stefan Hett <st...@egosoft.com> on 2015/08/28 15:19:05 UTC

preventing recording misaligned mergeinfos

Hi,

I'm currently checking-out ways to prevent the creation of misaligned 
mergeinfos in SVN. My current solution would be to add a pre-commit hook 
to prevent any mergeinfo records on any but the top-most node (aka: 
trunk or a branch). While this would prevent most cases which let to 
misaligned mergeinfos, it's certainly not exactly what I want/need.

Does anybody have an idea for a better/more precise solution/approach?

-- 
Regards,
Stefan Hett, Developer/Administrator

EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
Tel: +49 2405 4239970, www.egosoft.com
Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473


Re: preventing recording misaligned mergeinfos

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Stefan Hett wrote on Fri, Aug 28, 2015 at 19:03:08 +0200:
> It does and that's not quite the problem for me. However what's
> possible to do with SVN are merges like these:
> 
> merge A/B/somefile into A

That surprises me.  We have a similar validation for 'switch' that
enforces the source and target are related
(http://subversion.tigris.org/issues/show_bug.cgi?id=3848); shouldn't we
have something similar for 'merge'?

Cheers,

Daniel

> absolutely valid operation, but nothing we use here. In cases this
> is done here in our company it's always an incorrect merge (because
> someone chose the wrong destination folder.
> So we want to prevent issues like these, because they can easily
> result in polluting the mergeinfo records.

Re: preventing recording misaligned mergeinfos

Posted by Joseba Ercilla Olabarri <jo...@gmail.com>.
Hi,

On Fri, Aug 28, 2015 at 7:03 PM, Stefan Hett <st...@egosoft.com> wrote:

> It does and that's not quite the problem for me. However what's possible
> to do with SVN are merges like these:
>
> merge A/B/somefile into A
>
> absolutely valid operation, but nothing we use here. In cases this is done
> here in our company it's always an incorrect merge (because someone chose
> the wrong destination folder.
> So we want to prevent issues like these, because they can easily result in
> polluting the mergeinfo records.
>
>
Don't now how many out there appreciate the 'subtree merge' behavior, but
in our and our clients, a potential scenario of tenths or hundreds of
developers branching&merging at any level of source tree will become a
unmanageable version control system, in addition to a confusing user
experience for the most of developers.

Take a look to this snippet of a unix/bash pre-commit hook, just in case it
inspires you:
Disclaimer: We don´t have any measure of performance of this script. We
simply haven't need to measure it yet.

<code>
# Check forbidden mergeinfo paths
TXN_PATHS=$($SVNLOOK changed -t "$TXN" "$REPOS")

# Grep for paths *not* in merge-allowed levels: /trunk,
/branches/release/*,...
TXN_PATHS=$(echo "$TXN_PATHS" | grep -Ev "^....trunk/?$" | grep -Ev
"^....branches/release/\w+/?$" | grep -Ev "^....branches/feature/\w+/?$")
for TXN_PATH in "$TXN_PATHS"
do
  ELEM_PATH=$(echo "$TXN_PATH" | cut -c 5-)
  MERGEINFO=$($SVNLOOK propget "$REPOS" svn:mergeinfo -t "$TXN"
"$ELEM_PATH" 2>/dev/null)
  if [ ! "$MERGEINFO" = "" ]; then fail_forbidden_mergeinfo_path;fi
done
</code>

Regards.
_
Joseba

Re: preventing recording misaligned mergeinfos

Posted by Stefan Hett <st...@egosoft.com>.
It does and that's not quite the problem for me. However what's possible 
to do with SVN are merges like these:

merge A/B/somefile into A

absolutely valid operation, but nothing we use here. In cases this is 
done here in our company it's always an incorrect merge (because someone 
chose the wrong destination folder.
So we want to prevent issues like these, because they can easily result 
in polluting the mergeinfo records.

> I was under the impression that subversion now automatically takes subtree mergeinfo into account:  http://svnbook.red-bean.com/nightly/en/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.stayinsync.subtree
>
>
> -----Original Message-----
> From: Stefan Hett [mailto:stefan@egosoft.com]
> Sent: Friday, August 28, 2015 9:19 AM
> To: 'subversion'
> Subject: preventing recording misaligned mergeinfos
>
> Hi,
>
> I'm currently checking-out ways to prevent the creation of misaligned mergeinfos in SVN. My current solution would be to add a pre-commit hook to prevent any mergeinfo records on any but the top-most node (aka:
> trunk or a branch). While this would prevent most cases which let to misaligned mergeinfos, it's certainly not exactly what I want/need.
>
> Does anybody have an idea for a better/more precise solution/approach?
>
> --
> Regards,
> Stefan Hett, Developer/Administrator
>
> EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
> Tel: +49 2405 4239970, www.egosoft.com
> Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473
>
>


-- 
Regards,
Stefan Hett


RE: preventing recording misaligned mergeinfos

Posted by Andrew Reedick <jr...@incomm.com>.
I was under the impression that subversion now automatically takes subtree mergeinfo into account:  http://svnbook.red-bean.com/nightly/en/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.stayinsync.subtree


-----Original Message-----
From: Stefan Hett [mailto:stefan@egosoft.com] 
Sent: Friday, August 28, 2015 9:19 AM
To: 'subversion'
Subject: preventing recording misaligned mergeinfos

Hi,

I'm currently checking-out ways to prevent the creation of misaligned mergeinfos in SVN. My current solution would be to add a pre-commit hook to prevent any mergeinfo records on any but the top-most node (aka: 
trunk or a branch). While this would prevent most cases which let to misaligned mergeinfos, it's certainly not exactly what I want/need.

Does anybody have an idea for a better/more precise solution/approach?

--
Regards,
Stefan Hett, Developer/Administrator

EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
Tel: +49 2405 4239970, www.egosoft.com
Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473