How do you see recent SVN log entries?

后端 未结 9 2208
生来不讨喜
生来不讨喜 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:34

    I like to use -v for verbose mode.
    It'll give you the commit id, comments and all affected files.

    svn log -v --limit 4
    

    Example of output:

    I added some migrations and deleted a test xml file
    ------------------------------------------------------------------------
    r58687 | mr_x | 2012-04-02 15:31:31 +0200 (Mon, 02 Apr 2012) | 1 line Changed
    paths: 
    A /trunk/java/App/src/database/support    
    A /trunk/java/App/src/database/support/MIGRATE    
    A /trunk/java/App/src/database/support/MIGRATE/remove_device.sql
    D /trunk/java/App/src/code/test.xml
    
    0 讨论(0)
  • 2020-12-04 05:40

    To add to what others have said, you could also create an alias in your .bashrc or .bash_aliases file:

    alias svnlog='svn log -l 30 | less'
    

    or whatever you want as your default

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

    This answer is directed at further questions regarding Subversion subcommands options. For every available subcommand (i.e. add, log, status ...), you can simply add the --help option to display the complete list of available options you can use with your subcommand as well as examples on how to use them. The following snippet is taken directly from the svn log --help command output under the "examples" section :

    Show the latest 5 log messages for the current working copy
    directory and display paths changed in each commit:
      svn log -l 5 -v
    
    0 讨论(0)
  • 2020-12-04 05:45

    Pipe the output through less or other pager:

    svn log | less
    
    0 讨论(0)
  • 2020-12-04 05:45

    As you've already noticed svn log command ran without any arguments shows all log messages that relate to the URL you specify or to the working copy folder where you run the command.

    You can always refine/limit the svn log results:

    • svn log --limit NUM will show only the first NUM of revisions,
    • svn log --revision REV1(:REV2) will show the log message for REV1 revision or for REV1 -- REV2 range,
    • svn log --search will show revisions that match the search pattern you specify (the command is available in Subversion 1.8 and newer client). You can search by
      • revision's author (i.e. committers username),
      • date when the revision was committed,
      • revision comment text (log message),
      • list of paths changed in revision.
    0 讨论(0)
  • 2020-12-04 05:52

    In case anybody is looking at this old question, a handy command to see the changes since your last update:

    svn log -r $(svn info | grep Revision | cut -f 2 -d ' '):HEAD -v

    LE (thanks Gary for the comment)
    same thing, but much shorter and more logical:

    svn log -r BASE:HEAD -v

    0 讨论(0)
提交回复
热议问题