Unlock File Manually Coded

Wouldn't it be possible to lock every file in the Pods folder (using SetFile -a L [thefile]) to prevent accidental editing of sources of the libraries imported by CocoaPods? Some coworkers are sometimes tempted to modify the source code of a pod (for example if they found a bug in it) directly in the Pods.xcodeproj project, instead of editing the source of the original pod (create a branch on the pod repository, file a pull request, etc). This happens most of the time unintentionally, simply because they didn't realize this source code was one of a pod's (navigating in Xcode using Cmd-clics may lead you far without realizing where you land) Locking all files in the Pods/ directory would prevent such mistakes, by making Xcode warn you before you try and edit a source file you should'nt.

Unlock File Manually Coded

Garmin License & Unlock Codes¶. Backroadmapbooks uses Garmin License technology to unlock and display the maps on your unit. The license files are used to unlock the maps on your device and can also be used to unlock the maps you have installed in Garmin Basecamp. The.gma file is used to authenticate the maps.

Note: One problem with that is that the 'Locked' flag (that you can set/get using SetFIle/GetFileInfo) is attached to the HFS+ filesystem if I'm not mistaken, but if I commit the Pods/ folder on my repo (because my coworkers and my Jenkins-CI should not be forced to install cocoapods on their own machine and run pod update themselves after each git pull) I'm not sure such Locked flag will stick. If that's not the case, any alternative solution is welcome to overcome this issue and avoid those mistakes. This sounds like a great feature to add. The only issue that I see at the moemt with the current implementation is that it makes the Pods folder harder to remove from the command line using rm. As locked files require either to be unlocked first, or super user privileges. Unfortunately I won't have much time for that soon (we are reorganizing our Continuous Integration solution right now, a lot of work to do before digging into this), but will definitely investigate as soon as I got more time: Pros/Cons of each solution, ideas for opt-in/opt/out flag The discussion pointed out by is also interesting regarding whether people check-in their Pods folder and each Pros/Cons of that: definitely interested in each impact the locking feature will have on everybody depending on how the users are using CocoaPods and dealing with the Pods folder, to make everybody happy. The only annoying thing is than each time we open the xcworkspace, Xcode display a dialog warning us that 'Pods project' is locked for editing and you may not be able to save your changes.

Do you want to unlock it?' (of course you can check 'Do not show this message again' before choosing 'Don't Unlock', but still) Same message of course when you try and edit a source file from the Pods folder, but this is exactly what we want so this one is ok. Maybe after chflags -R uchg Pods we may chflags -R nouchg Pods/Pods.xcodeproj to avoid the warning about the Pods.xcodeproj each time we open the workspace? Bad news anyway: chflags does not stick with git pushs. Meaning that if you chflag -R uchg Pods then commit and push the Pods folder, even if it will be locked on your machine, anyone who git clone or git pull the repo won't have the uchg flag on their Pods folder and won't have this folder locked on his/her machine.

Note: By the way, SetFile -a L and chflags uchg have the same result: they both add the uchg UNIX flag to the file. So contrary to what I was thinking in my initial message, the 'Locked' flag set by SetFile is probably not related to the HFS+ filesystem, but uses the UNIX flags feature to set this 'locked' state, the same way chflags does. Emotiv Test Bench Manualidades. • Unfortunately the flags set by chflags are not taken into account by git, even if the core. Siw Download Freeware. filemode variable of your.git/config is set to true (the default). I'm willing to do some work on this, but I don't really understand what the proposed solution is.

The last comment suggests doing a build phase script that locks the Pods folder, but I don't see how that solves the problem. For instance, if someone opens the project, makes changes to files in the Pods folder (since they aren't locked yet), then builds to test them, locking at that point will only prevent future changes, but won't even warn about current changes. Maybe I'm misunderstanding something? I did think of a workaround to this problem based on comments by in, but I'm not sure how to generalize it. Basically I'm planning on adding a post_install hook to our Podfile that creates a git repository in the Pods folder. Then I will add a build script that checks git status in that directory to make sure there are no changes. I'm willing to implement a different solution that either prevents changes or warns about them somewhat early on, but I figured that was a quick and dirty workaround if nothing can be agreed upon here.

Ignoring *.xcodeproj & more importantly Manifest.lock is not a good solution IMHO. This file alongside with Podfile.lock guaranties the local clone integrity and must be commited.

I got a solution on my side using pre-commit hooks which does not ignore anything but prevent a commit to be done if there are modifications (according to git-status) in the Pods/ folder BUT not on the Pods/Manifest.lock file (which normally means that the contents of the Pods folder has been modified manually instead of doing a pod update/ pod install). I'll try to post the code there tomorrow. This solution using the pre-commit hook works great, and we are using it since some time now.

The only drawback is that the git hook has to be installed on every machine on which we want this protection, but I guess we could instead use it as a Build Phase script too like you (in addition to the pre-commit git hook) and it would work likewise and generate an error at compile time in addition to generating it a commit time:). I think you're misunderstanding the purpose of the local Pods git repo,. In this case, it's purely used as an easy way to verify that source inside the Pods folder hasn't changed. If your project is under version control (whether or not you include or ignore the Pods folder), this repo will be nested but independent of the parent project repo. I don't expect anyone to change the Manifest.lock file within Xcode (although I could see someone changing the Pods.xcodeproj in Xcode, but that seems harder to do accidentally). However, important or not, the main reason I'm ignoring those files is because they are generated after the post_install script is run, so my solution won't work without ignoring them.

And yes, erroring as early as possible is important to me. Preventing changes would be ideal, as you originally suggested, but erroring at compile or commit time will work as well. @nickmshelly Yeah I see now that you are creating a GIT repo in the Pods folder, inside the project's own GIT repo.

But this means that the Pods folder can't be commited on the project's repo anymore (a GIT repo B inside a GIT repo A is not itself commited into the repo A by GIT). This breaks things into two separate repos unnecessary. My solution is to not change anything in the structure, ignored files or neither create an inside repo for the Pods folder or whatnot. Just keep everything as it is, and use the following shell test: if [ -z '`git diff --name-only --cached -- '$Pods/Manifest.lock '`' -a '`git diff --name-only --cached -- '$Pods '`' ] then echo 'Error: The '$Pods' folder has been modified manually' exit 1 fi This test checks if Pods was modified while Pods/Manifest.lock was not, which thus detect when the user modified Pods files manually. Here is my complete pre-commit file (simply put it inside.git/hooks/pre-commit for it to work).

This script can obviously be executed as a 'Script Build Phase' inside Xcode too as you suggest, to detect such changes as soon as we compile too. #!/bin/sh #-------------------------------------------- # This pre-commit hook checks that you didn't accidentally modify the CocoaPods' 'Pods/' # folder directly instead of doing a 'pod update'. I think we've been talking past each other because we have our projects set up differently and (at least I) haven't realized it until now. From your solution, it seems like you are including the Pods folder in your project repo, while we ignore our Pods folder in our project repo.

I think that's why I need to create that nested git repository and you don't (I didn't test it, but it seems like git diff wouldn't work on ignored files). Let me know if I misunderstood anything.

One thing that's clear from your comment is that you understand more about both CocoaPods and git.:). We are in the same situation (often happen on private pods we have authored so that it seems like our code, but once used to it we stop making the mistake, and only newcomers are generally concerned) but our pre-commit hook I quoted above solved the problem.

This pre-commit hook is now part of our git template — installed using git config init.template_dir — so it's already setup after a fresh git clone or git init for everyone. If you don't commit your Pods folder you can instead use this a a build phase script as discussed before in this issue. You could use to create your new projects with a custom template, so that all your new projects have their file structure organized the same way (that's what we use here), and liftoff templates can install Script Build Phase for you automatically upon project that creation (e.g. We have one that transform // TODO: comments into warnings) so you can add your script to prevent modification of Pods here to ensure all your projects will have it from the beginning.