Jump to content


P4IGNORE working but not?

p4 ignore

  • Please log in to reply
10 replies to this topic

#1 Tsaukpaetra

Tsaukpaetra

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 07 February 2018 - 06:04 PM

So I'm having quite a conundrum using .p4ignore files. Previously on Windows I had a .p4ignore file like so for Jenkins:

build.xml
fingerprints/

So, one file and one folder. This worked fine, people couldn't add any file named build.xml, and anything in the fingerprints folder couldn't be added either.

Switching to FreeBSD (due to complications with things), Jenkins is up and running and I sync down all the files.

Checking the .p4ignore file, I indeed cannot add build.xml files, but I can add stuff in the fingerprints folder!


root@bobthebuilder:/usr/local/jenkins # p4 -p perforce:1666 -c jenkins-config add jobs/testJob/1/build.xml
//depot/Jenkins/jobs/Per-Commit builds/jobs/testJob/1/build.xml#1 - opened for add
/usr/local/jenkins/jobs/Per-Commit builds/jobs/testJob/1/build.xml - ignored file can't be added.



root@bobthebuilder:/usr/local/jenkins # p4 -p perforce:1666 -c jenkins-config add fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#1 - currently opened for add


According to p4 ignores, it rightly *should* be ignored:


root@bobthebuilder:/usr/local/jenkins # p4 -p purrforce:1666 -c jenkins-config ignores -i -v fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml
/usr/local/jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml ignored by /usr/local/jenkins/.p4ignore:2:fingerprints/


So... any ideas what I'm doing wrong here?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 07 February 2018 - 07:42 PM

The "currently opened for add" means that the file was already opened for add before you ran that command.  Could it have been opened for add before you put the .p4ignore file in place?  What happens if you revert and then retry the "p4 add"?

#3 Tsaukpaetra

Tsaukpaetra

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 07 February 2018 - 07:49 PM

View PostSambwise, on 07 February 2018 - 07:42 PM, said:

The "currently opened for add" means that the file was already opened for add before you ran that command.  Could it have been opened for add before you put the .p4ignore file in place?  What happens if you revert and then retry the "p4 add"?

Maagic?


root@bobthebuilder:/usr/local/jenkins # p4 -p perforce:1666 -c jenkins-config revert fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#none - was add, abandoned
root@bobthebuilder:/usr/local/jenkins # p4 -p perforce:1666 -c jenkins-config add fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#1 - currently opened for add
root@bobthebuilder:/usr/local/jenkins # p4 -p perforce:1666 -c jenkins-config revert fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#none - was add, abandoned
root@bobthebuilder:/usr/local/jenkins # p4 -p perforce:1666 -c jenkins-config add fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#1 - opened for add

I scoured the docs and eventually came up with the following line:


/fingerprints/**

and *that* works, But I'm not sure why the previous one doesn't work...

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 07 February 2018 - 09:11 PM

View PostTsaukpaetra, on 07 February 2018 - 07:49 PM, said:

Maagic?
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#none - was add, abandoned
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#1 - currently opened for add
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#none - was add, abandoned
//depot/Jenkins/fingerprints/ed/67/51df02fe57e33252403aa35ec215.xml#1 - opened for add

wat

Independently of the P4IGNORE thing, the fact that you apparently non-deterministically got different messages after doing the exact same thing (I'm looking at the "currently opened" vs "opened" messages here) does seem like bad magic.

#5 Tsaukpaetra

Tsaukpaetra

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 07 February 2018 - 09:16 PM

View PostSambwise, on 07 February 2018 - 09:11 PM, said:

wat

Independently of the P4IGNORE thing, the fact that you apparently non-deterministically got different messages after doing the exact same thing (I'm looking at the "currently opened" vs "opened" messages here) does seem like bad magic.

I'm thinking that particular issue may have been caused by Jenkins eagerly re-adding the fingerprint file on that side?

But... even so... it shouldn't be able to add it, right? Since Jenkins is (supposed to be) using the same .p4ignore file...

I'll test more now that I have a line that seems to work(-ish)...

#6 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 07 February 2018 - 10:42 PM

View PostTsaukpaetra, on 07 February 2018 - 09:16 PM, said:

But... even so... it shouldn't be able to add it, right? Since Jenkins is (supposed to be) using the same .p4ignore file...

I know nothing about what the Jenkins plugin does, but you can override a .p4ignore file with the -I flag.

Could it be that you had a different version of p4 installed on the old (Windows) machine from what you have now on the BSD machine?  Most of Perforce's smarts are in the server, but the ignore handling is mostly client-side so it might be that your BSD client executable has a bug that your Windows executable didn't.

#7 Tsaukpaetra

Tsaukpaetra

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 08 February 2018 - 12:53 AM

View PostSambwise, on 07 February 2018 - 10:42 PM, said:

what you have now on the BSD machine?  

Possible. The Jenkins plugin uses P4Javafor operations, so I might just dig around the source for that too.

For now I'm just forcing a revert on the files intended to be ignored before submit anyways.

#8 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 08 February 2018 - 05:11 PM

View PostTsaukpaetra, on 08 February 2018 - 12:53 AM, said:

Possible. The Jenkins plugin uses P4Java for operations, so I might just dig around the source for that too.

Ah, that explains it -- P4Java is a complete reimplementation of the p4 client logic (unlike most of the client APIs that are built on the C++ libraries, which are still being maintained), and as far as I know it's been totally abandoned for years.  The last change in the Workshop appears to be for r14.1, which predates a whole bunch of P4IGNORE fixes -- anything you see in the p4 relnotes after 2014.1 with a * (meaning "needs client upgrade", which all of the P4IGNORE functionality is going to fall under) is not going to work in P4Java, and when I was skimming through the relnotes trying to figure out why you were getting weird results I saw that there was a bunch of work in 2015.1.

Maybe the better option would be to exclude these files from the client view, since that's handled server-side?

#9 Tsaukpaetra

Tsaukpaetra

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 08 February 2018 - 05:53 PM

View PostSambwise, on 08 February 2018 - 05:11 PM, said:

Maybe the better option would be to exclude these files from the client view, since that's handled server-side?

That might be the trick. I think I can do this despite the fingerprints folder not being actually in the depot, right? So something like:

//depot/Jenkins/... //jenkins-config/...
-//depot/Jenkins/fingerprints/... //jenkins-config/fingerprints/...

Edit: Oh for... This probably *would* work, except that the Jenkins plugin is also "fixing" the workspace and effectively removing my edit. <_<

Well, time to make a pull request to P4Jenkins I think...

#10 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 08 February 2018 - 08:05 PM

View PostTsaukpaetra, on 08 February 2018 - 05:53 PM, said:

That might be the trick. I think I can do this despite the fingerprints folder not being actually in the depot, right? So something like:

//depot/Jenkins/... //jenkins-config/...
-//depot/Jenkins/fingerprints/... //jenkins-config/fingerprints/...

Yup, client views operate on namespaces regardless of whether the depot actually contains anything there yet.  :)

Quote

Edit: Oh for... This probably *would* work, except that the Jenkins plugin is also "fixing" the workspace and effectively removing my edit. <_<

:blink:

#11 Tsaukpaetra

Tsaukpaetra

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 08 February 2018 - 09:58 PM

View PostSambwise, on 08 February 2018 - 08:05 PM, said:


:blink:

Yeah... The Jenkins plugin is... Special. At least it's somewhat actively developed.





Also tagged with one or more of these keywords: p4, ignore

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users