[PATCH] svn diff --summarize changed to show left and right revision numbers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] svn diff --summarize changed to show left and right revision numbers

Nagy Peter

Dear Patch Manager,

 

i would like to submit the attached patch. When comparing tags/branches with trunk it is very useful to see which branch has actually been modified. The original implementation shows always the left side of the comparison as modified. The above patch displays at least the left and right revision numbers so that is easier to localize changes in the repository.

 

I hope you will find this contribution as useful.

 

With kind regards,

 

Peter Nagy (from Budapest)


svnpatch_2018-01-02_by_PeterNagy.txt (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Julian Foad-5
Nagy Peter wrote:

> Dear Patch Manager,
>
> i would like to submit the attached patch. When comparing tags/branches
> with trunk it is very useful to see which branch has actually been
> modified. The original implementation shows always the left side of the
> comparison as modified. The above patch displays at least the left and
> right revision numbers so that is easier to localize changes in the
> repository.
>
> I hope you will find this contribution as useful.
>
> With kind regards,
>
> Peter Nagy (from Budapest)
>

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Julian Foad-5
(My empty reply was accidental.)

- Julian
Reply | Threaded
Open this post in threaded view
|

RE: [PATCH] svn diff --summarize changed to show left and right revision numbers

Nagy Peter
In reply to this post by Julian Foad-5
Dear Julian,

i sent the patch too early, it doesn't work in each cases. Unfortunatelly the revision numbers are not set correctly because in some cases the left and right revision numbers both contain the latest revision number of the repository instead of the revision numbers of the files beeing compared. Maybe it is a problem in the server, i do not know yet. So please ignore it for a while.

Sorry, Peter

-----Original Message-----
From: Julian Foad [mailto:[hidden email]]
Sent: Tuesday, January 02, 2018 11:59 AM
To: Nagy Peter <[hidden email]>; [hidden email]
Subject: Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Nagy Peter wrote:

> Dear Patch Manager,
>
> i would like to submit the attached patch. When comparing
> tags/branches with trunk it is very useful to see which branch has
> actually been modified. The original implementation shows always the
> left side of the comparison as modified. The above patch displays at
> least the left and right revision numbers so that is easier to
> localize changes in the repository.
>
> I hope you will find this contribution as useful.
>
> With kind regards,
>
> Peter Nagy (from Budapest)
>


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Julian Foad-5
Nagy Peter wrote:
> i sent the patch too early, it doesn't work in each cases. Unfortunatelly the revision numbers are not set correctly because in some cases the left and right revision numbers both contain the latest revision number of the repository instead of the revision numbers of the files beeing compared. Maybe it is a problem in the server, i do not know yet. So please ignore it for a while.

OK.

I did not quite understand what the problem is, and how you are trying
to solve it. It might be helpful for everybody if you show an example to
demonstrate the problem: what it looks like before, and what you want to
show. Then maybe some people here will have good ideas to help you.

Thank you for wanting to share your work.

- Julian
Reply | Threaded
Open this post in threaded view
|

RE: [PATCH] svn diff --summarize changed to show left and right revision numbers

Nagy Peter
Dear Julian,

I summarized and enclosed the description of my problem. Could you please have a look at it?

Thanks in advance!

Peter

-----Original Message-----
From: Julian Foad [mailto:[hidden email]]
Sent: Tuesday, January 02, 2018 12:56 PM
To: Nagy Peter <[hidden email]>
Cc: [hidden email]
Subject: Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Nagy Peter wrote:
> i sent the patch too early, it doesn't work in each cases. Unfortunatelly the revision numbers are not set correctly because in some cases the left and right revision numbers both contain the latest revision number of the repository instead of the revision numbers of the files beeing compared. Maybe it is a problem in the server, i do not know yet. So please ignore it for a while.

OK.

I did not quite understand what the problem is, and how you are trying to solve it. It might be helpful for everybody if you show an example to demonstrate the problem: what it looks like before, and what you want to show. Then maybe some people here will have good ideas to help you.

Thank you for wanting to share your work.

- Julian

problem.txt (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Branko Čibej
On 02.01.2018 13:43, Nagy Peter wrote:
> Dear Julian,
>
> I summarized and enclosed the description of my problem. Could you please have a look at it?
[Please PLEASE do not attach text that belongs in the body of the mail,
as it's really hard to quote from there.]


> Let's suppose the following repo structure.
>
> svn ls --verbose https:<repo>/DB/trunk
>    1018 xxx              Dec 24 15:51 ./
>    1015 xxx        35478 Dec 19 17:20 workflow.sql
>     345 xxx           79 Apr 03  2017 _RUN.bat
>    1014 xxx         3113 Dec 19 16:27 _RUN.sql
>
> svn ls --verbose https:<repo>/DB/tags/v_1.0
>    1016 xxx              Dec 24 15:47 ./
>    1002 xxx        35302 Dec 13 15:59 workflow.sql
>     345 xxx           79 Apr 03  2017 _RUN.bat
>    1016 xxx         3113 Dec 24 15:47 _RUN.sql
>
>
> If i want to see if there are any changes between the trunk and the tag, i can use svn diff, and i get the following output:  
> svn diff --summarize --ignore-properties https://<repo>/DB/trunk https://<repo>/DB/tags/v_1.0
> M       https://<repo>/DB/trunk/workflow.sql
>
> However the output does not refer to the changed one of the compared files!

I'm having trouble understanding what you mean. The file that's
different on trunk and in the branch is listed in your diff summary
output. You asked "what's the difference between these two URLs" and you
got an answer.


>  It only shows that the two are not the same, but nothing more. If I change the left and right side,
> the output also changes, as follows:
> svn diff --summarize --ignore-properties https://<repo>/DB/tags/v_1.0 https://<repo>/DB/trunk
> M       https://<repo>/DB/tags/v_1.0/workflow.sql

Of course the output changes, because you asked a different question.

> What i want:
> svn diff --summarize --ignore-properties https://<repo>/DB/trunk https://<repo>/DB/tags/v_1.0
> M       workflow.sql                                           |       1015 |       1002 |
>
> So that one can see the workflow.sql has been most probably changed in the trunk, (because it has a higher revision number) so it is a normal development scenario.

This looks like you're using the wrong tool for the job. The answer to
"what changed on trunk" is given by "svn log", not "svn diff". Diff
compares two trees in the repository; log gives you the history.

> But if i would see a higher revision number at the tag, i would know, that somebody made changes on the tag (which is not recommended, but people do such things)
> so i have to merge the changes back into the trunk.

For that you could also use 'svn merge --dry-run' or 'svn mergeinfo'.

-- Brane


> -----Original Message-----
> From: Julian Foad [mailto:[hidden email]]
> Sent: Tuesday, January 02, 2018 12:56 PM
> To: Nagy Peter <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [PATCH] svn diff --summarize changed to show left and right revision numbers
>
> Nagy Peter wrote:
>> i sent the patch too early, it doesn't work in each cases. Unfortunatelly the revision numbers are not set correctly because in some cases the left and right revision numbers both contain the latest revision number of the repository instead of the revision numbers of the files beeing compared. Maybe it is a problem in the server, i do not know yet. So please ignore it for a while.
> OK.
>
> I did not quite understand what the problem is, and how you are trying to solve it. It might be helpful for everybody if you show an example to demonstrate the problem: what it looks like before, and what you want to show. Then maybe some people here will have good ideas to help you.
>
> Thank you for wanting to share your work.
>
> - Julian

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] svn diff --summarize changed to show left and right revision numbers

Troy Curtis Jr


On Tue, Jan 2, 2018 at 7:03 AM Branko Čibej <[hidden email]> wrote:
On 02.01.2018 13:43, Nagy Peter wrote:

>  It only shows that the two are not the same, but nothing more. If I change the left and right side,
> the output also changes, as follows:
> svn diff --summarize --ignore-properties https://<repo>/DB/tags/v_1.0 https://<repo>/DB/trunk
> M       https://<repo>/DB/tags/v_1.0/workflow.sql

Of course the output changes, because you asked a different question.

> What i want:
> svn diff --summarize --ignore-properties https://<repo>/DB/trunk https://<repo>/DB/tags/v_1.0
> M       workflow.sql                                           |       1015 |       1002 |
>
> So that one can see the workflow.sql has been most probably changed in the trunk, (because it has a higher revision number) so it is a normal development scenario.

This looks like you're using the wrong tool for the job. The answer to
"what changed on trunk" is given by "svn log", not "svn diff". Diff
compares two trees in the repository; log gives you the history.

> But if i would see a higher revision number at the tag, i would know, that somebody made changes on the tag (which is not recommended, but people do such things)
> so i have to merge the changes back into the trunk.


Additionally what you are saying is not necessarily correct, but given this output would likely be the typical user interpretation.  As Brane said, diff compares two trees and then displays the differences.  Just because the revision number is different, does not necessarily mean there is a meaningful relationship between the revisions just looking at the number.  For instance, if the normal flow is expected periodically merge trunk to a feature branch, but both lines of development have changes to a file, the revision numbers could actually be reversed.  All it takes is someone making a change first on trunk, then someone else changing the file on the branch.  Now when you do a diff you assume that the branch side has the meaningful the change (as it is a later revision number). 

I certainly see where you are coming from with this request, to easily see the last changed revision of the file containing differences.  However, I think it is more likely to confuse the issue than just using the existing tools to answer each specific question (as Brane suggests).

-- Troy
 
For that you could also use 'svn merge --dry-run' or 'svn mergeinfo'.

-- Brane