You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2005/11/01 15:20:23 UTC

Re: --change and multiple changes (Issue #1213)

Karl Chen wrote:
> 
> I would like to re-raise my wishlist issue from 2.5 years ago,
> issue #1213 titled "--revision PREVX enhancement wish".
> 
> Briefly, one usage scenario that I and others do often is to
> iterate sequentially through changes to one particular file.
[...]
> So I wish for an easy way to say "show me the diff of 1 change
> ago", "show me the diff of 2 changes ago", etc.,

That's not clear.  The difference between what and what?  "Ago" from when?

The syntax you suggested below allows you to request the difference between a 
specified revision (number/date/keyword) and the revision N changes ago from 
that.  It doesn't, for instance, allow you to request the difference between N 
and N+1 changes ago (from HEAD, BASE, or similar) which is what I imagine you 
would want for the scenario you mentioned above.

Can you show how you would achieve your goal of easily iterating through the 
changes to a file with your suggested syntax or another syntax?

- Julian


> "--change -1:N" is
> equivalent to "--revision (M-1):M" where M is the last COMMITTED
> revision <= N (similar to the difference between HEAD and
> COMMITTED).


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-11-03 08:52:54 -0500, C. Michael Pilato wrote:
> I've been blissfully ignoring this thread, and will do my darnedest to
> continue that trend after sending this email, but I gotta say
> something here.  WE DO NOT NEED TO TURN OUR COMMAND-LINE INTO A
> CALCULATOR.  I'm sorry folks, but "diff 5 changes before revision 123
> against 10 changes before revision 678"?!  I think there comes a
> moment when you have to step back and realize there are some things
> that a GUI is just *made* for.

Well, not every one can use a GUI. I often use Subversion via a
remote ssh connection, and a GUI would be much too slow. However
I agree that svn should remain quite simple, and something like
"diff 5 changes before revision 123" is not common, and probably
not very useful (except with an interactive tool).

Now, I'd like very much more common things such as the following
suggestion:

In -r N:M, N or M (but not both) may be -, in which case this means
one change before the other specified revision.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Karl Chen <qu...@cs.berkeley.edu>.
>>>>> On 2005-11-03 05:52 PST, C Michael Pilato writes:

    C> WE DO NOT NEED TO TURN OUR COMMAND-LINE INTO A CALCULATOR.

OK.  Thanks for your time.

-- 
Karl 2005-11-03 14:18

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by "C. Michael Pilato" <cm...@collab.net>.
Karl Chen <qu...@NOSPAM.quarl.org> writes:

> To support something like "diff 5 changes before revision 123
> against 10 changes before revision 678" we'd need a more general
> syntax.

I've been blissfully ignoring this thread, and will do my darnedest to
continue that trend after sending this email, but I gotta say
something here.  WE DO NOT NEED TO TURN OUR COMMAND-LINE INTO A
CALCULATOR.  I'm sorry folks, but "diff 5 changes before revision 123
against 10 changes before revision 678"?!  I think there comes a
moment when you have to step back and realize there are some things
that a GUI is just *made* for.

I return now to my blissful ignorance.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Julian Foad <ju...@btopenworld.com>.
Karl Chen wrote:
> To support something like "diff 5 changes before revision 123
> against 10 changes before revision 678" we'd need a more general
> syntax.  Here's another suggestion:
> 
>   svn diff -r 123~5:678~10 foo.txt
[... and other suggestions.]

We're still not quite connecting.  Your suggestions are all perfectly 
reasonable as syntax ideas, but it is easy to produce ideas for new features. 
The difficult but more important part is deciding what functionality is useful. 
  For instance, I haven't found a need to be able to express requests like 
"diff 5 changes before revision 123 against 10 changes before revision 678", so 
there's no point in inventing syntaxes for it unless such a need is first 
demonstrated.

Imagine you go and write the code to support all of your ideas so far, after we 
agree which syntax is going to be used for each meaning.  Imagine you do that 
tomorrow, and send us the patches.  Which patches should we apply to make 
Subversion a better product?  If we apply one of them, of course it gives 
Subversion an extension in its capabilities which is, at first sight, an 
improvement.  But will that extension make it actually more difficult to use, 
to learn, to maintain, in the long run, outweighing the benefit it gives? 
Those are the questions that need to be answered, and really there is not much 
point in spending much time on syntax or implementation details without such 
analysis.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Karl Chen <qu...@NOSPAM.quarl.org>.
To support something like "diff 5 changes before revision 123
against 10 changes before revision 678" we'd need a more general
syntax.  Here's another suggestion:

  svn diff -r 123~5:678~10 foo.txt

Thus the syntax for specifying a revision would be the usual
integer revision N, or:

  [N]~[+|-]C

    - If N is not specified, defaults to current working version
      or HEAD.

    - The '~' indicates that what follows is a difference in
      number of changes

    - '+' means add changes; '-' means subtract changes; omitted
      defaults to subtract changes

    - C specifies the number of changes

Examples:

    svn diff -r HEAD~5:HEAD~0    Diff 5 changes ago against HEAD
    svn diff -r ~5               Diff 5 changes ago against HEAD

    svn diff -r HEAD~2:HEAD~3    Diff 2 changes ago against 3
                                 changes ago
    svn diff -r ~2:~3            Diff 2 changes ago against 3
                                 changes ago

    svn diff -r 123~1:123        Diff 1 change before 123

    svn diff -r 123:123~+1       Diff 1 change after 123


Delimiter alternatives:

    - 123-5, 456+10

    - 123~-5 or 123~5, 456~+10

    - 123~-5, 456~+10

    - 123#-5, 456#+10

    - 123<<5, 456>>10
   
    I don't like 123-5:456+10 because that looks confusingly like
    118:466.  The syntax should make it obvious that this is
    something different than just adding/subtracting integers.

    I like 123~5 and 123<<5.

Default value alternatives:

    - If N is specified but M is not, then M defaults to N[~C]; if
      M is specified but N is not, then N defaults to M[~C]
      E.g. 
         svn diff -r 123:~+1
         svn diff -r ~1:123

      This could be cryptic or error-prone.

    - Use '%' or other character to specify "the value of the
      left/right- hand side" E.g.

         svn diff -r %<<5:123       Diff 5 changes before 123
         svn diff -r 123:%>>5       Diff 5 changes after 123

         svn diff -r %<<1:123<<5    Diff 1 change before 5 changes
                                    before 123


(--change is no longer relevant; it would be extending the
revision syntax everywhere.)

-- 
Karl 2005-11-02 19:00


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Julian Foad <ju...@btopenworld.com>.
Karl Chen wrote:
>>>>>>On 2005-11-02 15:35 PST, Julian Foad writes:
> 
>     Julian> Karl Chen wrote:
>     >>>>>>> On 2005-11-01 07:20 PST, Julian Foad writes:
>     Julian> Can you show how you would achieve your goal of easily
>     Julian> iterating through the changes to a file with your
>     Julian> suggested syntax or another syntax?
>     >> How about svn diff --change -2:-3 foo.txt
> 
>     Julian> Don't just make up a command and ask me "How about
>     Julian> it?"  What would you want that to mean, exactly?
> 
> I'm sorry I wasn't clear.  You asked what the syntax would be for
> getting the difference between 2 changes ago and 3 changes ago.  I
> suggest svn diff --change -2:-3 foo.txt.

That wasn't exactly what I asked, but with this additional clue I can see how 
your suggestion would enable iteration through a series of changes given a bit 
of shell scripting to increment or decrement the numbers: -c-1:-2, -c-2:-3, 
-c-3:-4, ...

But I didn't just want an answer with no explanation, I wanted a syntax with 
its semantics and an evaluation of the pros and cons.  You see how a syntax is 
nothing without its semantics?  Saying that the "-2" and "-3" in your example 
refer to "2 changes ago" and "3 changes ago" goes some way to defining the 
semantics of your suggestion.  In all your previous examples, the negative 
number had been interpreted as relative to the other revision specifier, but in 
this suggestion they are both relative to the same origin (some sort of "now", 
not precisely defined) so this is distinctly different.  So, do you think that 
suggestion is logical and easy to remember and accommodates a good range of use 
cases, given its similarity and differences to/from the other forms of "-c X:Y" 
and "-r X:Y" that we support and that you suggest?  For example, don't you 
think that if the "-3" in "BASE:-3" means "3 changes before BASE" then the "-3" 
in "-2:-3" should mean "3 changes before the revision identified by -2"? 
(Answers should be longer than "yes" or "no" :-)

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Karl Chen <qu...@NOSPAM.quarl.org>.
>>>>> On 2005-11-02 15:35 PST, Julian Foad writes:

    Julian> Karl Chen wrote:
    >>>>>>> On 2005-11-01 07:20 PST, Julian Foad writes:
    Julian> Can you show how you would achieve your goal of easily
    Julian> iterating through the changes to a file with your
    Julian> suggested syntax or another syntax?
    >> How about svn diff --change -2:-3 foo.txt

    Julian> Don't just make up a command and ask me "How about
    Julian> it?"  What would you want that to mean, exactly?

I'm sorry I wasn't clear.  You asked what the syntax would be for
getting the difference between 2 changes ago and 3 changes ago.  I
suggest svn diff --change -2:-3 foo.txt.

-- 
Karl 2005-11-02 16:25


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Julian Foad <ju...@btopenworld.com>.
Karl Chen wrote:
>>>>>>On 2005-11-01 07:20 PST, Julian Foad writes:
> 
>     Julian> Can you show how you would achieve your goal of easily
>     Julian> iterating through the changes to a file with your
>     Julian> suggested syntax or another syntax?
> 
> How about 
> 
>     svn diff --change -2:-3      foo.txt 

Don't just make up a command and ask me "How about it?"  What would you want 
that to mean, exactly?

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: --change and multiple changes (Issue #1213)

Posted by Karl Chen <qu...@NOSPAM.quarl.org>.
>>>>> On 2005-11-01 07:20 PST, Julian Foad writes:

    Julian> Can you show how you would achieve your goal of easily
    Julian> iterating through the changes to a file with your
    Julian> suggested syntax or another syntax?

How about 

    svn diff --change -2:-3      foo.txt 

-- 
Karl 2005-11-02 13:22


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org