git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrej Manduch <amanduch@gmail.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-svn: doublecheck if really file or dir
Date: Sun, 27 Jul 2014 04:46:42 +0200	[thread overview]
Message-ID: <53D46812.3020706@gmail.com> (raw)
In-Reply-To: <20140723220414.GA14145@dcvr.yhbt.net>

Hi,

On 07/24/2014 12:04 AM, Eric Wong wrote:
> Andrej Manduch <amanduch@gmail.com> wrote:
>> * this fixes 'git svn info `pwd`' buggy behaviour
> 
> Good catch, the commit could use a better description, something like:
> --------------------------- 8< ----------------------------
> Subject: [PATCH] git-svn: "info" checks for dirs more carefully
> 
> This avoids a "Reading from filehandle failed at ..." error when
> running "git svn info `pwd`".
> 
> Signed-off-by: Andrej Manduch <amanduch@gmail.com>
> --------------------------- 8< ----------------------------
> 
> While your patch avoids an error, but the output isn't right, either.
> I tried it running in /home/ew/ruby, the URL field is bogus:
> 
>     ~/ruby$ git svn info `pwd`
>     Path: /home/ew/ruby
>     URL: svn+ssh://svn.ruby-lang.org/ruby/trunk/home/ew/ruby
>     Repository Root: svn+ssh://svn.ruby-lang.org/ruby
>     Repository UUID: b2dd03c8-39d4-4d8f-98ff-823fe69b080e
>     Revision: 46901
>     Node Kind: directory
>     Schedule: normal
>     Last Changed Author: hsbt
>     Last Changed Rev: 46901
>     Last Changed Date: 2014-07-22 19:06:12 +0000 (Tue, 22 Jul 2014)
> 
> The URL should be:
> 
>     URL: svn+ssh://svn.ruby-lang.org/ruby/trunk
> 
> It's better than an error, but it'd be nice if someone who uses
> this command can fix it (*hint* :).

Thx, I missed this. However this bug was not introduced with my patch,
it was there before. If you try use `git svn info full_path` and
directory is not a root dir this bug will occour even wihout my patch.

However I'll try to find some time to fix this too.

On 07/24/2014 12:04 AM, Eric Wong wrote:
> 
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
>> @@ -2029,7 +2029,7 @@ sub find_file_type_and_diff_status {
>>  	my $mode = (split(' ', $ls_tree))[0] || "";
>>  
>>  	return ("link", $diff_status) if $mode eq "120000";
>> -	return ("dir", $diff_status) if $mode eq "040000";
>> +	return ("dir", $diff_status) if $mode eq "040000" or -d $path;
> 
> "or" has a lower precedence than "||", so I would do the following:
> 
> 	return ("dir", $diff_status) if $mode eq "040000" || -d $path;
> 
> The general rule I've learned is to use "||" for conditionals and
> "or" for control flow (e.g. do_something() or die("...") ).
> 
> I can take your patch with the above changes (no need to resend),
> but I'd be happier to see the URL field corrected if you want
> to reroll.

I'll try to fix whis url bug, but it will be different patch 'cause I
think, this is different kind of a problem.

On 07/24/2014 12:04 AM, Eric Wong wrote:
> 
> Thanks.
> 

I thanks to you for great review.

--
Best Regards,
b.

  reply	other threads:[~2014-07-27  2:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18  4:20 [PATCH] git-svn: doublecheck if really file or dir Andrej Manduch
2014-07-23 22:04 ` Eric Wong
2014-07-27  2:46   ` Andrej Manduch [this message]
2014-08-03  2:45     ` Eric Wong
2014-08-03 12:22       ` Andrej Manduch
     [not found] <53DE31E8.3070405@gmail.com>
2014-08-03 13:12 ` Andrej Manduch
2014-08-04  4:02   ` Eric Wong
  -- strict thread matches above, loose matches on Subject: below --
2014-07-18  4:05 Andrej Manduch
2014-07-18  4:22 ` Andrej Manduch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53D46812.3020706@gmail.com \
    --to=amanduch@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).