Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script for git svn --authors-prog argument (author name conversion)
#!/usr/bin/env bash
# Script for converting author from SVN to Git, used as an argument for
# --authors-prog
# Example:
# "" will be "Foo Bar <>"
# "not-human" will be "not-human <>"
set -e
username2name() {
local username=$1
local firstname=${username%%.*}
local lastname=${username##*.}
local name="${firstname~} ${lastname~}"
if [[ "$firstname" == "$lastname" ]]; then
local name="$firstname"
local email="${username}@$EMAIL_DOMAIN"
echo "$name <$email>"
username2name $1

This comment has been minimized.

Copy link

paulohy commented Aug 24, 2018

thank you so much for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.