Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

xsawyerx (8978)

xsawyerx
  (email not shown publicly)

Journal of xsawyerx (8978)

Monday June 01, 2009
06:34 AM

Subversion pissing me off

[ #39058 ]

While working on a project, I realized I wanted to add some code that parts of it existed in a file I deleted along with other deprecated old files. It would shorten my work to copy/paste (or at least view) some of the code I had in that old file.

$ svn log -v

This command showed me very nicely a lot of commit messages, but.. something is off.

  • I definitely committed more than that!
  • I can't see the file I'm looking for
  • I find the file, it shows commits on it but not a delete.

I try this instead:

$ svn log -v | perl -nle'/\s+D\w/ && print'

Nothing. Since I don't know when I have finished committing changes to it, I don't know which revision of it I should get. I'm beginning to dislike subversion...

In Git, by the way:

$ git --no-pager log --name-status | perl -nle'/^D\s+/ && print'

You may say "this is pretty long" or "see? that's complex" but:

  • it's not really long, quit fscking complaing
  • it took me less than 10 seconds to figure it out, with subversion I'm still stuck
  • THIS WORKS!
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Sorry, but svn log -v works. You're either not looking at the code or you didn't commit a delete on the file.

    • Even though Shlomi Fish grilled me for about half an hour on what I did and how I did it to find the missing file, I will show it here as well anyway, because "Seeing is believing".

      xsawyerx@gnubuntu:~/code/admin/My-App$ svn status
      ?      output_log.txt
      M      Changes

      xsawyerx@gnubuntu:~/code/admin/My-App$ svn log -v | grep 10-eg_server.t -B 6
      ------------------------------------------------------------------------
      r12 529 | yaronm | 2009-04-12 18:34:49 +0300 (Sun, 12 Apr 2009) |

      • I wasn't trying to be insulting. It's only reasonable to look for user mistakes or misunderstanding before assuming that a behavior in a widely used piece of software is a bug. Think of how many times people have reported they found a bug in Perl and how many times they actually had.

        I suspect there's an answer for this one involving either how the paths under CWD are figured or which revisions are shown when no number is specified. If you actually want to solve it, I suspect you'd be better off asking on

  • svn log is brain-dead and will display more/different information for the URL than the working copy path (the command's default). So try using the URL at the end of the command.
  • I'm guessing git is like mercurial, in that it shows you the commit log for the entire repo no matter what your cwd. Subversion, on the other hand, only shows you the commit log for any paths at your cwd or deeper. If you cd into the root of your repo's trunk, svn log may list more of your commits.

  • Maybe the 'less' command is still fired, but it does the right thing if it's in the middle of a pipe.