Skip to content

Instantly share code, notes, and snippets.

@DrSterling
Forked from PandaEox/svn_short_log
Created August 25, 2025 13:53
Show Gist options
  • Save DrSterling/61733457afc5cfb84b41807f651d0040 to your computer and use it in GitHub Desktop.
Save DrSterling/61733457afc5cfb84b41807f651d0040 to your computer and use it in GitHub Desktop.

Revisions

  1. @plexus plexus created this gist Dec 16, 2011.
    26 changes: 26 additions & 0 deletions svn_short_log
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/usr/bin/awk -f

    # Convert the "svn log" output into a one liner format, which is easier to grep
    # or use in scripts. Pipe "svn log" into this script

    # When we get a line that starts with a revision number, put the data in variables
    /^r[0-9]+/ {
    rev=$1
    user=$3
    date=$5
    time=$6
    lines=13
    }

    # Anything that isn't a revision line, a separator line or an empty line
    # will be part of the commit message. Concatenate these into the comment variable
    ! (/^r[0-9+]/ || /^-+$/ || /^$/) {
    comment = comment $0
    }

    # With every separator line, output what we stored before and reset the comment variable
    # To skip the first line we also check if we've already stored a revision
    /^-+$/ && rev {
    print rev " | " user " | " date " | " time " | " comment
    comment = ""
    }