svngit

Git log output like 'svn ls -v'


Is there a way to make Git give me output like svn ls -v does? Basically, a list of each file and who last edited that file? Like this:

filea.txt     Someone Else
fileb.txt     Another Person

Maybe even with the SHA-1 hash values to identify the commit the change happened in?


Solution

  • It's not a very natural question to ask in Git, but you can probably achieve something like what you want with something like this.

    for a in $(ls); do git log --pretty=format:"%h%x09%an%x09%ad%x09$a" -1 -- "$a"; done
    

    This goes through each file in the current directory and performs a git log on it to find the last commit to have affected it.

    It's not very efficient, as it searches the Git history for each file and doesn't make any effort to reuse the results of previous searches. It is, however, a one-liner.