#!/usr/bin/perl -w
#
# svnignore2gitignore.pl
# License: GPLv2
# Date: 2012-05-21
# Author: Bernhard M. Wiedemann
#         J. Daniel Schmidt


my $URL=shift;

open(my $FH, "svn propget -R svn:ignore $URL |") or die "Could not open $URL. $!";
my $pre='';
my @res;

while (<$FH>)
{
  next if m/^\s*$/;

  if (s{$URL(/?)(\S*) - }{})
  {
    $pre=$2.$1;
  }
  push @res, $pre.$_;
}

print (sort @res);
