You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Harry Putnam <re...@newsguy.com> on 2009/10/11 14:36:01 UTC

From a cvs user... about revisions

I'm just starting with my first attempt at using a subversion
system... and have been a long time cvs user.

(Only on home, single user scale)

I'm getting confused about the idea of `version' as presented in the
subversion book.  Maybe I'm just creating problems that don't
exist.. or subversion has another mechanism for this....

I want to retrieve a certain copy of a file... where a change
happened.  According to what I'm reading, that change may not be at
the last version number....or possibly even the last several version
numbers...  so how do I find the change quickly?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406368

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: From a cvs user... about revisions

Posted by Jeremy Mordkoff <jl...@ZeeVee.Com>.
> From: news [mailto:news@ger.gmane.org] On Behalf Of Harry Putnam
> Sent: Sunday, October 11, 2009 10:36 AM
> I want to retrieve a certain copy of a file... where a change
> happened.  According to what I'm reading, that change may not be at
> the last version number....or possibly even the last several version
> numbers...  so how do I find the change quickly?
> 

Svn blame might help you decide which revision you want

JLM

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406642

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Bogdan Cristea <cr...@gmail.com>.
On Sunday 11 October 2009 17:36:01 you wrote:
> I'm just starting with my first attempt at using a subversion
> system... and have been a long time cvs user.
> 
> (Only on home, single user scale)
> 
> I'm getting confused about the idea of `version' as presented in the
> subversion book.  Maybe I'm just creating problems that don't
> exist.. or subversion has another mechanism for this....
> 
> I want to retrieve a certain copy of a file... where a change
> happened.  According to what I'm reading, that change may not be at
> the last version number....or possibly even the last several version
> numbers...  so how do I find the change quickly?
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2
> 406368
> 
> To unsubscribe from this discussion, e-mail:
>  [users-unsubscribe@subversion.tigris.org].
> 

Your changes should correspond to different revision numbers provided that 
after each change a commit has been made. Otherwise you should be able to 
retrieve only code versions generated by different commits to svn repo.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406371

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Mark Eichin <ei...@gmail.com>.
On Oct 11, 2009 11:58 AM, "Harry Putnam" <re...@newsguy.com> wrote:

Pat Farrell <pf...@pfarrell.com> writes: > Harry Putnam wrote: >> I want
to retrieve a certain c...
Yeah I got that part... that is the source of my misgivings.

> But the log for each file has the revision history for that file, its >
just that the number will...
Thanks ... good info.  It appears that you may have actually made log
entries during commit... if you hadn't would it still be easy to find a
change?

I ask because during my cvs usage... I often commit without typing a
log comment.  It can work because I'm the only user... and will often
be committing something I think is insignificant.  But sometimes I'll
want to look up one of those `insignificant' changes, and will know it
was within a few commits ago or etc, so can call the revision straightaway.

I might say cvs status path/file,,, to see current rev number.. then

 cvs diff -r N.N path/file   to examine differences or

 cvs co -p -r N.N path/file > ~/file

To get the actual revised file on STDOUT and redirect for a thorough
examination.

I guess maybe all the same things or similar things would be available
in subversion... but the book makes it sound as if you wouldn't be
able to associate specific changes with specific number of revisions
back... since other revisions not effecting the file of interest might
have occurred.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406390

To unsubscribe from this discussion, e-mail: [
users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406392

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 11, 2009, at 10:56, Harry Putnam wrote:

> Pat Farrell writes:
>
>> But the log for each file has the revision history for that file, its
>> just that the number will not go up by one for each change to the  
>> file.
>>
>> Use the 'svn log <file>" command to show the history of the <file>
>> and you will see the specific revision numbers, just use that in  
>> the SVN
>> command
>
>> Here is a live snippet of one log of one of my files
>>
>> ------------------------------------------------------------------------
>> r4195 | pfarrell | 2009-10-07 00:30:03 -0400 (Wed, 07 Oct 2009) | 1  
>> line
>>
>> create Pat private branch
>> ------------------------------------------------------------------------
>> r4024 | pfarrell | 2009-10-01 02:02:04 -0400 (Thu, 01 Oct 2009) | 2  
>> lines
>>
>> use safeForwardToView()
>>
>> ------------------------------------------------------------------------
>> r3990 | pfarrell | 2009-09-29 14:29:16 -0400 (Tue, 29 Sep 2009) | 3  
>> lines
>>
>> add subdirectory 'closed/' to urls that we expect to access when  
>> logged in.
>>
>
>> so if you want revision -r 3990, that's the one to use
>
> Thanks ... good info.  It appears that you may have actually made log
> entries during commit...

It's a pretty essential thing to do, IMHO. You should get into the  
habit of doing so as well.


> if you hadn't would it still be easy to find a
> change?

Well, that depends on how you would identify the change. If you know  
it's three changes ago in this file, then you can use "svn log  
FILENAME --limit 3" to see the last three log messages and their  
revision numbers (e.g. above: r4195, r4024, r3990); pick the last  
revision number and examine the diff (e.g. "svn diff FILENAME -c 3990").

You can also add path information to the log with "svn log -v  
FILENAME"; that can help you decide if the change is the one you're  
looking for.

I often like to use "svn blame FILENAME" to see, for each line of the  
file, which revision last changed it, because often I'm trying to  
identify why a particular line is in a file. Sometimes the last change  
isn't relevant -- let's say "svn blame FILENAME" shows me my line of  
interest was last modified in r3310 but "svn diff FILENAME -c 3310"  
shows that this was only an inconsequential change in the file's  
whitespace. Then I just look at the blame for the previous revision.  
"svn blame FILENAME -r 3309" and keep digging back until I find the  
reason this line was added.


> I ask because during my cvs usage... I often commit without typing a
> log comment.  It can work because I'm the only user... and will often
> be committing something I think is insignificant.  But sometimes I'll
> want to look up one of those `insignificant' changes, and will know it
> was within a few commits ago or etc, so can call the revision  
> straightaway.
>
> I might say cvs status path/file,,, to see current rev number.. then
>
>  cvs diff -r N.N path/file   to examine differences or
>
>  cvs co -p -r N.N path/file > ~/file
>
> To get the actual revised file on STDOUT and redirect for a thorough
> examination.

If you know the change was within the last 5 changes of this file, you  
can do

svn log FILENAME --limit 5

If you didn't write or don't care about log messages, you can remove  
that part from the output with

svn log -q FILENAME --limit 5

For each printed revision REV in which the file was changed, you can  
examine the differences with

svn diff -c REV path/file

To get the file the way it looked in that reversion for further  
examination, you can

svn cat -r REV path/file > ~/file

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406505

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Pat Farrell <pf...@pfarrell.com>.
Les Mikesell wrote:
> Harry Putnam wrote:
>> Thanks ... good info.  It appears that you may have actually made log
>> entries during commit... if you hadn't would it still be easy to find a
>> change?
> 
> It's never easy if you have a large number of choices that may be in branches or 
> perhaps renamed earlier copies.  That's the point of the log...


Right, its never easy, and that is why meaningful commit entries/log
values are key.

The proper definition of "meaningful commit comments" is left as an
exercise to the reader.


-- 
Pat Farrell
http://www.pfarrell.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406409

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Les Mikesell <le...@gmail.com>.
Harry Putnam wrote:
>>> Unlike CVS which assigns a revision number to a file, SVN assigns a
>> revision number to the whole repository.
> 
> Yeah I got that part... that is the source of my misgivings.

Conceptually, the difference is just that the HEAD number advances for every 
change in the repository, not separately for each file so there are jumps in the 
numbers where a specific file was changed.  But normally you either want the 
latest or you have some reason to know the version that you do want.

>> Use the 'svn log <file>" command to show the history of the <file>
>> and you will see the specific revision numbers, just use that in the SVN
>> command
> 
>> Here is a live snippet of one log of one of my files
>>
>> ------------------------------------------------------------------------
>> r4195 | pfarrell | 2009-10-07 00:30:03 -0400 (Wed, 07 Oct 2009) | 1 line
>>
>> create Pat private branch
>> ------------------------------------------------------------------------
>> r4024 | pfarrell | 2009-10-01 02:02:04 -0400 (Thu, 01 Oct 2009) | 2 lines
>>
>> use safeForwardToView()
>>
>> ------------------------------------------------------------------------
>> r3990 | pfarrell | 2009-09-29 14:29:16 -0400 (Tue, 29 Sep 2009) | 3 lines
>>
>> add subdirectory 'closed/' to urls that we expect to access when logged in.
>>
> 
>> so if you want revision -r 3990, that's the one to use
> 
> Thanks ... good info.  It appears that you may have actually made log
> entries during commit... if you hadn't would it still be easy to find a
> change?

It's never easy if you have a large number of choices that may be in branches or 
perhaps renamed earlier copies.  That's the point of the log...

> I ask because during my cvs usage... I often commit without typing a
> log comment.  It can work because I'm the only user... and will often
> be committing something I think is insignificant.  But sometimes I'll
> want to look up one of those `insignificant' changes, and will know it
> was within a few commits ago or etc, so can call the revision straightaway.
> 
> I might say cvs status path/file,,, to see current rev number.. then
> 
>   cvs diff -r N.N path/file   to examine differences or 
> 
>   cvs co -p -r N.N path/file > ~/file
> 
> To get the actual revised file on STDOUT and redirect for a thorough
> examination.

Things like that don't work well on groups of files even in CVS (or at all on 
renamed files).  Normally in CVS you would use tags to identify things you want 
to recall (because you have to in order to keep groups of files together) and 
you can do that in svn as well even though the concept is a bit different. With 
tags, you can use your own revision number/name concepts and ignore the 
repository scheme.

> I guess maybe all the same things or similar things would be available
> in subversion... but the book makes it sound as if you wouldn't be
> able to associate specific changes with specific number of revisions
> back... since other revisions not effecting the file of interest might
> have occurred.

You can, but you'll waste a lot of time if you have to hunt backwards for 
something you don't know much about.  You might like viewvc (a web browsing 
interface that works with both cvs and svn) for that kind of use.  Adding a log 
message during commits will make it much easier, though.

-- 
   Les Mikesell
    lesmikesell@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406404

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Mark Eichin <ei...@gmail.com>.
> I really dislike that commit hook, as tends to have folks enter
> "comment" just to not be blank.

Well, it helps a little that our version has some text reminding them
why (but presuming that lack of message was a commit accident, since
it's also *policy* to have detailed messages - plus we've had enough
examples of digging back and having to figure out what people were
thinking when they made the commit that people actually believe in
"writing for a future audience" (and "writing so you don't have to
figure out the problem again when someone asks about it".)  Without
that, sure, it would be a Technical Solution to a Social Problem
anti-pattern...



-- 
_Mark_ <ei...@thok.org> <ei...@gmail.com>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406412

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Pat Farrell <pf...@pfarrell.com>.
Ryan Schmidt wrote:
> It is assumed you  
> already have a policy that states that developers should describe  
> their commits. If you have developers who are deliberately subverting  
> your checks and disregarding your log policy, then you have a social  
> problem with your developers, and not a technical problem with your  
> repository.


No argument from me, its a social problem.

I just think, IMHO, etc. that the commit check is a technical solution
to a social problem. I prefer to only use technology for problems based
in technology.

The best solution is to only hire engineers that are smart enough to see
that real, meaningful comments are good for them.

-- 
Pat Farrell
http://www.pfarrell.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406504

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 11, 2009, at 11:21, Pat Farrell wrote:

> Mark Eichin wrote:
>> You can't not have a log - you can merely have a blank one.
>> (Repositories are cheap, try it :-)  While it's probably fine for  
>> your
>> use, it's a bad habit - one of the more common commit hooks is one  
>> that
>> rejects the commit if the log is blank...
>
> I really dislike that commit hook, as tends to have folks enter
> "comment" just to not be blank.

A pre-commit hook to check the length of the commit message should  
only be there to serve to remind the developer of something he should  
already want to do but has momentarily forgotten. It is assumed you  
already have a policy that states that developers should describe  
their commits. If you have developers who are deliberately subverting  
your checks and disregarding your log policy, then you have a social  
problem with your developers, and not a technical problem with your  
repository.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406503

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Pat Farrell <pf...@pfarrell.com>.
Mark Eichin wrote:
> You can't not have a log - you can merely have a blank one.
> (Repositories are cheap, try it :-)  While it's probably fine for your
> use, it's a bad habit - one of the more common commit hooks is one that
> rejects the commit if the log is blank...

I really dislike that commit hook, as tends to have folks enter
"comment" just to not be blank.

I agree, real comments are important. I use them to help me.

-- 
Pat Farrell
http://www.pfarrell.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406394

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Mark Eichin <ei...@gmail.com>.
You can't not have a log - you can merely have a blank one. (Repositories
are cheap, try it :-)  While it's probably fine for your use, it's a bad
habit - one of the more common commit hooks is one that rejects the commit
if the log is blank...

As for the diffs, you might want to look at "diff -c" as well, for just
looking at a single rev without doing the addition yourself.  Also log
--limit...

On Oct 11, 2009 11:58 AM, "Harry Putnam" <re...@newsguy.com> wrote:

Pat Farrell <pf...@pfarrell.com> writes: > Harry Putnam wrote: >> I want
to retrieve a certain c...
Yeah I got that part... that is the source of my misgivings.

> But the log for each file has the revision history for that file, its >
just that the number will...
Thanks ... good info.  It appears that you may have actually made log
entries during commit... if you hadn't would it still be easy to find a
change?

I ask because during my cvs usage... I often commit without typing a
log comment.  It can work because I'm the only user... and will often
be committing something I think is insignificant.  But sometimes I'll
want to look up one of those `insignificant' changes, and will know it
was within a few commits ago or etc, so can call the revision straightaway.

I might say cvs status path/file,,, to see current rev number.. then

 cvs diff -r N.N path/file   to examine differences or

 cvs co -p -r N.N path/file > ~/file

To get the actual revised file on STDOUT and redirect for a thorough
examination.

I guess maybe all the same things or similar things would be available
in subversion... but the book makes it sound as if you wouldn't be
able to associate specific changes with specific number of revisions
back... since other revisions not effecting the file of interest might
have occurred.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406390

To unsubscribe from this discussion, e-mail: [
users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406393

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Harry Putnam <re...@newsguy.com>.
Pat Farrell <pf...@pfarrell.com> writes:

> Harry Putnam wrote:
>> I want to retrieve a certain copy of a file... where a change
>> happened.  According to what I'm reading, that change may not be at
>> the last version number....or possibly even the last several version
>> numbers...  so how do I find the change quickly?
>
> Unlike CVS which assigns a revision number to a file, SVN assigns a
> revision number to the whole repository.

Yeah I got that part... that is the source of my misgivings.

> But the log for each file has the revision history for that file, its
> just that the number will not go up by one for each change to the file.
>
> Use the 'svn log <file>" command to show the history of the <file>
> and you will see the specific revision numbers, just use that in the SVN
> command

> Here is a live snippet of one log of one of my files
>
> ------------------------------------------------------------------------
> r4195 | pfarrell | 2009-10-07 00:30:03 -0400 (Wed, 07 Oct 2009) | 1 line
>
> create Pat private branch
> ------------------------------------------------------------------------
> r4024 | pfarrell | 2009-10-01 02:02:04 -0400 (Thu, 01 Oct 2009) | 2 lines
>
> use safeForwardToView()
>
> ------------------------------------------------------------------------
> r3990 | pfarrell | 2009-09-29 14:29:16 -0400 (Tue, 29 Sep 2009) | 3 lines
>
> add subdirectory 'closed/' to urls that we expect to access when logged in.
>

> so if you want revision -r 3990, that's the one to use

Thanks ... good info.  It appears that you may have actually made log
entries during commit... if you hadn't would it still be easy to find a
change?

I ask because during my cvs usage... I often commit without typing a
log comment.  It can work because I'm the only user... and will often
be committing something I think is insignificant.  But sometimes I'll
want to look up one of those `insignificant' changes, and will know it
was within a few commits ago or etc, so can call the revision straightaway.

I might say cvs status path/file,,, to see current rev number.. then

  cvs diff -r N.N path/file   to examine differences or 

  cvs co -p -r N.N path/file > ~/file

To get the actual revised file on STDOUT and redirect for a thorough
examination.

I guess maybe all the same things or similar things would be available
in subversion... but the book makes it sound as if you wouldn't be
able to associate specific changes with specific number of revisions
back... since other revisions not effecting the file of interest might
have occurred.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406390

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: From a cvs user... about revisions

Posted by Pat Farrell <pf...@pfarrell.com>.
Harry Putnam wrote:
> I want to retrieve a certain copy of a file... where a change
> happened.  According to what I'm reading, that change may not be at
> the last version number....or possibly even the last several version
> numbers...  so how do I find the change quickly?

Unlike CVS which assigns a revision number to a file, SVN assigns a
revision number to the whole repository.

But the log for each file has the revision history for that file, its
just that the number will not go up by one for each change to the file.

Use the 'svn log <file>" command to show the history of the <file>
and you will see the specific revision numbers, just use that in the SVN
command

Here is a live snippet of one log of one of my files

------------------------------------------------------------------------
r4195 | pfarrell | 2009-10-07 00:30:03 -0400 (Wed, 07 Oct 2009) | 1 line

create Pat private branch
------------------------------------------------------------------------
r4024 | pfarrell | 2009-10-01 02:02:04 -0400 (Thu, 01 Oct 2009) | 2 lines

use safeForwardToView()

------------------------------------------------------------------------
r3990 | pfarrell | 2009-09-29 14:29:16 -0400 (Tue, 29 Sep 2009) | 3 lines

add subdirectory 'closed/' to urls that we expect to access when logged in.


------------------------------------------------------------------------


so if you want revision -r 3990, that's the one to use

-- 
Pat Farrell
http://www.pfarrell.com/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2406372

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].