Git development
 help / color / mirror / Atom feed
* [PATCH] import-tars: be nice to wrong directory modes
@ 2007-04-28 23:59 Johannes Schindelin
  2007-04-29  0:08 ` Shawn O. Pearce
  2007-04-29  1:36 ` Randal L. Schwartz
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Schindelin @ 2007-04-28 23:59 UTC (permalink / raw)
  To: Shawn O. Pearce, git


Some tars seem to have modes 0755 for directories, not 01000755. Do
not generate an empty object for them, but ignore them.

Noticed by riddochc on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 contrib/fast-import/import-tars.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 1842146..5575080 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -52,6 +52,7 @@ foreach my $tar_file (@ARGV)
 			Z8 Z1 Z100 Z6
 			Z2 Z32 Z32 Z8 Z8 Z*', $_;
 		last unless $name;
+		next if $name =~ '/$';
 		$mode = oct $mode;
 		$size = oct $size;
 		$mtime = oct $mtime;
-- 
1.5.2.rc0.2496.g74f7

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

* Re: [PATCH] import-tars: be nice to wrong directory modes
  2007-04-28 23:59 [PATCH] import-tars: be nice to wrong directory modes Johannes Schindelin
@ 2007-04-29  0:08 ` Shawn O. Pearce
  2007-04-29  1:07   ` Junio C Hamano
  2007-04-29  1:36 ` Randal L. Schwartz
  1 sibling, 1 reply; 5+ messages in thread
From: Shawn O. Pearce @ 2007-04-29  0:08 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> 
> Some tars seem to have modes 0755 for directories, not 01000755. Do
> not generate an empty object for them, but ignore them.

This fix is small and corrects a rather ugly repository corruption,
so I've applied it to my gfi-maint branch.

-- 
Shawn.

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

* Re: [PATCH] import-tars: be nice to wrong directory modes
  2007-04-29  0:08 ` Shawn O. Pearce
@ 2007-04-29  1:07   ` Junio C Hamano
  2007-04-29  1:11     ` Shawn O. Pearce
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-04-29  1:07 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Johannes Schindelin, git

"Shawn O. Pearce" <spearce@spearce.org> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> 
>> Some tars seem to have modes 0755 for directories, not 01000755. Do
>> not generate an empty object for them, but ignore them.
>
> This fix is small and corrects a rather ugly repository corruption,
> so I've applied it to my gfi-maint branch.

Good teamplay.  So you want me to pull gfi-maint to maint and
gfi-master to master?

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

* Re: [PATCH] import-tars: be nice to wrong directory modes
  2007-04-29  1:07   ` Junio C Hamano
@ 2007-04-29  1:11     ` Shawn O. Pearce
  0 siblings, 0 replies; 5+ messages in thread
From: Shawn O. Pearce @ 2007-04-29  1:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin, git

Junio C Hamano <junkio@cox.net> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >> 
> >> Some tars seem to have modes 0755 for directories, not 01000755. Do
> >> not generate an empty object for them, but ignore them.
> >
> > This fix is small and corrects a rather ugly repository corruption,
> > so I've applied it to my gfi-maint branch.
> 
> Good teamplay.  So you want me to pull gfi-maint to maint and
> gfi-master to master?

Right.

And apply the fsck patch i sent to the list.  ;-)
 
-- 
Shawn.

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

* Re: [PATCH] import-tars: be nice to wrong directory modes
  2007-04-28 23:59 [PATCH] import-tars: be nice to wrong directory modes Johannes Schindelin
  2007-04-29  0:08 ` Shawn O. Pearce
@ 2007-04-29  1:36 ` Randal L. Schwartz
  1 sibling, 0 replies; 5+ messages in thread
From: Randal L. Schwartz @ 2007-04-29  1:36 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Shawn O. Pearce, git

>>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

Johannes> +		next if $name =~ '/$';

This is misleading.  That's a regex there.  And it also falsely matches a
string ending in "/\n", but I bet there are parts of git that break on those
filenames too. :)

Consider:

        next if $name =~ m{/\z};

which matches precisely when the filename ends in /.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

end of thread, other threads:[~2007-04-29  1:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-28 23:59 [PATCH] import-tars: be nice to wrong directory modes Johannes Schindelin
2007-04-29  0:08 ` Shawn O. Pearce
2007-04-29  1:07   ` Junio C Hamano
2007-04-29  1:11     ` Shawn O. Pearce
2007-04-29  1:36 ` Randal L. Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox