How do you see recent SVN log entries?

后端 未结 9 2209
生来不讨喜
生来不讨喜 2020-12-04 04:55

Typing svn log spits out an incredibly long, useless list on a command line. I have no idea why that is the default. If I wanted to read (or even could read) 30

相关标签:
9条回答
  • 2020-12-04 05:53

    limit option, e.g.:

    svn log --limit 4
    
    svn log -l 4
    

    Only the last 4 entries

    0 讨论(0)
  • 2020-12-04 05:56

    Besides what Bert F said, many commands, including log has the -r (or --revision) option. The following are some practical examples using this option to show ranges of revisions:

    To list everything in ascending order:

    svn log -r 1:HEAD
    

    To list everything in descending order:

    svn log -r HEAD:1
    

    To list everything from the thirteenth to the base of the currently checked-out revision in ascending order:

    svn log -r 13:BASE
    

    To get everything between the given dates:

    svn log -r {2011-02-02}:{2011-02-03}
    

    You can combine all the above expressions with the --limit option, so that can you have a quite granular control over what is printed. For more info about these -r expressions refer to svn help log or the relevant chapter in the book Version Control with Subversion

    0 讨论(0)
  • 2020-12-04 05:59

    But svn log is still in reverse order, i.e. most recent entries are output first, scrolling off the top of my terminal and gone. I really want to see the last entries, i.e. the sorting order must be chronological. The only command that does this seems to be svn log -r 1:HEAD but that takes much too long on a repository with some 10000 entries. I've come up this this:

    Display the last 10 subversion entries in chronological order:

    svn log -r $(svn log -l 10 | grep '^r[0-9]* ' | tail -1 | cut -f1 -d" "):HEAD
    
    0 讨论(0)
提交回复
热议问题