当前位置:网站首页>[must see for game development] 3-step configuration p4ignore + wonderful Q & A analysis (reprinted from user articles)
[must see for game development] 3-step configuration p4ignore + wonderful Q & A analysis (reprinted from user articles)
2022-06-11 05:56:00 【Longzhi Devops solution】
The author of this article Xiang Hua is a game industry practitioner , It's also Perforce Helix Core(P4V) user .
In the process of software development , There will always be build generated files that do not want to enter version management .
for example Nodejs In the project node_modules Catalog .
also Unity In the project Library Catalog .
The contents of these directories , It will always follow the compilation of the project source code , Or frequent changes due to changes in resources .
And for VCS, There will be a mechanism called ignore Mechanism .
P4 As a professional business VCS, Also support ignore.
And others VCS equally ,P4 Of ignore The mechanism supports users to set a series of path matching rules , Add file in (Mark for Add) and Reconcile Catalog time , Files and directories that hit the rules are ignored .
IGNORE vs Build slow
Just this week , Project engineering construction suddenly slows down , It took a long time to find out that it was in the project Library The directory is updated at the beginning of each build p4 clean Clean up .
How to correctly and securely configure P4IGNORE Well ?
To configure P4IGNORE
Whether it's Windows Platform or Mac, It takes three steps .
First step , To configure p4ignore.txt.
for example :
*.rubbish
/hungryandfoolish/
!hungryandfoolish/
As you can see , These three rules will ignore The file suffix is .rubbish The file of , and ignore The first layer under the root directory is hungryandfoolish All files in the directory of , But the second level 、 The first N Layering hungryandfoolish The directory will not be ignored.
With the configuration file , It's not over yet .
The second step , Need to set up P4 Environment variables of P4IGNORE.
Windows Configuration on
p4 set P4IGNORE=C:\Users\jasonxiang\depot\p4ignore.txt
Mac Configuration on
p4 set P4IGNORE=/home/jasonxiang/depot/.p4ignore
The third step , restart P4V, To make the configuration file in P4V Enter into force .
This is especially like a terminal, After configuring the environment variables , It needs to be reopened to load in place .
From the perspective of user experience , The author thinks P4 You can develop an environment variable hot load function , Change and use immediately , It will be smoother in use .
Ask and answer
How to verify the effectiveness ?
In addition to directly processing the ignored files mark for add or reconcile Outside , We can also go through p4 ignores Order to proceed 「 Negligibility 」 verification , Very convenient .
-i Multiple paths can be followed as parameters
p4 ignores -i -v file1 file2 file3 path4/file4
Is it possible to configure one in multiple directories p4ignore What about the documents ?
The above is set in P4IGNORE Environment variables , Absolute path is used .
If there is one on many floors p4ignore.txt To configure , The absolute path is not recommended .
For example Windows platform , It can be
p4 set P4IGNORE=p4ignore.txt
Follow up , Can I configure with different names ignore Configuration files ? such as res_ignore, code_ignore.
Absolutely. .
p4 set P4IGNORE='p4ignore.txt;.p4ignore'
that , Which level of directory will be used p4ignore Configuration ?
Practice has proved , Each valid p4ignore.txt Can find union , As long as one rule hits ignore, The file in the path ignore.
for instance :
p4 ignores -i -v d:\tools\backup\abc.jason
d:\tools\backup\abc.jason ignored
by d:\depot\tools\backup.p4ignore:1:*.jason
p4 ignores -i -v d:\depot\client\Library
d:\depot\client\Library\ ignored
by d:\depot.p4ignore:24:/client/Library/
You can see , Warehouse tools/ Next backup In the directory .p4ignore It also has the effect that it should have , It suffixes with .jason The file is ignored .
If there is no local setting P4IGNORE, I don't want people to submit it by mistake , What do I do ?
There are minimum guarantee measures .
P4 Admin You can configure the p4 protection( Permission table ), Set the required directory to non Write, This can prevent people from submitting files without version control at the server level .
like this :
Library The whole staff is forbidden to operate the directory .
About P4IGNORE, That's all for today .
Small knowledge gathers great wisdom .
Thank you for reading , I wish you a prosperous new year , realize one 's ambition !
-end-
Hello , I'm Xiang Hua .
The former original God project P4 Admin, Continuous integration developer ,8 Game test development engineer .
边栏推荐
- Set the IP address using batch
- Méthode de la partie du tableau
- NDK learning notes (VII) system configuration, users and groups
- Getting started with kotlin
- Nlp-d46-nlp match D15
- AltiumDesigner2020导入3D Body-SOLIDWORKS三维模型
- Moteur de modèle de moteur thymeleaf
- Adapter the problem of executing only one animation in multiple frames
- Multithreading tutorial (XXVIII) unsafe class
- Slide the receleview horizontally to the far right to listen to the page loading function
猜你喜欢
![[元数据]LinkedIn-DataHub](/img/6a/247ee77dfc219d26651e5d93b04c98.png)
[元数据]LinkedIn-DataHub

跨境电商测评自养号团队应该怎么做?

More than 20 cloud collaboration functions, 3 minutes to talk through the enterprise's data security experience

View controller and navigation mode

Implementation of data access platform scheme (Youzu network)

Deep learning distributed training

Wechat custom component - style - slot

Wechat applet text built-in component newline character does not newline reason

NDK learning notes (XI) POSIX sockect local communication

Es IK installation error
随机推荐
Multi thread tutorial (XXIX) immutable design
[IOS development interview] operating system learning notes
[daily exercises] 1 Sum of two numbers
Create cool collectionviewcell conversion animation
NDK learning notes (IX) POSIX sockect connection oriented communication
Altiumdesigner2020 import 3D body SolidWorks 3D model
修复【无 Internet, 安全】问题
ELK日志系统实战(五):安装vector并将数据输出到es、clickhouse案例
NLP-D46-nlp比赛D15
[go deep into kotlin] - flow advanced
Cocoapods installation error
使用Batch管理VHD
DISM命令使用小结
Metabase源码二次开发之Clojure 安装
使用Batch设置IP地址
ThymeleafEngine模板引擎
Utiliser le fichier Batch Enum
What should the cross-border e-commerce evaluation team do?
Managing VHDS using batch
Use com youth. banner. Solution to the inflateexception reported by the banner plug-in