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

6 messages from 2016-06-21 to 2016-06-22. Participants: Andrew Oakley, Lars Schneider, Junio C Hamano.
Thread: https://gitlist.dev/t/42682

## Andrew Oakley, 2016-06-21 13:53

Subject: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output
Message-ID: <1466517222-12600-1-git-send-email-aoakley@roku.com>
URL: https://gitlist.dev/e/1466517222-12600-1-git-send-email-aoakley%40roku.com

```
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:
             print('Ignoring file outside of prefix: {0}'.format(path))
         return hasPrefix
 
-- 
2.7.3


```

## Lars Schneider, 2016-06-21 18:05

Subject: Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output
Message-ID: <C471957C-3FEE-4CEB-8940-624F73784355@gmail.com>
URL: https://gitlist.dev/e/C471957C-3FEE-4CEB-8940-624F73784355%40gmail.com
In-Reply-To: <1466517222-12600-1-git-send-email-aoakley@roku.com>

```

> 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

>             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, 2016-06-21 18:16

Subject: Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output
Message-ID: <xmqqbn2uqufj.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqbn2uqufj.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <C471957C-3FEE-4CEB-8940-624F73784355@gmail.com>

```
Lars Schneider <larsxschneider@gmail.com> writes:

>> 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.

>
> - 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, 2016-06-22 09:24

Subject: Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output
Message-ID: <576A595E.9040704@roku.com>
URL: https://gitlist.dev/e/576A595E.9040704%40roku.com
In-Reply-To: <xmqqbn2uqufj.fsf@gitster.mtv.corp.google.com>

```
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, 2016-06-22 09:26

Subject: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output
Message-ID: <1466587571-18532-1-git-send-email-aoakley@roku.com>
URL: https://gitlist.dev/e/1466587571-18532-1-git-send-email-aoakley%40roku.com
In-Reply-To: <xmqqbn2uqufj.fsf@gitster.mtv.corp.google.com>

```
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(-)

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, 2016-06-22 18:38

Subject: Re: [PATCH 1/1] git-p4: correct hasBranchPrefix verbose output
Message-ID: <xmqqd1n9m5m0.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqd1n9m5m0.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1466587571-18532-1-git-send-email-aoakley@roku.com>

```
Andrew Oakley <aoakley@roku.com> writes:

> 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.

>  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

```
