git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-svn: Create leading directories in create-ignore
@ 2009-02-19 18:08 Brian Gernhardt
  2009-02-23  4:34 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Gernhardt @ 2009-02-19 18:08 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

Since SVN tracks empty directories and git does not, we can not assume
that the directory exists when creating .gitignore files.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---
 git-svn.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index cbc5211..8acd69e 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -670,7 +670,10 @@ sub cmd_create_ignore {
 	$gs->prop_walk($gs->{path}, $r, sub {
 		my ($gs, $path, $props) = @_;
 		# $path is of the form /path/to/dir/
-		my $ignore = '.' . $path . '.gitignore';
+		$path = '.' . $path;
+		# SVN can have attributes on empty directories, which git won't track
+		mkpath([$path]) unless -d $path;
+		my $ignore = $path . '.gitignore';
 		my $s = $props->{'svn:ignore'} or return;
 		open(GITIGNORE, '>', $ignore)
 		  or fatal("Failed to open `$ignore' for writing: $!");
-- 
1.6.2.rc1.241.g7bf82

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] git-svn: Create leading directories in create-ignore
  2009-02-19 18:08 [PATCH] git-svn: Create leading directories in create-ignore Brian Gernhardt
@ 2009-02-23  4:34 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2009-02-23  4:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Brian Gernhardt, git

Brian Gernhardt <benji@silverinsanity.com> wrote:
> Since SVN tracks empty directories and git does not, we can not assume
> that the directory exists when creating .gitignore files.
> 
> Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>

Thanks Brian, applied with minor line wrapping adjustment
and pushed out to:

  git://git.bogomips.org/git-svn

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-23  4:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 18:08 [PATCH] git-svn: Create leading directories in create-ignore Brian Gernhardt
2009-02-23  4:34 ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).