threads / patch / 42682

patchgit-p4: correct hasBranchPrefix verbose output

Subject: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output

## tl;dr

6 messages between Jun 21, 2016 and Jun 22, 2016. Diffs are folded; open one to read it.

replies: 5people: 3as markdown or json

Andrew Oakley· Jun 21, 2016, 13:53 UTC · lore
The logic here was inverted, you got a message saying the file is
ignored for each file that is not ignored.
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to git-p4.py +1 −1
diff --git a/git-p4.py b/git-p4.py
index b6593cf..b123aa2 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2674,7 +2674,7 @@ class P4Sync(Command, P4UserMap):
             return True
         hasPrefix = [p for p in self.branchPrefixes
                         if p4PathStartsWith(path, p)]
-        if hasPrefix and self.verbose:
+        if not hasPrefix and self.verbose:
             print('Ignoring file outside of prefix: {0}'.format(path))
         return hasPrefix
 
-- 
2.7.3
Lars Schneider· Jun 21, 2016, 18:05 UTC · re: Andrew Oakley · lore

Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output

Show 18 quoted lines
> On 21 Jun 2016, at 15:53, Andrew Oakley <aoakley@roku.com> wrote:
> 
> The logic here was inverted, you got a message saying the file is
> ignored for each file that is not ignored.
> ---
> git-p4.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/git-p4.py b/git-p4.py
> index b6593cf..b123aa2 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -2674,7 +2674,7 @@ class P4Sync(Command, P4UserMap):
>             return True
>         hasPrefix = [p for p in self.branchPrefixes
>                         if p4PathStartsWith(path, p)]
> -        if hasPrefix and self.verbose:
> +        if not hasPrefix and self.verbose:
Thanks Andrew! Your fix is correct.
- Lars
Show 10 quoted lines
>             print('Ignoring file outside of prefix: {0}'.format(path))
>         return hasPrefix
> 
> -- 
> 2.7.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Junio C Hamano· Jun 21, 2016, 18:16 UTC · re: Lars Schneider · lore

Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output

Lars Schneider <larsxschneider@gmail.com> writes:
Show 20 quoted lines
>> On 21 Jun 2016, at 15:53, Andrew Oakley <aoakley@roku.com> wrote:
>> 
>> The logic here was inverted, you got a message saying the file is
>> ignored for each file that is not ignored.
>> ---
>> git-p4.py | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/git-p4.py b/git-p4.py
>> index b6593cf..b123aa2 100755
>> --- a/git-p4.py
>> +++ b/git-p4.py
>> @@ -2674,7 +2674,7 @@ class P4Sync(Command, P4UserMap):
>>             return True
>>         hasPrefix = [p for p in self.branchPrefixes
>>                         if p4PathStartsWith(path, p)]
>> -        if hasPrefix and self.verbose:
>> +        if not hasPrefix and self.verbose:
>
> Thanks Andrew! Your fix is correct.
Thanks.  This needs sign-off, though.
Show 13 quoted lines
>
> - Lars
>
>>             print('Ignoring file outside of prefix: {0}'.format(path))
>>         return hasPrefix
>> 
>> -- 
>> 2.7.3
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Oakley· Jun 22, 2016, 09:24 UTC · re: Junio C Hamano · lore

Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output

On 21/06/16 19:16, Junio C Hamano wrote:
> Thanks.  This needs sign-off, though.
Sorry, didn't realise I needed to do that!  Will resend with sign off.
Thanks
Andrew Oakley· Jun 22, 2016, 09:26 UTC · re: Junio C Hamano · lore

The logic here was inverted, you got a message saying the file is ignored for each file that is not ignored.

Signed-off-by: Andrew Oakley <aoakley@roku.com>
---
 git-p4.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to git-p4.py +1 −1
diff --git a/git-p4.py b/git-p4.py
index b6593cf..b123aa2 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2674,7 +2674,7 @@ class P4Sync(Command, P4UserMap):
             return True
         hasPrefix = [p for p in self.branchPrefixes
                         if p4PathStartsWith(path, p)]
-        if hasPrefix and self.verbose:
+        if not hasPrefix and self.verbose:
             print('Ignoring file outside of prefix: {0}'.format(path))
         return hasPrefix
 
-- 
2.7.3
Junio C Hamano· Jun 22, 2016, 18:38 UTC · re: Andrew Oakley · lore

Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output

Andrew Oakley <aoakley@roku.com> writes:
Show 5 quoted lines
> The logic here was inverted, you got a message saying the file is
> ignored for each file that is not ignored.
>
> Signed-off-by: Andrew Oakley <aoakley@roku.com>
> ---
Thanks.
Show 15 quoted lines
>  git-p4.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index b6593cf..b123aa2 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -2674,7 +2674,7 @@ class P4Sync(Command, P4UserMap):
>              return True
>          hasPrefix = [p for p in self.branchPrefixes
>                          if p4PathStartsWith(path, p)]
> -        if hasPrefix and self.verbose:
> +        if not hasPrefix and self.verbose:
>              print('Ignoring file outside of prefix: {0}'.format(path))
>          return hasPrefix

← back to recent threads