Jump to content


danielku15

Member Since 04 Dec 2018
Offline Last Active Feb 04 2019 05:06 PM
-----

Topics I've Started

Directory exclusion not working

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

Exclude tree for p4 fetch

04 December 2018 - 03:00 PM

Hey everybody.

TL;DR: Is there a way to tell p4 fetch to ignore certain trees in the history completely? I do not have access to certain trees and/or they are not relevant for my fetch. But as the changes are part of integrations spanning multiple trees fetch is not possible anymore.


Long Version:
I am currently trying to fetch the source code from our product from the central server to my personal one on my machine. Unfortunately there seems a restriction on fetching I am currently fighting with I hope somebody can help me getting this running.

Before going into details first some introductional information:

We use a classical branching strategy for our product that is based on "folders". Historically one of our products lives below the main tree of our product suite.
  • //depot/OurSuite/OurSuite
    Trunk
  • //depot/OurSuite/OurSuite3.0
    Release 3.0
  • //depot/OurSuite/OurSuite2.0
    Release 2.0
  • //depot/OurSuite/OurSuite/SubProduct
    Trunk of "SubProduct"
  • //depot/OurSuite/OurSuite/OldProduct
    Trunk of "OldProduct
  • //depot/OurSuite/OurSuite3.0/SubProduct
    Release 3.0 of "SubProduct"
My goal is to fetch only "SubProduct" with all branches to my personal server.

Now to the restriction I am having issues with: We have some changelists that contains changes spanning both products. For instance when we update some version numbers there are some commits that bump the version file from "SubProduct" and "OldProduct" in one go. With this cross-folder changelist in place, a pull of "SubProduct" only seems impossible. Perforce requires you to widen your remote spec to include the whole "OurSuite" tree.

Typical error messages I encounter there are:
  • Change 748318 performs a move/add on //depot/OurSuite/OurSuite/OurProduct/SomeFile.cpp#1, but the parameters of this fetch, push, or zip command include only part of the full action. Specify a wider view to include both the source and target of the change, or specify a narrower view to exclude both the source and target of the change.
  • Change 750162 performs a move/delete on //depot/OurSuite/OurSuite3.0/OurProduct/SomeOtherFile.cpp#3, but the parameters of this fetch, push, or zip command include only part of the full action. Specify a wider view to include both the source and target of the change, or specify a narrower view to exclude both the source and target of the change.
I understand that typically it is a requirement that you need to include all files in your view that are related to your tree to fetch it. But requiring that really every dependency that might be once be part of a changelist is in the view, breaks the whole benefit of maybe consuming only a sub-tree you are working with. In my case the problem goes really far and I would end up in cloning our whole depot just to get "OurProduct". Also I have some trees where I do not even have read access. Just because another developer merged once in the past 2 trees in one shot, fetching for me is not possible anymore.

Is there some way how I can tell perforce to ignore these errors and maybe only fetch the parts of the CLs that are contained in my remote spec? I do not care that maybe with 750162 a whole other subtree below "OldProduct" was also merged back from the 3.0 branch to the trunk. I only want to consume the SubProduct tree with related changes.

My next step would be to push SubProduct to another perforce server with GitFusion enabled, hence I want to retain the whole history for SubProduct. The cross-tree merge happened quite lately which means if I fetch only partly the history, on git we will only see the changes of the last few weeks.

Home my intention is clear.

Kind Regards
Daniel