You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gabriela Gibson <ga...@gmail.com> on 2013/10/13 12:50:26 UTC

Presenting net code changes for a branch

Hi,

my branch has grown into a veritable forest, and so, I thought that
it would be convenient to present the net code changes in a file called
'entire-branch-code' (attached).

This is generated like so:

1) Merge trunk to branch

2) run this bash command:

svn log --stop-on-copy | grep '^*\ subversion' |\
  awk '{gsub(/^ +| +$/,"")} {print $0}' | cut -d '*' -f 2 |\
  sort --unique | while read line; do echo $line | if [ -a $line ];\
  then echo ""; echo \
"================================================================================";\
  echo "";\
  diff -p --context=0 -b -B -w "$HOME/trunk/$line" "$PWD/$line"; fi;\
  done > entire-branch-code

Is this useful?  Can this be improved?

thanks,

Gabriela

Re: Presenting net code changes for a branch

Posted by Johan Corveleyn <jc...@gmail.com>.
On Sun, Oct 13, 2013 at 9:29 PM, Gabriela Gibson
<ga...@gmail.com> wrote:
> On 13/10/13 15:15, Lieven Govaerts wrote:
>
> Hi Lieven,
>
>
>> The last time you updated the invoke-diff-cmd branch from trunk was in
>> rr1526487, you updated from trunk r1526439.
>
>
> Sorry, I had merged locally but not committed. (done now)
>
>
>>
>> So if you compare your branch to trunk@1526439 you will get a diff file
>> with only your changes. No?
>> $ svn diff -x -pwb ^/subversion/trunk@1526439
>> ^/subversion/branches/invoke-diff-cmd-feature
>>
>
> Previously I got all the merge changes, without seeing any of mine at all.
> And now that it's been re-merged (I reverted and started over)  & committed,
> I get nothing at all.  But:
>
>   diff -r ~/trunk/subversion/ ~/branches/invoke-diff-cmd-feature/subversion/
>
> shows me all my changes as expected.
>
> Yet, this:
>
>   svn diff -x -pwb /home/g/trunk/ /home/g/branches/invoke-diff-cmd-feature/
>
> shows me nothing at all (before it showed me what the merge added
> from trunk, but none of my changes). For some reason, the ^ expansion does
> not work on my system so I use a full path here.

But now you're using two local paths (working copy paths), instead of
repository urls. That means you're hitting usage 2 of 'svn diff'
(instead of usage 4):

[[[
C:\Documents and Settings\User>svn help diff
diff (di): Display local changes or differences between two revisions or paths.
usage: 1. diff
       2. diff [-c M | -r N[:M]] [TARGET[@REV]...]
       3. diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] \
               [PATH...]
       4. diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]
       5. diff OLD-URL[@OLDREV] NEW-PATH[@NEWREV]
       6. diff OLD-PATH[@OLDREV] NEW-URL[@NEWREV]

  1. Use just 'svn diff' to display local modifications in a working copy.

  2. Display the changes made to TARGETs as they are seen in REV between
     two revisions.  TARGETs may be all working copy paths or all URLs.
     If TARGETs are working copy paths, N defaults to BASE and M to the
     working copy; if URLs, N must be specified and M defaults to HEAD.
     The '-c M' option is equivalent to '-r N:M' where N = M-1.
     Using '-c -M' does the reverse: '-r M:N' where N = M-1.

  3. Display the differences between OLD-TGT as it was seen in OLDREV and
     NEW-TGT as it was seen in NEWREV.  PATHs, if given, are relative to
     OLD-TGT and NEW-TGT and restrict the output to differences for those
     paths.  OLD-TGT and NEW-TGT may be working copy paths or URL[@REV].
     NEW-TGT defaults to OLD-TGT if not specified.  -r N makes OLDREV default
     to N, -r N:M makes OLDREV default to N and NEWREV default to M.
     If OLDREV or NEWREV are not specified, they default to WORKING for
     working copy targets and to HEAD for URL targets.

     Either or both OLD-TGT and NEW-TGT may also be paths to unversioned
     targets. Revisions cannot be specified for unversioned targets.
     Both targets must be of the same node kind (file or directory).
     Diffing unversioned targets against URL targets is not supported.

  4. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-URL[@NEWREV]'
  5. Shorthand for 'svn diff --old=OLD-URL[@OLDREV] --new=NEW-PATH[@NEWREV]'
  6. Shorthand for 'svn diff --old=OLD-PATH[@OLDREV] --new=NEW-URL[@NEWREV]'
]]]

So this will only show you local modifications (with respect to the
checked-out versions) of your two working copy paths.

To do what you want here, you should have used the --old=X --new=Y syntax.

(yes, this usage is confusing and sometimes counter-intuitive -- see
also various discussions on the users list ...)

-- 
Johan

Re: Presenting net code changes for a branch

Posted by Gabriela Gibson <ga...@gmail.com>.
On 13/10/13 15:15, Lieven Govaerts wrote:

Hi Lieven,

> The last time you updated the invoke-diff-cmd branch from trunk was in
> rr1526487, you updated from trunk r1526439.

Sorry, I had merged locally but not committed. (done now)

>
> So if you compare your branch to trunk@1526439 you will get a diff file
> with only your changes. No?
> $ svn diff -x -pwb ^/subversion/trunk@1526439
> ^/subversion/branches/invoke-diff-cmd-feature
>

Previously I got all the merge changes, without seeing any of mine at 
all.  And now that it's been re-merged (I reverted and started over)  & 
committed, I get nothing at all.  But:

   diff -r ~/trunk/subversion/ 
~/branches/invoke-diff-cmd-feature/subversion/

shows me all my changes as expected.

Yet, this:

   svn diff -x -pwb /home/g/trunk/ 
/home/g/branches/invoke-diff-cmd-feature/

shows me nothing at all (before it showed me what the merge added
from trunk, but none of my changes). For some reason, the ^ expansion 
does not work on my system so I use a full path here.

thanks,

Gabriela

ps.: I attached a file with my shell session, just in case I'm not 
seeing the obvious (as per usual!)

pps.: this by now it probably a svn-user discussion, and so I
apologise to the dev list. I'm not sure, but should we continue this 
thread on svn-user?




Re: Presenting net code changes for a branch

Posted by Lieven Govaerts <li...@gmail.com>.
Hi Gabriela,


On Sun, Oct 13, 2013 at 3:52 PM, Gabriela Gibson
<ga...@gmail.com>wrote:

> On 13/10/13 13:34, Lieven Govaerts wrote:
>
>>
>> Is this any different than running:
>> svn diff -x -pwb ^/subversion/trunk
>> ^/subversion/branches/invoke-**diff-cmd-feature
>> ?
>>
>> At this moment there is a large diff between trunk and your branch, but
>> that's because you haven't brought your branch up to date with trunk
>> yet. But once you do that, the diff between branches should represent
>> your additions on the branch.
>>
>>
> Hi Lieven,
>
> thank you for the tip, but it's not working for me currently.  The trunk
> has been freshly merged into the branch, and your command shows me all the
> changes that have been merged from the trunk to the branch, but,
> interestingly so, none of the changes I've made to the branch.
>
>
The last time you updated the invoke-diff-cmd branch from trunk was in
rr1526487, you updated from trunk r1526439.

So if you compare your branch to trunk@1526439 you will get a diff file
with only your changes. No?
$ svn diff -x -pwb
^/subversion/trunk@1526439^/subversion/branches/invoke-diff-cmd-feature

Or if you want to limit to the subversion folder:
$ svn diff -x -pwb
^/subversion/trunk/subversion@1526439^/subversion/branches/invoke-diff-cmd-feature/subversion

Basically, comparing branches is a core feature of Subversion, so I'm
wondering what specifically do you want to achieve by comparing two local
working copies with diff that you can't do with 'svn diff'?

Lieven

The original diff file in the other post is my actual code (44k, oh dear)
> which is why I'm looking for a way of taming this into something that is
> presentable.
>
> Gabriela
>
> ps.: i made a mistake in the original bash code, it should read
>  diff -p --context=0 "$HOME/trunk/$line" "$PWD/$line"; fi;\
>

Re: Presenting net code changes for a branch

Posted by Gabriela Gibson <ga...@gmail.com>.
On 13/10/13 13:34, Lieven Govaerts wrote:
>
> Is this any different than running:
> svn diff -x -pwb ^/subversion/trunk
> ^/subversion/branches/invoke-diff-cmd-feature
> ?
>
> At this moment there is a large diff between trunk and your branch, but
> that's because you haven't brought your branch up to date with trunk
> yet. But once you do that, the diff between branches should represent
> your additions on the branch.
>

Hi Lieven,

thank you for the tip, but it's not working for me currently.  The trunk 
has been freshly merged into the branch, and your command shows me all 
the changes that have been merged from the trunk to the branch, but, 
interestingly so, none of the changes I've made to the branch.

The original diff file in the other post is my actual code (44k, oh 
dear) which is why I'm looking for a way of taming this into something 
that is presentable.

Gabriela

ps.: i made a mistake in the original bash code, it should read
  diff -p --context=0 "$HOME/trunk/$line" "$PWD/$line"; fi;\

Re: Presenting net code changes for a branch

Posted by Lieven Govaerts <li...@gmail.com>.
Hi,


On Sun, Oct 13, 2013 at 12:50 PM, Gabriela Gibson <gabriela.gibson@gmail.com
> wrote:

> Hi,
>
> my branch has grown into a veritable forest, and so, I thought that
> it would be convenient to present the net code changes in a file called
> 'entire-branch-code' (attached).
>
> This is generated like so:
>
> 1) Merge trunk to branch
>
> 2) run this bash command:
>
> svn log --stop-on-copy | grep '^*\ subversion' |\
>  awk '{gsub(/^ +| +$/,"")} {print $0}' | cut -d '*' -f 2 |\
>  sort --unique | while read line; do echo $line | if [ -a $line ];\
>  then echo ""; echo \
> "=============================**==============================**
> =====================";\
>  echo "";\
>  diff -p --context=0 -b -B -w "$HOME/trunk/$line" "$PWD/$line"; fi;\
>  done > entire-branch-code
>

Is this any different than running:
svn diff -x -pwb ^/subversion/trunk
^/subversion/branches/invoke-diff-cmd-feature
?

At this moment there is a large diff between trunk and your branch, but
that's because you haven't brought your branch up to date with trunk yet.
But once you do that, the diff between branches should represent your
additions on the branch.

Lieven



> Is this useful?  Can this be improved?
>
> thanks,
>
> Gabriela
>

Re: Presenting net code changes for a branch

Posted by Branko Čibej <br...@wandisco.com>.
On 23.10.2013 18:17, Branko Čibej wrote:
> On 23.10.2013 18:06, Julian Foad wrote:
>> Branko Čibej wrote:
>>
>>> On 23.10.2013 15:53, Julian Foad wrote:
>>>> Gabriela Gibson wrote on 13 October: 
>>>>> my branch has grown into a veritable forest, and so, I thought that
>>>>> it would be convenient to present the net code changes
>>>> ... and the discussion went on to address how to use "svn diff" in the
>>>> right way to show such changes, which is not exactly obvious.  The best
>>>> way is to go and investigate your merge history and then choose specify
>>>> the left hand side of the diff as the revision on trunk which you last
>>>> caught up to.  Is that really the best we can do?  No.
>>>>
>>>> This requirement is fairly basic and comes up quite often -- I have
>>>> recently heard from both customers and colleagues wanting to know how
>>>> to do it. I think we should have a built-in way to say "show me the diff
>>>> of this branch against the parent branch, specifically against the latest
>>>> catch-up point on the parent branch".  The attached patch implements this,
>>>> using '-g'/'--use-merge-info' to trigger it:
>>>>
>>>>   cd my-branch-wc
>>>>   svn diff -g ^/subversion/trunk .
>>>>
>>>> What does everyone think of the concept?  The user interface?  This
>>>> patch is by no means a complete solution, but simply to promote
>>>> discussion.
>>> Without the -g, please. Diff should just dtrt; it should know when
>>> branches are related, shouldn't it? And AFAICT, it already does the
>>> right thing.
>> Perhaps you missed the point.  Without '-g', "svn diff -g ^/subversion/trunk ." shows us the difference between the *current* state of trunk and the current state of our branch.  That's fine if you've just moments ago done a catch-up and told everybody else to hold off committing for a short while; but the use case we're addressing here is where want the diff between an *older* state of trunk (whatever state we last caught up to) and the current state of our branch.
>
> Well, I fail to see how "use mergeinfo" is in any way intuitive of the
> proposed semantics.
>
> Instead of retrofitting this yet-another-catch-all option, we should
> just go and design branch naming instead; then we could have a magical
> kind of name that means "branch root". I dislike off-the-cuff
> solutions, as you well know.
>
> Another option -- somewhat less dependent on a completely new feature
> -- might be this:
>
>     svn diff -rROOT:HEAD
>
> Surely Subversion should be able to figure out when a branch was created.

Sorry, I meant

    svn diff -rMERGED:HEAD

for the last-merged case. But ROOT is also a useful revision keyword.

-- Brane


-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

Re: Presenting net code changes for a branch

Posted by Julian Foad <ju...@btopenworld.com>.
Branko Čibej wrote:
> Here's a more complete proposal:
> 
> Introduce two new revision keywords:
> 
>     * ROOT (alternatively: CREATED)
>       [...]
> 
>     * MERGED
>       Only relevant in the context of a branch. Represents the latest
>       revision in which a merge was made to the branch. This revision
>       may depend on a discriminator parameter, which is a branch URL,
>       such that the result is the revision of the latest merge from
>       that branch.

This doesn't address the use case at hand. In order to see the net code changes on a branch, the left-hand side of the diff needs to be the *base* of the last merge, otherwise known as the "youngest common ancestor in the merge graph".

Let's review why that is so.

    1  2  3  4  5  6  7
  T ---------o--------o-
     \        \
      \        \
  B    o--o-----o--o----

The net code changes on this branch consist of the logical "combination" of the changes B3 and B6. (Assume no additional changes were made during branching or merging). However, an attempt to compute the net change by simply combining the individual changes (B3 "plus" B6) is likely to fail due to conflicts, because one was made in an older context and the other in a newer context (after the catch-up from trunk).

But we observe that the user has already combined changes B3 and B6 on the branch, including any conflict resolution that may have been necessary in relation to the catch-up from trunk, in two stages: first the catch-up merge resulting in state B@5 containing the logical combination of (B3 "plus" T4), and then the commit resulting in a state B@6 containing ((B3 "plus" T4) "plus" B6).

To see the net code changes on the branch, then, we can take the branch tip (state B@6) and subtract the last caught-up-to state of trunk (state T@4). Thus, diff(T@4,B@6). It is not diff(B@5,B@6) nor diff(B@anything,B@6).

The base of the last merge, T@4, is typically NOT on the same branch as the right-hand side of the diff (B@6). (But it would be if the last merge between branch and trunk had been in the other direction, aka a "reintegrate".)

The diff scenario we're looking at is also exactly the same as saying "show me one side of the 3-way diff that would be performed if I requested an automatic merge to trunk". So another valid way to approach the problem is to see about making a "show me the diff" variant of the merge command, rather than a "show me what would be merged" variant of the diff command.

- Julian


Re: Presenting net code changes for a branch

Posted by Branko Čibej <br...@wandisco.com>.
On 23.10.2013 18:45, Julian Foad wrote:
> Julian Foad wrote:
>
>> Branko Čibej wrote:
>>>  Another option -- somewhat less dependent on a completely new
>>>  feature -- might be this:
>>>
>>>     svn diff -rROOT:HEAD
>> Well, you haven't ascribed a meaning to that syntax.  If you mean it should 
>> compare the "root of the branch" with the "tip" of the same 
>> branch, then no, that's not what we're looking for.  We're looking 
>> for (that diff) MINUS (whatever's been merged onto that branch from trunk).
> ... alternatively, if "root of the branch" means "base of last merge between trunk and branch" (assuming the last merge was trunk-to-branch, that's the same as "last point on trunk that you caught up to"), then yes that's what I mean.

Here's a more complete proposal:

Introduce two new revision keywords:

  * ROOT (alternatively: CREATED)
    Represents the revision in which a directory was originally created.
    This is different from the revision reported by 'svn log
    --stop-on-copy' in that it will "see through" any renames of that
    directory.
    When used in the context of a branch, it effectively represents the
    branchpoint revision.

  * MERGED
    Only relevant in the context of a branch. Represents the latest
    revision in which a merge was made to the branch. This revision may
    depend on a discriminator parameter, which is a branch URL, such
    that the result is the revision of the latest merge from that branch.


Example usage:

  * svn info
      o 'svn info -rROOT' or 'svn info -rCREATED'
        Returns information about the revision in which the directory
        was created; i.e., the branchpoint revision. Works with any
        directory, wether WC path or URL.
        Note: Better than the --stop-on-copy trick, since it doesn't
        trip over renames.
      o 'svn info -rMERGED'
        Returns info about the latest revision in which a merge to a
        branch was committed. Works only with branches (i.e.,
        directories that contain [inherited] mergeinfo).
  * svn diff
      o svn diff -rMERGED:HEAD
        Shows changes on a branch that were made after the last merge.
      o svn diff -rMERGED:HEAD ^/other/branch
        As above, but shows changes since the last merge from ^/other/branch
      o svn diff ^/first/branch@MERGED ^/second/branch@MERGED
        Shows changes made on the branch between the last merges from
        ^/first/branch and ^/second/branch. This one could be tricky to
        fit into the other diff syntaxes. (Sometimes I wish we'd allowed
        more than one -r option per command.)

There are probably more scenarios where these keywords would be useful.
Incidentally, their use is not limited to directories; files are
branches, too.

Not a complete. formal proposal by any means, but I'm sure it could be
made so if we like it.

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

Re: Presenting net code changes for a branch

Posted by Julian Foad <ju...@btopenworld.com>.
Julian Foad wrote:

> Branko Čibej wrote:
>>  Another option -- somewhat less dependent on a completely new
>>  feature -- might be this:
>> 
>>     svn diff -rROOT:HEAD
> 
> Well, you haven't ascribed a meaning to that syntax.  If you mean it should 
> compare the "root of the branch" with the "tip" of the same 
> branch, then no, that's not what we're looking for.  We're looking 
> for (that diff) MINUS (whatever's been merged onto that branch from trunk).

... alternatively, if "root of the branch" means "base of last merge between trunk and branch" (assuming the last merge was trunk-to-branch, that's the same as "last point on trunk that you caught up to"), then yes that's what I mean.

- Julian

Re: Presenting net code changes for a branch

Posted by Julian Foad <ju...@btopenworld.com>.
Branko Čibej wrote:

> Well, I fail to see how "use mergeinfo" is in any way intuitive of
> the proposed semantics.

It shows the diff that would be merged from the branch to the trunk if we asked for a merge.

(Recall I did say this patch was just meant to promote discussion.  I too dislike this UI.)

> Instead of retrofitting this yet-another-catch-all option, we should
> just go and design branch naming instead; then we could have a
> magical kind of name that means "branch root". I dislike
> off-the-cuff solutions, as you well know.


Heh, yes.


> Another option -- somewhat less dependent on a completely new
> feature -- might be this:
>
>    svn diff -rROOT:HEAD


Well, you haven't ascribed a meaning to that syntax.  If you mean it should compare the "root of the branch" with the "tip" of the same branch, then no, that's not what we're looking for.  We're looking for (that diff) MINUS (whatever's been merged onto that branch from trunk).


- Julian


> Surely Subversion should be able to figure out when a branch was
> created.


Re: Presenting net code changes for a branch

Posted by Branko Čibej <br...@wandisco.com>.
On 23.10.2013 18:06, Julian Foad wrote:
> Branko Čibej wrote:
>
>> On 23.10.2013 15:53, Julian Foad wrote:
>>> Gabriela Gibson wrote on 13 October: 
>>>> my branch has grown into a veritable forest, and so, I thought that
>>>> it would be convenient to present the net code changes
>>> ... and the discussion went on to address how to use "svn diff" in the
>>> right way to show such changes, which is not exactly obvious.  The best
>>> way is to go and investigate your merge history and then choose specify
>>> the left hand side of the diff as the revision on trunk which you last
>>> caught up to.  Is that really the best we can do?  No.
>>>
>>> This requirement is fairly basic and comes up quite often -- I have
>>> recently heard from both customers and colleagues wanting to know how
>>> to do it. I think we should have a built-in way to say "show me the diff
>>> of this branch against the parent branch, specifically against the latest
>>> catch-up point on the parent branch".  The attached patch implements this,
>>> using '-g'/'--use-merge-info' to trigger it:
>>>
>>>   cd my-branch-wc
>>>   svn diff -g ^/subversion/trunk .
>>>
>>> What does everyone think of the concept?  The user interface?  This
>>> patch is by no means a complete solution, but simply to promote
>>> discussion.
>> Without the -g, please. Diff should just dtrt; it should know when
>> branches are related, shouldn't it? And AFAICT, it already does the
>> right thing.
>
> Perhaps you missed the point.  Without '-g', "svn diff -g ^/subversion/trunk ." shows us the difference between the *current* state of trunk and the current state of our branch.  That's fine if you've just moments ago done a catch-up and told everybody else to hold off committing for a short while; but the use case we're addressing here is where want the diff between an *older* state of trunk (whatever state we last caught up to) and the current state of our branch.

Well, I fail to see how "use mergeinfo" is in any way intuitive of the
proposed semantics.

Instead of retrofitting this yet-another-catch-all option, we should
just go and design branch naming instead; then we could have a magical
kind of name that means "branch root". I dislike off-the-cuff solutions,
as you well know.

Another option -- somewhat less dependent on a completely new feature --
might be this:

    svn diff -rROOT:HEAD

Surely Subversion should be able to figure out when a branch was created.

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

Re: Presenting net code changes for a branch

Posted by Julian Foad <ju...@btopenworld.com>.
Branko Čibej wrote:

> On 23.10.2013 15:53, Julian Foad wrote:
>> Gabriela Gibson wrote on 13 October: 
>>> my branch has grown into a veritable forest, and so, I thought that
>>> it would be convenient to present the net code changes
>> 

>> ... and the discussion went on to address how to use "svn diff" in the

>> right way to show such changes, which is not exactly obvious.  The best

>> way is to go and investigate your merge history and then choose specify
>> the left hand side of the diff as the revision on trunk which you last
>> caught up to.  Is that really the best we can do?  No.
>> 

>> This requirement is fairly basic and comes up quite often -- I have
>> recently heard from both customers and colleagues wanting to know how
>> to do it. I think we should have a built-in way to say "show me the diff
>> of this branch against the parent branch, specifically against the latest
>> catch-up point on the parent branch".  The attached patch implements this,
>> using '-g'/'--use-merge-info' to trigger it:
>> 

>>   cd my-branch-wc
>>   svn diff -g ^/subversion/trunk .
>> 

>> What does everyone think of the concept?  The user interface?  This
>> patch is by no means a complete solution, but simply to promote
>> discussion.
> 
> Without the -g, please. Diff should just dtrt; it should know when
> branches are related, shouldn't it? And AFAICT, it already does the
> right thing.


Perhaps you missed the point.  Without '-g', "svn diff -g ^/subversion/trunk ." shows us the difference between the *current* state of trunk and the current state of our branch.  That's fine if you've just moments ago done a catch-up and told everybody else to hold off committing for a short while; but the use case we're addressing here is where want the diff between an *older* state of trunk (whatever state we last caught up to) and the current state of our branch.

- Julian


Re: Presenting net code changes for a branch

Posted by Branko Čibej <br...@wandisco.com>.
On 23.10.2013 15:53, Julian Foad wrote:
> Gabriela Gibson wrote on 13 October:
>> my branch has grown into a veritable forest, and so, I thought that
>> it would be convenient to present the net code changes
> ... and the discussion went on to address how to use "svn diff" in the right way to show such changes, which is not exactly obvious.  The best way is to go and investigate your merge history and then choose specify the left hand side of the diff as the revision on trunk which you last caught up to.  Is that really the best we can do?  No.
>
> This requirement is fairly basic and comes up quite often -- I have recently heard from both customers and colleagues wanting to know how to do it.
>
> I think we should have a built-in way to say "show me the diff of this branch against the parent branch, specifically against the latest catch-up point on the parent branch".  The attached patch implements this, using '-g'/'--use-merge-info' to trigger it:
>
>   cd my-branch-wc
>   svn diff -g ^/subversion/trunk .
>
> What does everyone think of the concept?  The user interface?  This patch is by no means a complete solution, but simply to promote discussion.

Without the -g, please. Diff should just dtrt; it should know when
branches are related, shouldn't it? And AFAICT, it already does the
right thing.

-- Brane


-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

Re: Presenting net code changes for a branch

Posted by Julian Foad <ju...@btopenworld.com>.
Gabriela Gibson wrote on 13 October:
> my branch has grown into a veritable forest, and so, I thought that
> it would be convenient to present the net code changes

... and the discussion went on to address how to use "svn diff" in the right way to show such changes, which is not exactly obvious.  The best way is to go and investigate your merge history and then choose specify the left hand side of the diff as the revision on trunk which you last caught up to.  Is that really the best we can do?  No.

This requirement is fairly basic and comes up quite often -- I have recently heard from both customers and colleagues wanting to know how to do it.

I think we should have a built-in way to say "show me the diff of this branch against the parent branch, specifically against the latest catch-up point on the parent branch".  The attached patch implements this, using '-g'/'--use-merge-info' to trigger it:

  cd my-branch-wc
  svn diff -g ^/subversion/trunk .

What does everyone think of the concept?  The user interface?  This patch is by no means a complete solution, but simply to promote discussion.

- Julian