You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Warren Young <wa...@etr-usa.com> on 2005/09/16 15:24:19 UTC

-r{DATE} with cvs-like relative dates?

Is there a reason Subversion doesn't yet support fuzzy dates like 
"yesterday", or "3 weeks ago"?  This is the only thing about CVS that I 
miss in Subversion.  It makes backing up to a previous state in an ad 
hoc way much easier.

Reasons you might want this:

- you want to see what happened since yesterday: svn diff -r{yesterday}

- you're trying to find out when a feature was inadvertently broken, so 
you use a binary search between the date of the last release and today:

	svn up -r{21 days ago}
	...check...
	svn up -r{10 days ago}
	...check...
	svn up -r{5 days ago}
	...check...ah, it's broken here...
	svn up -r{7 days ago}
	...etc...

- you realize that you've been on a wild goose chase for the last hour, 
so you say "svn diff -r{1 hour ago} |less" to check that there are no 
changes you'd like to keep before you revert everything.

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

Re: -r{DATE} with cvs-like relative dates?

Posted by Daniel Berlin <db...@dberlin.org>.
On Fri, 2005-09-16 at 09:24 -0600, Warren Young wrote:
> Is there a reason Subversion doesn't yet support fuzzy dates like 
> "yesterday", or "3 weeks ago"?  This is the only thing about CVS that I 
> miss in Subversion.  It makes backing up to a previous state in an ad 
> hoc way much easier.
> 
> Reasons you might want this:
> 
> - you want to see what happened since yesterday: svn diff -r{yesterday}
> 
> - you're trying to find out when a feature was inadvertently broken, so 
> you use a binary search between the date of the last release and today:
> 
> 	svn up -r{21 days ago}
> 	...check...
> 	svn up -r{10 days ago}
> 	...check...
> 	svn up -r{5 days ago}
> 	...check...ah, it's broken here...
> 	svn up -r{7 days ago}
> 	...etc...
> 

Just FYI, this use case is not necessary with subversion, like it is
with CVS, since you have global revision numbers.

You simply binary search between revnum of last release and now.
That will give you an exact revision number instead of a fuzzy time like
CVS does.




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

Re: -r{DATE} with cvs-like relative dates?

Posted by Bob Proulx <bo...@proulx.com>.
Warren Young wrote:
> Is there a reason Subversion doesn't yet support fuzzy dates like 
> "yesterday", or "3 weeks ago"?  This is the only thing about CVS that I 
> miss in Subversion.  It makes backing up to a previous state in an ad 
> hoc way much easier.

GNU date will handle these for you.

> 	svn up -r{10 days ago}

This works:

  svn up -r{"$(date -d '10 days ago' '+%F %T')"}

Note that the date --iso-8601 option is deprecated.  A new --rfc-3339
will appear in the future.  So I would avoid that format (suggested in
the svn docs) until things settle.

Bob

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

Re: -r{DATE} with cvs-like relative dates?

Posted by Daniel Berlin <db...@dberlin.org>.
On Fri, 2005-09-16 at 12:50 -0700, Garrett Rooney wrote:
> On 9/16/05, Warren Young <wa...@etr-usa.com> wrote:
> > Ben Collins-Sussman wrote:
> > >
> > > We decided it would be a nightmare to support.
> > 
> > Could you reiterate the reasons?
> 
> The parser was not thread safe and was in many cases far too
> permisive.  You could throw things at it that don't have any real
> meaning and it will happily return to you a date.  I don't remember
> any specific examples, but if you look at the mailing list archives
> just before we released 1.0 you should be able to find them.

CVS's date parser was actually sentient.  It would seek out answers to
your date queries in it's attempt to return correct dates.

If you said "cvs -D "Bob's birthday" ", it would connect to a white
pages web site, look up all the Bob's in the world, score them, then use
Google to look up more information about each one, correlate it with
info it finds on your hard drive, and try to figure out which one you
meant.

Sometimes it got it right, but a lot of the time it decided the Bob I
meant was some guy in Germany I'd never met. 

--Dan


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

Re: -r{DATE} with cvs-like relative dates?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/16/05, Warren Young <wa...@etr-usa.com> wrote:
> Ben Collins-Sussman wrote:
> >
> > We decided it would be a nightmare to support.
> 
> Could you reiterate the reasons?

The parser was not thread safe and was in many cases far too
permisive.  You could throw things at it that don't have any real
meaning and it will happily return to you a date.  I don't remember
any specific examples, but if you look at the mailing list archives
just before we released 1.0 you should be able to find them.

-garrett

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


Re: -r{DATE} with cvs-like relative dates?

Posted by Warren Young <wa...@etr-usa.com>.
Ben Collins-Sussman wrote:
> 
> We decided it would be a nightmare to support.

Could you reiterate the reasons?

> I think there might be  an enhancement 
> issue already filed to add such a feature back in, 

I did a search before posting, but didn't find one.  I also searched 
this and the -dev mailing lists.

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

Re: -r{DATE} with cvs-like relative dates?

Posted by Ben Collins-Sussman <su...@collab.net>.
On Sep 16, 2005, at 10:59 AM, Paul Koning wrote:

>>>>>> "Warren" == Warren Young <wa...@etr-usa.com> writes:
>>>>>>
>
>  Warren> Is there a reason Subversion doesn't yet support fuzzy dates
>  Warren> like "yesterday", or "3 weeks ago"?  This is the only thing
>  Warren> about CVS that I miss in Subversion.  It makes backing up to
>  Warren> a previous state in an ad hoc way much easier.
>
>  Warren> Reasons you might want this:
>
>  Warren> - you want to see what happened since yesterday: svn diff
>  Warren> -r{yesterday}
>
> ....
>
> I agree those would be nice to have.
>
> In the meantime, it's pretty easy to do that in a script; "awk" has
> everything you need.

We used to have that feature (we stole the date-parsing bison file  
from CVS!), but then removed it just before releasing 1.0.  We  
decided it would be a nightmare to support.  I think there might be  
an enhancement issue already filed to add such a feature back in, but  
in a very "controlled" way.


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

Re: -r{DATE} with cvs-like relative dates?

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Warren" == Warren Young <wa...@etr-usa.com> writes:

 Warren> Is there a reason Subversion doesn't yet support fuzzy dates
 Warren> like "yesterday", or "3 weeks ago"?  This is the only thing
 Warren> about CVS that I miss in Subversion.  It makes backing up to
 Warren> a previous state in an ad hoc way much easier.

 Warren> Reasons you might want this:

 Warren> - you want to see what happened since yesterday: svn diff
 Warren> -r{yesterday}

....

I agree those would be nice to have.

In the meantime, it's pretty easy to do that in a script; "awk" has
everything you need.

	   paul


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