git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] In inproperly merges, the ranges contains additional character "*"
@ 2013-03-01 13:33 Jan Pešta
  2013-03-01 17:54 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Pešta @ 2013-03-01 13:33 UTC (permalink / raw)
  To: git; +Cc: 'Matthieu Moy'

In inproperly merges, the ranges contains additional character "*".

See http://www.open.collab.net/community/subversion/articles/merge-info.html
Extract:
The range r30430:30435 that was added to 1.5.x in this merge has a '*'
suffix for 1.5.x\www.
This '*' is the marker for a non-inheritable mergeinfo range.
The '*' means that only the path on which the mergeinfo is explicitly set
has had this range merged into it.

Signed-off-by: Jan Pesta <jan.pesta@certicon.cz>
---
 perl/Git/SVN.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 0ebc68a..6bd18e9 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -1493,6 +1493,7 @@ sub lookup_svn_merge {
 	my @merged_commit_ranges;
 	# find the tip
 	for my $range ( @ranges ) {
+		$range =~ s/[*]$//;
 		my ($bottom, $top) = split "-", $range;
 		$top ||= $bottom;
 		my $bottom_commit = $gs->find_rev_after( $bottom, 1, $top );
-- 
1.8.1.msysgit.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] In inproperly merges, the ranges contains additional character "*"
  2013-03-01 13:33 [PATCH] In inproperly merges, the ranges contains additional character "*" Jan Pešta
@ 2013-03-01 17:54 ` Junio C Hamano
  2013-03-01 21:37   ` Jan Pešta
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2013-03-01 17:54 UTC (permalink / raw)
  To: Jan Pešta; +Cc: git, 'Matthieu Moy'

Jan Pešta <jan.pesta@certicon.cz> writes:

> In inproperly merges, the ranges contains additional character "*".

Thanks, but -ECANNOTPARSE.  What are "inproperly merges"?

> See http://www.open.collab.net/community/subversion/articles/merge-info.html
> Extract:
> The range r30430:30435 that was added to 1.5.x in this merge has a '*'
> suffix for 1.5.x\www.
> This '*' is the marker for a non-inheritable mergeinfo range.
> The '*' means that only the path on which the mergeinfo is explicitly set
> has had this range merged into it.

If I am reading the above correctly, blindly removing '*' from the
range will record a wrong merge in the result, because on the SVN
side only the history of part of the tree is merged but we represent
the result as a full merge (and Git only records full merge of
histories), no?

My gut feeling tells me that failing the import, saying "We cannot
represent this history", might be a more honest and safe thing to
do.

> Signed-off-by: Jan Pesta <jan.pesta@certicon.cz>
> ---
>  perl/Git/SVN.pm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
> index 0ebc68a..6bd18e9 100644
> --- a/perl/Git/SVN.pm
> +++ b/perl/Git/SVN.pm
> @@ -1493,6 +1493,7 @@ sub lookup_svn_merge {
>  	my @merged_commit_ranges;
>  	# find the tip
>  	for my $range ( @ranges ) {
> +		$range =~ s/[*]$//;
>  		my ($bottom, $top) = split "-", $range;
>  		$top ||= $bottom;
>  		my $bottom_commit = $gs->find_rev_after( $bottom, 1, $top );

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] In inproperly merges, the ranges contains additional character "*"
  2013-03-01 17:54 ` Junio C Hamano
@ 2013-03-01 21:37   ` Jan Pešta
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Pešta @ 2013-03-01 21:37 UTC (permalink / raw)
  To: 'Junio C Hamano'; +Cc: git, 'Matthieu Moy'

Hi Junio,

You have right. But I think if there is a "*" sign, it should be skiped, instead of failing on comparing string with a number.

I will prepare another patch.

Regards,
Jan

Kind regards / S pozdravem
 
Jan Pešta
SW Engineer Sr.

CertiCon a.s., www.certicon.cz
Vaclavska 12
12000 Prague 2
Czech Republic
 
Office Prague: +420 224 904 406
Mobile: +420 604 794 306
 
E-mail: jan.pesta@certicon.cz

-----Original Message-----
From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of Junio C Hamano
Sent: Friday, March 01, 2013 6:55 PM
To: Jan Pešta
Cc: git@vger.kernel.org; 'Matthieu Moy'
Subject: Re: [PATCH] In inproperly merges, the ranges contains additional character "*"

Jan Pešta <jan.pesta@certicon.cz> writes:

> In inproperly merges, the ranges contains additional character "*".

Thanks, but -ECANNOTPARSE.  What are "inproperly merges"?

> See http://www.open.collab.net/community/subversion/articles/merge-info.html
> Extract:
> The range r30430:30435 that was added to 1.5.x in this merge has a '*'
> suffix for 1.5.x\www.
> This '*' is the marker for a non-inheritable mergeinfo range.
> The '*' means that only the path on which the mergeinfo is explicitly set
> has had this range merged into it.

If I am reading the above correctly, blindly removing '*' from the
range will record a wrong merge in the result, because on the SVN
side only the history of part of the tree is merged but we represent
the result as a full merge (and Git only records full merge of
histories), no?

My gut feeling tells me that failing the import, saying "We cannot
represent this history", might be a more honest and safe thing to
do.

> Signed-off-by: Jan Pesta <jan.pesta@certicon.cz>
> ---
>  perl/Git/SVN.pm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
> index 0ebc68a..6bd18e9 100644
> --- a/perl/Git/SVN.pm
> +++ b/perl/Git/SVN.pm
> @@ -1493,6 +1493,7 @@ sub lookup_svn_merge {
>  	my @merged_commit_ranges;
>  	# find the tip
>  	for my $range ( @ranges ) {
> +		$range =~ s/[*]$//;
>  		my ($bottom, $top) = split "-", $range;
>  		$top ||= $bottom;
>  		my $bottom_commit = $gs->find_rev_after( $bottom, 1, $top );

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-01 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 13:33 [PATCH] In inproperly merges, the ranges contains additional character "*" Jan Pešta
2013-03-01 17:54 ` Junio C Hamano
2013-03-01 21:37   ` Jan Pešta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).