Jump to content


Directory exclusion not working


  • Please log in to reply
4 replies to this topic

#1 danielku15

danielku15

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 04 February 2019 - 04:33 PM

Hello.

I am currently migrating our source from perforce to git via GitFusion. Somehow it is not working for me to exclude certain paths from git. Even though I specify an exclusion on the view, the files end up in the Git history. I need to exclude some test file directories as they exceed some file size limitations.

My p4gf_config looks like this:


[@repo]
description = MyProduct repository

[master]
git-branch-name = master
view = //depot/MyProduct/Trunk/... ...
-//depot/MyProduct/Trunk/src/Module1.Tests/TestFiles/... src/Module1.Tests/TestFiles/...
-//depot/MyProduct/Trunk/src/Module2.Tests/TestFiles/... src/Module2.Tests/TestFiles/...
-//depot/MyProduct/Trunk/src/IntegrationTests/TestFiles/... src/IntegrationTests/TestFiles/...
[release7.3]
git-branch-name = release/7.3
view = //depot/MyProduct/Release7.3/... ...
-//depot/MyProduct/Release7.3/src/Module1.Tests/TestFiles/... src/Module1.Tests/TestFiles/...
-//depot/MyProduct/Release7.3/src/Module2.Tests/TestFiles/... src/Module2.Tests/TestFiles/...
-//depot/MyProduct/Release7.3/src/IntegrationTests/TestFiles/... src/IntegrationTests/TestFiles/...

The syntax itself is detected as valid. I could see that git fusion even updated/reordered some of the remove records after I ran p4gf_init_repo.py on the server. But when I make a clone afterwards and scan for big files I can still see files from the excluded paths.

Is it possible that they are included back due to some merge/branching that happened in Perforce? Can I get rid of them otherwise? I would like to avoid cleaning the git repository manually (filter-branch, bfg + gc) as I saw the operations are very time consuming.

Kind Regards
Daniel

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 889 posts

Posted 04 February 2019 - 05:00 PM

I don't know much about how Git Fusion generates its views, so rather than try to debug that end of it -- what if you just excluded access to the relevant files via the protection table, so that Git Fusion flat out can't even seen them?  Since Git Fusion uses client commands to pull stuff from Perforce (IIRC) there should be no way for files to be migrated if there's no way for a client to get at them.

#3 danielku15

danielku15

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 04 February 2019 - 05:09 PM

Could be an idea. Thanks for the tip. I just hope I can really restrict the access to Git Fusion. In general it requires full admin privileges for the accounts being used. Not sure if I can revoke the access for admins. But its worth a shot.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 889 posts

Posted 04 February 2019 - 06:17 PM

You can revoke per-file permissions for a "super" user in Perforce without negatively impacting the "global" permissions (i.e. stuff needed to create new depots, modify the protection table, etc) that I assume Git Fusion needs.  Just make sure to put the exclusion(s) after the line that grants the "super" access so that they aren't overridden.

Note that practically speaking, a super user can always re-grant themselves permission, so you can't actually secure things from a super user, but the exclusions will still apply to any file-based commands they run (so it's useful if you want to keep yourself from accidentally modifying or syncing a path, or something like that).

#5 Matt Janulewicz

Matt Janulewicz

    Advanced Member

  • Members
  • PipPipPip
  • 176 posts
  • LocationSan Francisco, CA

Posted 03 April 2019 - 07:05 AM

I went through this a couple years ago, so my memory might be sketchy, but I think there were two things that caused this for me:

1) At some point I had the config without the exclusions, and it was either inited or cloned. Once that happens, you can't add exclusions, what was there will always be there. I had to delete the repo and start over.

2) I just checked all my GitFusion configs that have exclusions, and the exclusion lines are always indented (one tab.) I don't specifically recall that this was a problem, but it seems like I was doing this very deliberately on a dozen or more files, so perhaps it only properly reads multi-line views if all lines past the first one are tabbed ...?

The example at the bottom of this man page shows secondary lines indented, though doesn't specifically mention that they need to be:

https://www.perforce...configfile.html
-Matt Janulewicz
Staff SCM Engineer, Perforce Administrator
Dolby Laboratories, Inc.
1275 Market St.
San Francisco, CA 94103, USA
majanu@dolby.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users