Skip to content

Instantly share code, notes, and snippets.

@takahirom
Created April 12, 2018 13:39
Show Gist options
  • Save takahirom/4c0cf37b4492146e131b99d631b861ae to your computer and use it in GitHub Desktop.
Save takahirom/4c0cf37b4492146e131b99d631b861ae to your computer and use it in GitHub Desktop.
Generate git mv for Kotlinize
git status -s|awk '$1=="D"&&substr($2,length($2)-4)==".java"{
file=substr($2,0,length($2)-5);
getline;
if(substr($2,0,length($2)-3)==file){
print "mv " file".kt " file".kt_bak\ngit checkout HEAD "file".java\ngit mv " file".java "file".kt\ngit add "file".kt\nmv "file".kt_bak " file".kt"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment