The file permission data for the content of synchronized projects between the Windows and Linux® on IBM Z® systems is not
compatible. Therefore, you might change the permissions for the content of the remote synchronized
projects.
About this task
When files are synchronized to Linux on IBM Z, the Git server
uses default permissions. If you are using automatic source lookup support or other
utilities, the files in the synchronized project might require specific permissions that are
different from the default permissions. For example, in some use cases, when you modify a file in
your synchronized project, the permission settings of that file are changed. As a result, automatic source lookup support cannot find the
modified file, and therefore the modified file will not be available for debug sessions by
default.
Procedure
-
On the remote host, create a template directory, and grant read permissions to required users
or user groups.
This directory serves as a template directory when the Eclipse
Parallel Tools Platform (PTP) uses the Git
server to initialize a repository. In these instructions, the directory is named
${TEMPLATE_DIR} for illustration.
- Create the following subdirectories:
- ${TEMPLATE_DIR}/hooks
- ${TEMPLATE_DIR}/info
- In the ${TEMPLATE_DIR}/hooks directory, create the following hook
script files:
- post_merge
- post_commit
- post_update
The following script is a sample
post_commit script for you to
use:
#!/bin/sh
LOG="$GIT_DIR/logs/post-commit.txt"
echo "START POST COMMIT" > $LOG
echo "GIT_DIR $GIT_DIR" >> $LOG
PARENT_DIR="$(dirname "$(realpath $GIT_DIR)")"
echo "PARENT_DIR $PARENT_DIR" >> $LOG
ls -l $PARENT_DIR/* >> $LOG
chmod -R go+rx $PARENT_DIR/
echo "ADDED READ" >> $LOG
ls -l $PARENT_DIR/* >> $LOG
echo "END POST COMMIT" >> $LOG
The sample includes trace statements to troubleshoot the script, which are optional. You also can
use this sample to create your post_merge and post_update
hook scripts by changing the definition of the LOG variable and modifying the trace statements.
- Update each hook to change the permissions of the repository files in the synchronized
project after the merge, commit, or update events. Depending on your scenario, you can grant
different permissions or filter out different file extensions.
- Update your end users' global Git configuration to use the template
directory.
For example, you can add the following line to the common user profile script,
which is applied to each user and is run when your users log in to the system. The user profile
script is usually located in the
/etc/profile
directory.
git config --global init.templatedir ${TEMPLATE_DIR}
This line
updates the user global Git configuration to use the template directory for new project
repositories.
For existing projects that were created before you set up the template
directory, copy the hook scripts from the template directory into the
${project_dir}/.ptp-sync/hooks directory, where
${project_dir} is the location of the synchronized project on Linux on IBM Z. Ensure that your
users have permission to run the hook scripts.
- Test your hook scripts by creating a new synchronized project in the administrator or
user instance of TPF Toolkit. Verify that the scripts are present in the hooks directory. When the changes are saved to
project files in TPF Toolkit, the scripts run on Linux on IBM Z.