From: Sam Vilain Date: Sun, 17 Aug 2008 09:11:58 GMT Subject: Re: Converting from svn to git Message-ID: <1218964318.2149.3.camel@maia.lan> In-Reply-To: On Fri, 2008-08-15 at 15:58 +0200, Michael J Gruber wrote: > A while ago I "complained" that rebase would skip empty commits. You > might experiment with that. Alternatively, the following works for me: > > git filter-branch --commit-filter 'cmd="git commit-tree"; test `git show > --pretty=oneline $GIT_COMMIT|wc -l` = 1 && cmd="skip_commit"; $cmd "$@"' > -- --all > > This skips all commits which introduce no diff. It will not remove > branches or tags which are related only to those subdirs. > > I am sure there will be more elegant ways to do that (esp. the test with > wc). something like this should work: --commit-filter 'if [ "$1" = `git rev-parse HEAD^{tree}` ]; then skip_commit "$@"; else git commit-tree "$@"; fi' Sam.