User Tools

Site Tools


subversion_notes

filtering the log messages

svn log between two dates

svn log -r {2017-09-01}:{2017-10-31} | less

svn log between two dates by a particular author

svn log -r {2017-09-01}:{2017-10-31} --search author_foo | less

svn log by a particular user in the last N commits

svn log --search author_foo -l N | less

Increase the context when doing svn diff

By default, svn diff shows three lines of context. To change it to 10

svn diff FILENAME --diff-cmd=diff -x -U10

See

svn help diff

for explanation of the arguments and generic use cases.

Related Links:

tags | svn diff more context

What files changed locally?

List files that changed locally

Most generic way

  • Using perl
    => svn st | perl -ne '{ next if /^\?/; if (/(\S+)$/) {print "$1\n";} }' | xargs -r ls -al --time-style="+%Y%m%d_%H%M"

    The -r argument to xargs tells not to run the command if there are no arguments. Useful in the corner case where no files tracked by svn are modified.

Other possible ways

  • Using grep and cut
    => svn st | grep -v '^?' | cut -c 9- | xargs -r ls -al --time-style="+%Y%m%d_%H%M"

    This does not work if GREP_OPTIONS is set to display line numbers in the output of grep. In that case the filename may not start from 9th character.

    See the perl version above which does not have this issue.

  • Using grep and awk
    => svn st | grep -v '^?' | awk '{print $2}' | xargs -r ls -al --time-style="+%Y%m%d_%H%M"

    This does not work if the svn st output contains lines of the form

    A  +    file.c

    See the perl version above which does not have this problem.

subversion_notes.txt · Last modified: 2024/12/13 20:45 by raju