AnsweredAssumed Answered

How to avoid workflow conflicts in git repository

Question asked by Derick van Niekerk on Nov 29, 2016

We are managing our codebase in a git repository. From suggestions from several forums and the official SugarCRM developer docs, I have a .gitignore as follows:



## SugarCRM
# Adapted from Sugar docs at

# Ignore custom .htaccess stuff.


# Ignore the cache directory completely.


# Ignore some files and directories from the custom directory.


# Custom configuration should also be ignored.


# The silent upgrade scripts aren't needed.


# Log files can safely be ignored.


# Ignore the new upload directories.


# IDE project files


For the most part, this works great. However I get nasty conflicts in /custom/modules/<module>/workflow/workflow.php every time I try to merge feature branches. It seems that these workflow files change every time a repair is run. Deleting the workflow files breaks the application, however. The conflict is always just a guid changing in the code, nothing else changes:


<<<<<<< HEAD
if (!isset($triggeredWorkflows['de4dd2cb_f57d_9c51_43c5_583c8b4841aa'])){
$triggeredWorkflows['de4dd2cb_f57d_9c51_43c5_583c8b4841aa'] = true;
if (!isset($triggeredWorkflows['6a858297_9fa0_aac7_f08c_583b50cc7829'])){
$triggeredWorkflows['6a858297_9fa0_aac7_f08c_583b50cc7829'] = true;
>>>>>>> master

Usually there are a few dozen instances of this.


There is usually also a conflict in /custom/workflow/plugins/plugin_list.php :

<<<<<<< HEAD
// created: 2016-11-29 14:56:00

// created: 2016-11-30 09:50:00
>>>>>>> master


Ideally these files should be in .gitignore, but it causes sugar to break if they are.


How can I manage this within the repository so I don't get these conflicts. It's easy to resolve, but very time consuming.