Skip to content

Instantly share code, notes, and snippets.

View benson-basis's full-sized avatar

Benson Margulies benson-basis

  • Basis Technology Corp.
View GitHub Profile
@geoff-nixon
geoff-nixon / gitsvndiff
Last active May 30, 2016 14:23 — forked from katta/gitdiff-svnpatch.sh
Use 'git diff' to produce subversion style patches.
#!/bin/sh
svnstyle(){ sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" -e 's/@@\(.*\)@@.*/@@\1@@/g' ;}
DIFFPARAMS='--no-prefix --ignore-space-at-eol --minimal'
git diff $DIFFPARAMS "$@" | svnstyle
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch