├── .filetree ├── .gitignore ├── .travis.yml ├── GitFileTree-MergeDriver.package ├── .filetree ├── GitFileTreeMergeCommandLine.class │ ├── README.md │ ├── class │ │ ├── commandName.st │ │ └── description.st │ ├── instance │ │ ├── activate.st │ │ ├── argumentsAsFileReferences.st │ │ ├── argumentsWithoutOptions.st │ │ ├── mergeMethodProperties.st │ │ ├── mergeProperties.st │ │ ├── mergeVersion.st │ │ └── mergetool.st │ ├── methodProperties.json │ └── properties.json ├── GitFileTreeMergeDriver.class │ ├── README.md │ ├── instance │ │ ├── getTimeStampFrom..st │ │ ├── getVersionInfoFrom..st │ │ ├── getVersionNoFromName..st │ │ ├── mergeClassProperties.with.and..st │ │ ├── mergeClassProperties.with.and.result..st │ │ ├── mergeMethodProperties.with.and..st │ │ ├── mergeMethodProperties.with.and.result..st │ │ ├── mergeVersion.with.and..st │ │ └── mergeVersion.with.and.result..st │ ├── methodProperties.json │ └── properties.json ├── monticello.meta │ ├── categories.st │ ├── initializers.st │ ├── package │ └── version └── properties.json ├── LICENSE ├── Makefile ├── README.md ├── merge └── resources ├── .gitignore ├── branch1 ├── methodProperties.json ├── properties.json └── version ├── branch2 ├── methodProperties.json ├── properties.json └── version ├── git_attributes_for_repository ├── initial ├── methodProperties.json ├── properties.json └── version └── scripts ├── failIfNotSet.sh ├── setup.sh ├── succeedIfSet.sh └── tests.sh /.filetree: -------------------------------------------------------------------------------- 1 | {"packageExtension" : ".package", 2 | "propertyFileExtension" : ".json" } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pharo -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: bash 2 | sudo: true 3 | dist: trusty 4 | 5 | before_script: 6 | - sudo dpkg --add-architecture i386 7 | - sudo apt-get update 8 | - sudo apt-get --yes install libasound2:i386 libasound2-plugins:i386 libcairo2:i386 9 | - sudo apt-get --yes install libssl1.0.0:i386 libfreetype6:i386 10 | - sudo apt-get --yes install libgl1-mesa-glx:i386 11 | 12 | 13 | script: 14 | - make 15 | - bash resources/scripts/tests.sh -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/.filetree: -------------------------------------------------------------------------------- 1 | { 2 | "separateMethodMetaAndSource" : false, 3 | "noMethodMetaData" : true, 4 | "useCypressPropertiesFile" : true 5 | } -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/README.md: -------------------------------------------------------------------------------- 1 | Usage: mergeDriver ( --version | --methodProperties | --properties ) ancestor current other. -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/class/commandName.st: -------------------------------------------------------------------------------- 1 | accessing 2 | commandName 3 | ^ 'mergeDriver' -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/class/description.st: -------------------------------------------------------------------------------- 1 | accessing 2 | description 3 | ^ 'Merges files as triggered by git merge' -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/activate.st: -------------------------------------------------------------------------------- 1 | activation 2 | activate 3 | self activateHelp 4 | ifTrue: [ ^ self ]. 5 | (self hasOption: 'version') 6 | ifTrue: [ self mergeVersion. 7 | ^ self exitSuccess ]. 8 | (self hasOption: 'methodProperties') 9 | ifTrue: [ self mergeMethodProperties. 10 | ^ self exitSuccess ]. 11 | (self hasOption: 'properties') 12 | ifTrue: [ self mergeProperties. 13 | ^ self exitSuccess ]. 14 | (self hasOption: 'mergetool') 15 | ifTrue: [ self mergetool. 16 | ^ self exitSuccess ]. 17 | self printHelp. 18 | ^ self exitFailure -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/argumentsAsFileReferences.st: -------------------------------------------------------------------------------- 1 | activation 2 | argumentsAsFileReferences 3 | | pwd | 4 | pwd := (Smalltalk os environment 5 | at: 'PWD' 6 | ifAbsent: [ Smalltalk os environment at: 'CD' ]) asFileReference. 7 | ^ self argumentsWithoutOptions 8 | collect: [ :each | pwd resolveReference: each asFileReference ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/argumentsWithoutOptions.st: -------------------------------------------------------------------------------- 1 | activation 2 | argumentsWithoutOptions 3 | ^ self arguments 4 | reject: [ :each | 5 | #('--version' '--methodProperties' '--properties' '--mergetool') 6 | includes: each ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/mergeMethodProperties.st: -------------------------------------------------------------------------------- 1 | actions 2 | mergeMethodProperties 3 | | args | 4 | args := self argumentsAsFileReferences. 5 | [ GitFileTreeMergeDriver new mergeMethodProperties: args first with: args second and: args third ] 6 | on: Exception 7 | do: [ :ex | self exitFailure: 'GitFileTree-MergeDriver: ' , ex description ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/mergeProperties.st: -------------------------------------------------------------------------------- 1 | actions 2 | mergeProperties 3 | | args | 4 | args := self argumentsAsFileReferences. 5 | [ GitFileTreeMergeDriver new 6 | mergeClassProperties: args first 7 | with: args second 8 | and: args third ] 9 | on: Exception 10 | do: 11 | [ :ex | self exitFailure: 'GitFileTree-MergeDriver: ' , ex description ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/mergeVersion.st: -------------------------------------------------------------------------------- 1 | actions 2 | mergeVersion 3 | | args | 4 | args := self argumentsAsFileReferences. 5 | [ GitFileTreeMergeDriver new 6 | mergeVersion: args first 7 | with: args second 8 | and: args third ] 9 | on: Exception 10 | do: 11 | [ :ex | self exitFailure: 'GitFileTree-MergeDriver: ' , ex description ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/instance/mergetool.st: -------------------------------------------------------------------------------- 1 | actions 2 | mergetool 3 | | args name | 4 | args := self argumentsAsFileReferences. 5 | name := args fourth basename. 6 | [ | driver | 7 | driver := GitFileTreeMergeDriver new. 8 | name = 'methodProperties.json' 9 | ifTrue: [ driver 10 | mergeMethodProperties: args first 11 | with: args second 12 | and: args third 13 | result: args fourth ]. 14 | name = 'version' 15 | ifTrue: [ driver 16 | mergeVersion: args first 17 | with: args second 18 | and: args third 19 | result: args fourth ] ] 20 | on: Exception 21 | do: 22 | [ :ex | self exitFailure: 'GitFileTree-MergeDriver: ' , ex description ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "instance" : { 3 | "argumentsWithoutOptions" : "ThierryGoubier 3/27/2018 13:34", 4 | "mergetool" : "ThierryGoubier 3/27/2018 13:33", 5 | "argumentsAsFileReferences" : "ThierryGoubier 3/27/2018 13:34", 6 | "activate" : "ThierryGoubier 3/27/2018 14:47", 7 | "mergeMethodProperties" : "ThierryGoubier 3/22/2018 14:53:05", 8 | "mergeProperties" : "ThierryGoubier 3/27/2018 13:34", 9 | "mergeVersion" : "ThierryGoubier 3/27/2018 13:34" 10 | }, 11 | "class" : { 12 | "description" : "HolgerHansPeterFreyther 10/3/2016 14:54:37", 13 | "commandName" : "HolgerHansPeterFreyther 10/3/2016 14:54:37" 14 | } 15 | } -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeCommandLine.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "commentStamp" : "", 3 | "super" : "CommandLineHandler", 4 | "category" : "GitFileTree-MergeDriver", 5 | "classinstvars" : [ ], 6 | "pools" : [ ], 7 | "classvars" : [ ], 8 | "instvars" : [ ], 9 | "name" : "GitFileTreeMergeCommandLine", 10 | "type" : "normal" 11 | } -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/README.md: -------------------------------------------------------------------------------- 1 | A GitFileTreeMergeDriver handles the merge of FileTree metadata: version and methodProperties. 2 | 3 | Use the author names of the two files, if any is required. 4 | 5 | Fail if we detect some incoherencies: incoherencies require by hand manipulations, and, for that, we need someone to fire up a GUI tool (i.e. a git merge-tool written in Pharo) -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/getTimeStampFrom..st: -------------------------------------------------------------------------------- 1 | private 2 | getTimeStampFrom: aMethodStringTimeStamp 3 | aMethodStringTimeStamp isEmpty 4 | ifTrue: [ ^ DateAndTime epoch ]. 5 | ^ [ 6 | | stream | 7 | stream := aMethodStringTimeStamp readStream. 8 | stream 9 | skipSeparators; 10 | skipTo: Character space. 11 | (stream peekFor: $() 12 | ifTrue: [ 13 | stream 14 | skipTo: $); 15 | skipTo: Character space ]. 16 | DateAndTime readSeparateDateAndTimeFrom: stream ] 17 | on: Exception 18 | do: [ DateAndTime epoch ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/getVersionInfoFrom..st: -------------------------------------------------------------------------------- 1 | private 2 | getVersionInfoFrom: aVersionFile 3 | | mcInfo | 4 | aVersionFile 5 | readStreamDo: [ :aStream | 6 | mcInfo := MCWorkingCopy 7 | infoFromDictionary: (MCFileTreeAbstractReader new associate: (MCScanner scan: aStream)) 8 | cache: Dictionary new ]. 9 | ^ mcInfo -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/getVersionNoFromName..st: -------------------------------------------------------------------------------- 1 | private 2 | getVersionNoFromName: aName 3 | | versionNo | 4 | versionNo := (aName copyAfterLast: $-) copyAfterLast: $.. 5 | (versionNo notEmpty and: [ versionNo allSatisfy: [ :each | each isDigit ] ]) 6 | ifTrue: [ versionNo := versionNo asNumber ] 7 | ifFalse: [ versionNo := 0 ]. 8 | ^ versionNo -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/mergeClassProperties.with.and..st: -------------------------------------------------------------------------------- 1 | merge-properties 2 | mergeClassProperties: ancestor with: current and: other 3 | ^self mergeClassProperties: ancestor with: current and: other result: current -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/mergeClassProperties.with.and.result..st: -------------------------------------------------------------------------------- 1 | merge-properties 2 | mergeClassProperties: ancestor with: current and: other result: result 3 | "We should do a three way merge here. At the moment, the idea of using the superset of all variable names is probably a safe bet." 4 | 5 | | currentProperties otherProperties mergedProperties | 6 | current 7 | readStreamDo: [ :s | currentProperties := STON fromStream: s ]. 8 | other readStreamDo: [ :s | otherProperties := STON fromStream: s ]. 9 | mergedProperties := currentProperties copy. 10 | #(#classinstvars #classvars #instvars #pools) 11 | do: [ :key | 12 | (currentProperties includesKey: key) 13 | ifTrue: [ mergedProperties 14 | at: key 15 | put: 16 | (Set new 17 | addAll: (currentProperties at: key); 18 | addAll: (otherProperties at: key); 19 | asArray) ] ]. 20 | #(#commentStamp) 21 | do: [ :key | 22 | (otherProperties at: key ifAbsent: [ ]) 23 | ifNotNil: [ :tsB | mergedProperties at: key put: tsB ] ]. 24 | #(#category #super #type #name) 25 | do: 26 | [ :key | self assert: (currentProperties at: key) = (otherProperties at: key) ]. 27 | result exists 28 | ifTrue: [ result delete ]. 29 | result 30 | writeStreamDo: [ :s | 31 | s 32 | nextPutAll: 33 | (String 34 | streamContents: [ :s2 | STON put: mergedProperties asJsonOnStreamPretty: s2 ]) 35 | withUnixLineEndings ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/mergeMethodProperties.with.and..st: -------------------------------------------------------------------------------- 1 | merge-properties 2 | mergeMethodProperties: ancestor with: current and: other 3 | ^self mergeMethodProperties: ancestor with: current and: other result: current -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/mergeMethodProperties.with.and.result..st: -------------------------------------------------------------------------------- 1 | merge-properties 2 | mergeMethodProperties: ancestor with: current and: other result: result 3 | "Method properties are Json (or ston?) data. A two way merge is good enough since we have timestamps on all entries." 4 | 5 | | otherProperties currentProperties mergedProperties | 6 | other readStreamDo: [ :s | otherProperties := STON fromStream: s ]. 7 | current 8 | readStreamDo: [ :s | currentProperties := STON fromStream: s ]. 9 | mergedProperties := currentProperties copy. 10 | #(#class #instance) 11 | do: [ :mainKey | 12 | (currentProperties at: mainKey) 13 | keysAndValuesDo: [ :key :valueA | 14 | ((otherProperties at: mainKey) at: key ifAbsent: [ ]) 15 | ifNotNil: [ :valueB | 16 | (self getTimeStampFrom: valueB) > (self getTimeStampFrom: valueA) 17 | ifTrue: [ (mergedProperties at: mainKey) at: key put: valueB ] ] ]. 18 | (otherProperties at: mainKey) 19 | keysAndValuesDo: [ :key :valueB | 20 | (currentProperties at: mainKey) 21 | at: key 22 | ifAbsent: [ (mergedProperties at: mainKey) at: key put: valueB ] ] ]. "Write propertiesMerged." 23 | result exists 24 | ifTrue: [ result delete ]. 25 | result 26 | writeStreamDo: [ :s | 27 | s 28 | nextPutAll: 29 | (String 30 | streamContents: [ :s2 | STON put: mergedProperties asJsonOnStreamPretty: s2 ]) 31 | withUnixLineEndings ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/mergeVersion.with.and..st: -------------------------------------------------------------------------------- 1 | merge-version 2 | mergeVersion: ancestor with: current and: other 3 | ^self mergeVersion: ancestor with: current and: other result: current -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/instance/mergeVersion.with.and.result..st: -------------------------------------------------------------------------------- 1 | merge-version 2 | mergeVersion: ancestor with: current and: other result: result 3 | "Looks like a two way merge, but MC will do a proper three way merge and find the common ancestor." 4 | 5 | | mcCurrentInfo mcOtherInfo mcMergedInfo ancestry name versionA versionB versionMerged infoWriter | 6 | mcCurrentInfo := self getVersionInfoFrom: current. 7 | mcOtherInfo := self getVersionInfoFrom: other. 8 | ancestry := MCWorkingAncestry new 9 | addAncestor: mcCurrentInfo; 10 | addAncestor: mcOtherInfo. "Now I need to generate a new name." 11 | versionA := self getVersionNoFromName: (mcCurrentInfo name). 12 | name := mcCurrentInfo name copyUpToLast: $-. 13 | versionB := self getVersionNoFromName: (mcOtherInfo name). 14 | versionMerged := (versionA max: versionB) + 1. 15 | mcMergedInfo := MCVersionInfo 16 | name: name , '-' , mcCurrentInfo author , '.' , versionMerged printString 17 | id: UUID new 18 | message: 'merged by GitFileTree-MergeDriver' 19 | date: Date today 20 | time: Time now 21 | author: mcCurrentInfo author 22 | ancestors: ancestry ancestors asArray 23 | stepChildren: ancestry stepChildren asArray. 24 | infoWriter := MCFileTreeVersionInfoWriter new. 25 | result exists 26 | ifTrue: [ result delete ]. 27 | result 28 | writeStreamDo: [ :fileStream | 29 | infoWriter stream: fileStream. 30 | infoWriter writeVersionInfo: mcMergedInfo ] -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "instance" : { 3 | "getTimeStampFrom:" : "HolgerHansPeterFreyther 10/3/2016 14:54:37", 4 | "mergeMethodProperties:with:and:" : "ThierryGoubier 3/22/2018 14:53:05", 5 | "mergeClassProperties:with:and:" : "HolgerHansPeterFreyther 10/3/2016 14:54:37", 6 | "mergeMethodProperties:with:and:result:" : "ThierryGoubier 3/27/2018 15:03", 7 | "mergeVersion:with:and:" : "HolgerHansPeterFreyther 10/3/2016 14:54:37", 8 | "mergeVersion:with:and:result:" : "HolgerHansPeterFreyther 10/3/2016 14:54:37", 9 | "mergeClassProperties:with:and:result:" : "ThierryGoubier 3/27/2018 15:03", 10 | "getVersionInfoFrom:" : "HolgerHansPeterFreyther 10/3/2016 14:54:37", 11 | "getVersionNoFromName:" : "HolgerHansPeterFreyther 10/3/2016 14:54:37" 12 | }, 13 | "class" : { } 14 | } -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/GitFileTreeMergeDriver.class/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "commentStamp" : "", 3 | "super" : "Object", 4 | "category" : "GitFileTree-MergeDriver", 5 | "classinstvars" : [ ], 6 | "pools" : [ ], 7 | "classvars" : [ ], 8 | "instvars" : [ ], 9 | "name" : "GitFileTreeMergeDriver", 10 | "type" : "normal" 11 | } -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/monticello.meta/categories.st: -------------------------------------------------------------------------------- 1 | SystemOrganization addCategory: #'GitFileTree-MergeDriver'! 2 | -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/monticello.meta/initializers.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThierryGoubier/GitFileTree-MergeDriver/1209ec49cf2ad2b9c09f26ec0943bf27393c873a/GitFileTree-MergeDriver.package/monticello.meta/initializers.st -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/monticello.meta/package: -------------------------------------------------------------------------------- 1 | (name 'GitFileTree-MergeDriver') -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/monticello.meta/version: -------------------------------------------------------------------------------- 1 | (name 'GitFileTree-MergeDriver-ThierryGoubier.25' message 'ensure unixLineEndings' id '4bcc5b44-c624-0d00-8571-a90e04ff1d57' date '27 March 2018' time '3:04:26.230094 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.24' message 'test' id '47c029f6-c524-0d00-8570-fab504ff1d57' date '27 March 2018' time '2:42:34.327646 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.23' message 'test again' id '80fc46f3-c524-0d00-856f-9d9204ff1d57' date '27 March 2018' time '2:41:45.914555 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.22' message 'again' id '754f86ed-c524-0d00-856e-477604ff1d57' date '27 March 2018' time '2:40:09.398448 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.21' message 'again' id '13e483e7-c524-0d00-856d-056104ff1d57' date '27 March 2018' time '2:38:28.576986 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.20' message 'again' id '98126ddf-c524-0d00-856c-107304ff1d57' date '27 March 2018' time '2:36:12.863642 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.19' message 'error' id '8c3effd6-c524-0d00-856b-047204ff1d57' date '27 March 2018' time '2:33:51.448029 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.18' message 'again' id '70938bd3-c524-0d00-856a-cd6a04ff1d57' date '27 March 2018' time '2:32:53.536144 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.17' message 'again' id '1f60dbd0-c524-0d00-8569-9a9104ff1d57' date '27 March 2018' time '2:32:08.434042 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.16' message 'again' id 'b6bf45cb-c524-0d00-8568-d33204ff1d57' date '27 March 2018' time '2:30:34.742087 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.15' message 'again' id '78f02ac0-c524-0d00-8567-c24f04ff1d57' date '27 March 2018' time '2:27:28.435753 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.14' message 'again' id 'c36f22be-c524-0d00-8566-d4d804ff1d57' date '27 March 2018' time '2:26:54.324193 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.13' message 'again' id '7bbf1eb8-c524-0d00-8565-9e4504ff1d57' date '27 March 2018' time '2:25:13.421911 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.12' message 'testing again' id '08eb7db0-c524-0d00-8564-81a104ff1d57' date '27 March 2018' time '2:23:05.438318 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.11' message 'Again' id 'e11f2891-c524-0d00-8563-58a804ff1d57' date '27 March 2018' time '2:14:19.722017 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.10' message 'Add message on stderr' id 'd91b2f8b-c524-0d00-8562-ced604ff1d57' date '27 March 2018' time '2:12:39.51661 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.9' message 'Adding some output' id '2d85bb42-c524-0d00-8561-001204ff1d57' date '27 March 2018' time '1:52:23.981803 pm' author 'ThierryGoubier' ancestors ((name 'GitFileTree-MergeDriver-ThierryGoubier.8' message 'Use STON for json data 2 | ' id '26096195-5f38-53d7-8d92-46ac0a93b5bf' date '22 March 2018' time '2:53:05 pm' author 'ThierryGoubier' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /GitFileTree-MergeDriver.package/properties.json: -------------------------------------------------------------------------------- 1 | { } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Thierry Goubier 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #A makefile to build the merge driver 2 | 3 | # Use the PHARO_VM environment variable to indicate where to find the 4 | # Pharo VM. If the environment variable is not set, set it to a newly 5 | # downloaded VM. 6 | PHARO_VM ?= 'pharo/pharo' 7 | 8 | pharo/Pharo.image: 9 | mkdir pharo 10 | cd pharo; wget -O- get.pharo.org/61-minimal | bash 11 | cd pharo; wget -O- get.pharo.org/vmI61 | bash 12 | $(PHARO_VM) pharo/Pharo.image --no-default-preferences eval --save Gofer new url: \'http://ss3.gemstone.com/ss/STON\'\; package: \'STON-Core\'\; load 13 | $(PHARO_VM) pharo/Pharo.image --no-default-preferences eval --save Gofer new url: \'http://source.squeakfoundation.org/FFI\'\; package: \'FFI-Pools\'\; load 14 | $(PHARO_VM) pharo/Pharo.image --no-default-preferences eval --save Gofer new url: \'http://smalltalkhub.com/mc/Pharo/FFI-NB/main/\'\; package: \'FFI-Kernel\'\; package: \'Alien\'\; package: \'UnifiedFFI\'\; load 15 | $(PHARO_VM) pharo/Pharo.image --no-default-preferences eval --save Gofer new url: \'http://smalltalkhub.com/mc/Pharo/Pharo60/main/\'\; package: \'System-OSEnvironments\'\; load 16 | $(PHARO_VM) pharo/Pharo.image --no-default-preferences eval --save Gofer new url: \'http://smalltalkhub.com/mc/ThierryGoubier/Alt30/main/\'\; package: \'GitFileTree-MergeDriver\'\; load 17 | git config --global merge.mcVersion.driver "`pwd`/merge --version %O %A %B" 18 | git config --global merge.mcMethodProperties.name "GitFileTree MergeDriver for Monticello" 19 | git config --global merge.mcMethodProperties.driver "`pwd`/merge --methodProperties %O %A %B" 20 | git config --global merge.mcProperties.name "GitFileTree MergeDriver for Monticello" 21 | git config --global merge.mcProperties.driver "`pwd`/merge --properties %O %A %B" 22 | git config --global mergetool.mcmerge.cmd "`pwd`/merge --mergetool \$$BASE \$$LOCAL \$$REMOTE \$$MERGED" 23 | 24 | 25 | all: pharo/Pharo.image 26 | 27 | clean: 28 | rm -rf pharo 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GitFileTree-MergeDriver 2 | ======================= 3 | 4 | [![Build Status](https://travis-ci.org/ThierryGoubier/GitFileTree-MergeDriver.svg?branch=master)](https://travis-ci.org/ThierryGoubier/GitFileTree-MergeDriver) 5 | 6 | This is a merge driver for git. It handles merging conflict-prone files in FileTree, which are: monticello.meta/version, methodProperties.json and properties.json. 7 | 8 | How to make it work: 9 | 10 | Clone this repository (or get from here the Makefile and the merge script and put them in a folder). Run the following command in that folder: 11 | 12 | ``` 13 | $ make 14 | ``` 15 | 16 | In your global git config file (typically in `~/.gitconfig`), you should now have something like the following : 17 | 18 | ``` 19 | [merge "mcVersion"] 20 | name = GitFileTree MergeDriver for Monticello 21 | driver = pathToGitFileTree-MergeDriver/merge --version %O %A %B 22 | [merge "mcMethodProperties"] 23 | name = GitFileTree MergeDriver for Monticello 24 | driver = pathToGitFileTree-MergeDriver/merge --methodProperties %O %A %B 25 | [merge "mcProperties"] 26 | name = GitFileTree MergeDriver for Monticello 27 | driver = pathToGitFileTree-MergeDriver/merge --properties %O %A %B 28 | [mergetool "mcmerge"] 29 | cmd = pathToGitFileTree-MergeDriver/merge --mergetool $BASE $LOCAL $REMOTE $MERGED 30 | ``` 31 | 32 | You must now tell git which merge tool to use for which kind of file. This is done in a special attributes file that can be located in many different places (read `GITATTRIBUTES(5)` man page). For example, in the main repository containing your FileTree packages (for example, top level or `repository/`), add a `.gitattributes` file containing the following lines: 33 | 34 | ``` 35 | *.package/monticello.meta/version merge=mcVersion 36 | *.package/*.class/methodProperties.json merge=mcMethodProperties 37 | *.package/*.class/properties.json merge=mcProperties 38 | *.package/*.extension/methodProperties.json merge=mcMethodProperties 39 | *.package/*.extension/properties.json merge=mcProperties 40 | ``` 41 | 42 | Now, you should be able to merge with git and have a minimum of conflicts. 43 | 44 | Note that the merge driver will, under some cases, hide conflicts (or resolve them automatically) when a class definition was changed between branches (addition or removal of an instance variable). If you want those conflicts to appear, then you should remove the following line from your `.gitattributes` file: 45 | ``` 46 | *.package/*.class/properties.json merge=mcProperties 47 | ``` 48 | 49 | Note also that some git commands, such as `git cherry-pick` and `git rebase` do not trigger the use of the merge driver. For 50 | those cases, the merge driver is also registered as a merge tool, and can be used after one of those commands if it creates 51 | conflicts on metadata by using `git merge-tool --tool=mcmerge`. 52 | 53 | As an example of how the merge driver works, this is the normal output when merging under git with FileTree (or GitFileTree) packages (with two versions of the SmaCC tutorial in each branch) : 54 | ``` 55 | $ git merge aBranch 56 | Auto-merging SmaCC-Tutorial.package/monticello.meta/version 57 | CONFLICT (content): Merge conflict in SmaCC-Tutorial.package/monticello.meta/version 58 | Auto-merging SmaCC-Tutorial.package/CalculatorParser.class/methodProperties.json 59 | CONFLICT (content): Merge conflict in SmaCC-Tutorial.package/CalculatorParser.class/methodProperties.json 60 | Auto-merging SmaCC-Tutorial.package/ASTFunctionNode.class/methodProperties.json 61 | CONFLICT (add/add): Merge conflict in SmaCC-Tutorial.package/ASTFunctionNode.class/methodProperties.json 62 | Auto-merging SmaCC-Tutorial.package/ASTFunctionNode.class/instance/compositeTokenVariables.st 63 | CONFLICT (add/add): Merge conflict in SmaCC-Tutorial.package/ASTFunctionNode.class/instance/compositeTokenVariables.st 64 | Auto-merging SmaCC-Tutorial.package/ASTExpressionNode.class/methodProperties.json 65 | CONFLICT (content): Merge conflict in SmaCC-Tutorial.package/ASTExpressionNode.class/methodProperties.json 66 | Automatic merge failed; fix conflicts and then commit the result. 67 | ``` 68 | We have conflicts with monticello.meta/version, three methodProperties.json files, and a .st file 69 | 70 | After you followed above setup process, you should get the following output for the same merge: 71 | 72 | ``` 73 | $ git reset --hard 74 | HEAD is now at 4eadb6c Resaving to make sure we have a clean version file 75 | $ git merge aBranch 76 | Auto-merging SmaCC-Tutorial.package/monticello.meta/version 77 | Auto-merging SmaCC-Tutorial.package/CalculatorParser.class/methodProperties.json 78 | Auto-merging SmaCC-Tutorial.package/ASTFunctionNode.class/methodProperties.json 79 | Auto-merging SmaCC-Tutorial.package/ASTFunctionNode.class/instance/compositeTokenVariables.st 80 | CONFLICT (add/add): Merge conflict in SmaCC-Tutorial.package/ASTFunctionNode.class/instance/compositeTokenVariables.st 81 | Auto-merging SmaCC-Tutorial.package/ASTExpressionNode.class/methodProperties.json 82 | Automatic merge failed; fix conflicts and then commit the result. 83 | ``` 84 | 85 | See: the version file and the methodProperties.json file have been merged without conflict; and, when looking inside, the version file has the two branches versions as ancestors, and a common ancestor as well: 86 | 87 | ```smalltalk 88 | ( 89 | name 'SmaCC-Tutorial-ThierryGoubier.4' 90 | message 'merged by GitFileTree-MergeDriver' 91 | id 'f69f6d1f-d4d2-4da9-b755-e26f6432c980' 92 | date '29 April 2014' time '4:37:32.372857 pm' 93 | author 'ThierryGoubier' 94 | ancestors ( 95 | ( 96 | name 'SmaCC-Tutorial-ThierryGoubier.3' 97 | message 'Resaving to make sure we have a clean version file' 98 | id '911c2501-29ce-4a78-8596-51e84fdbb7fb' 99 | date '27 April 2014' time '10:21:24.06832 pm' 100 | author 'ThierryGoubier' 101 | ancestors ( 102 | ( 103 | name 'SmaCC-Tutorial-ThierryGoubier.2' 104 | message '3ème version' 105 | id 'fa358cff-9ffa-5db4-b04a-f88a0c3fc468' 106 | date '27 April 2014' time '10:08:59 pm' 107 | author 'ThierryGoubier' 108 | ancestors ( 109 | ( 110 | name 'SmaCC-Tutorial-ThierryGoubier.1' 111 | message 'First save.' 112 | id 'e198578e-77db-5e80-b4b5-70e05de13344' 113 | date '27 April 2014' time '10:07:06 pm' 114 | author 'ThierryGoubier' 115 | ancestors () 116 | stepChildren ())) 117 | stepChildren ())) 118 | stepChildren ()) 119 | ( 120 | name 'SmaCC-Tutorial-ThierryGoubier.3' 121 | message 'Save again to get a clean version file' 122 | id 'e48d00a4-84cc-406d-b0d5-2382deb1f0e4' 123 | date '29 April 2014' time '2:25:09.900645 pm' 124 | author 'ThierryGoubier' 125 | ancestors ( 126 | ( 127 | name 'SmaCC-Tutorial-ThierryGoubier.2' 128 | message '2nd version' 129 | id '2e7ebe53-49bf-5f8b-b9ac-7e2da65a2761' 130 | date '27 April 2014' time '10:08:01 pm' 131 | author 'ThierryGoubier' 132 | ancestors ( 133 | (id 'e198578e-77db-5e80-b4b5-70e05de13344')) 134 | stepChildren ())) 135 | stepChildren ())) 136 | stepChildren ()) 137 | ``` 138 | (Formatted for an easier reading). Note how id 'e198578e-77db-5e80-b4b5-70e05de13344' is the common ancestor to both branches, and how GitFileTree-MergeDriver has created a proper merge in MC during the git merge. 139 | 140 | This is especially important for `FileTree` and `github://` Metacello Urls, since both rely on a correct version file to work. GitFileTree is less dependent in correct results; just the lack of conflicts is a huge boost. 141 | 142 | How does this works? 143 | -------------------- 144 | 145 | From reading the git man pages, and particularly gitattributes(5), one can note that git has a huge amount of customisation available for different file types, for specific operations: diff, merge, and merge conflict resolutions. 146 | 147 | When conflicts occurs, they do appear when git attempts three-way merges between the current version of a file, the version being merged, and the common ancestor. Git has a strategy for doing the merge if the file is considered as text (three way per line merge), and another strategy if the file is considered binary (keep the current one?); git may also do more merges between ancestors to create the common ancestor. For merging, git delegates to a merge driver and can give him up to four parameters: the current file, the _other_ (from the commit to merge), the _ancestor_, and eventually the length of the conflict markers. 148 | 149 | From gitattributes, we see that it is possible to define a merge driver, as an external command (in gitconfig), and to associate it to a file (in the attributes). 150 | 151 | So, this is what the GitFileTree-MergeDriver uses: 152 | - version and .json files in FileTree are in fact binary data; git however consider them as text files and tries to merge them as text, which is wrong and creates conflicts. 153 | - Take Monticello and FileTree code to be able to merge two version files (FileTree for reading the version file as a MCVersionInfo, Monticello for creating a new version merging both branches, FileTree for writing back the version file) 154 | - Use FileTree json support for reading properties files, choosing an ad-hoc strategy for merging the two versions. 155 | - Merging method properties is done by timestamp comparison, with a fall back on epoch if the timestamp can't be parsed (which happens). 156 | - Merging class properties (class definition) is done by merging sets of attributes and failing in other cases. 157 | 158 | And, by being defined as a merge driver for git and associated with those files, GitFileTree-MergeDriver is called by git on each merge, with the three files: _current_, _other_ and _ancestor_. A correct merge is written back into _current_, a failure to merge is a non-zero return status and git will tell us it is a conflict. 159 | 160 | Not all conflicts can be resolved that way. In the resolution of conflicts, we have yet another way of customizing git behavior, by using a specific merge tool for interactive conflict resolution. For example, a common merge will have the following process: 161 | 162 | ``` 163 | $ git merge aCommit 164 | ... 165 | Automatic merge failed; fix conflicts and then commit the result. 166 | $ git merge-tool 167 | ... 168 | ``` 169 | 170 | The git merge-tool command will call an external GUI tool, such as meld, to let us resolve the conflict by hand by selecting parts of the two versions of the file (_current_ and _other_, with usually _ancestor_ also displayed) to keep or reject. 171 | 172 | However, usual tools are not too good at merging .st files :) or version files the merge driver hasn't managed to merge, so the next step after the merge driver would be to implement a merge tool in Smalltalk which knows how to: 173 | - Interactively let us merge standard text files 174 | - Handle .st files a bit better (by putting them, for example, in their package context?) 175 | - Handle conflicting version and properties file as well. 176 | 177 | This will be for the future :) 178 | -------------------------------------------------------------------------------- /merge: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # some magic to find out the real location of this script dealing with symlinks 4 | DIR=`readlink "$0"` || DIR="$0"; 5 | DIR=`dirname "$DIR"`; 6 | # Get the true directory name by cd-ing into it, pwd-it and cd-ing back. 7 | # readlink would allow to do that directly, but only on certain platforms 8 | # (linux, but not Mac OS X) 9 | cd "$DIR" 10 | DIR=`pwd` 11 | cd - > /dev/null 12 | # disable parameter expansion to forward all arguments unprocessed to the VM 13 | set -f 14 | # Use the PHARO_VM environment variable to indicate where to find the 15 | # Pharo VM. If the environment variable is not set, set it to a newly 16 | # downloaded VM. 17 | PHARO_VM=${PHARO_VM:-$DIR/pharo/pharo} 18 | 19 | # run the VM and pass along all arguments as is 20 | "$PHARO_VM" "$DIR"/pharo/Pharo.image --no-default-preferences mergeDriver "$@" 21 | -------------------------------------------------------------------------------- /resources/.gitignore: -------------------------------------------------------------------------------- 1 | test/ 2 | -------------------------------------------------------------------------------- /resources/branch1/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "initialize" : "ThierryGoubier 5/6/2014 14:26:18" } } 6 | -------------------------------------------------------------------------------- /resources/branch1/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "LightsOut", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | "mouseAction", 10 | "expression" ], 11 | "name" : "LOCell", 12 | "pools" : [ 13 | ], 14 | "super" : "SimpleSwitchMorph", 15 | "type" : "normal" } 16 | -------------------------------------------------------------------------------- /resources/branch1/version: -------------------------------------------------------------------------------- 1 | (name 'LightsOut-ThierryGoubier.6' message 'Removed cellsPerSide' id 'd3840a87-e646-4e1c-a296-d2fda0b0a6bf' date '11 July 2014' time '10:01:13.592843 am' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.5' message 'Added a comment.' id 'e59c91bb-7414-4552-8da8-b3877b194408' date '11 July 2014' time '9:53:00.439071 am' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.4' message 'Adding two more methods' id '2b9cf10a-43f4-4d40-8dc6-8e332303d640' date '9 May 2014' time '11:54:55.173005 am' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.3' message 'Added BorderedMorph 2 | ' id 'e501cdca-8b02-5a6e-b253-e30d99966ff5' date '6 May 2014' time '2:26:18 pm' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.2' message 'initialize 3 | ' id 'acd098d8-091d-5530-ad0b-7488c0994da5' date '6 May 2014' time '2:16:07 pm' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.1' message 'First version 4 | ' id '3f7d0d1a-6e57-5fc3-b177-ec7149c70a5f' date '6 May 2014' time '2:14:32 pm' author 'ThierryGoubier' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /resources/branch2/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "initialize" : "ThierryGoubier 5/6/2014 14:24" } } 6 | -------------------------------------------------------------------------------- /resources/branch2/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "LightsOut", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | "mouseAction", 10 | "operator" ], 11 | "name" : "LOCell", 12 | "pools" : [ 13 | ], 14 | "super" : "SimpleSwitchMorph", 15 | "type" : "normal" } 16 | -------------------------------------------------------------------------------- /resources/branch2/version: -------------------------------------------------------------------------------- 1 | (name 'LightsOut-ThierryGoubier.3' message 'LOCell initialize-release protocol' id 'df71e399-0284-4fd9-878b-49c2c3206f57' date '6 May 2014' time '2:35:25.964876 pm' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.2' message 'initialize 2 | ' id 'acd098d8-091d-5530-ad0b-7488c0994da5' date '6 May 2014' time '2:16:07 pm' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.1' message 'First version 3 | ' id '3f7d0d1a-6e57-5fc3-b177-ec7149c70a5f' date '6 May 2014' time '2:14:32 pm' author 'ThierryGoubier' ancestors () stepChildren ())) stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /resources/git_attributes_for_repository: -------------------------------------------------------------------------------- 1 | version merge=mcVersion 2 | methodProperties.json merge=mcMethodProperties 3 | properties.json merge=mcProperties 4 | -------------------------------------------------------------------------------- /resources/initial/methodProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "class" : { 3 | }, 4 | "instance" : { 5 | "initialize" : "ThierryGoubier 5/6/2014 14:15" } } 6 | -------------------------------------------------------------------------------- /resources/initial/properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "category" : "LightsOut", 3 | "classinstvars" : [ 4 | ], 5 | "classvars" : [ 6 | ], 7 | "commentStamp" : "", 8 | "instvars" : [ 9 | "mouseAction" ], 10 | "name" : "LOCell", 11 | "pools" : [ 12 | ], 13 | "super" : "SimpleSwitchMorph", 14 | "type" : "normal" } 15 | -------------------------------------------------------------------------------- /resources/initial/version: -------------------------------------------------------------------------------- 1 | (name 'LightsOut-ThierryGoubier.2' message 'initialize' id '8abfcf9f-9e6d-4e0b-be3e-7bc151341263' date '6 May 2014' time '2:16:07.234786 pm' author 'ThierryGoubier' ancestors ((name 'LightsOut-ThierryGoubier.1' message 'First version' id '4358fce0-ec79-4ef2-8818-ef299d943824' date '6 May 2014' time '2:14:31.690668 pm' author 'ThierryGoubier' ancestors () stepChildren ())) stepChildren ()) -------------------------------------------------------------------------------- /resources/scripts/failIfNotSet.sh: -------------------------------------------------------------------------------- 1 | 2 | (cd testMergeDriver; git checkout branch2; git merge --no-edit branch1) 3 | if [ $? -eq 0 ]; then 4 | echo "git merge should have failed" 5 | exit_code=1 6 | else 7 | exit_code=0 8 | fi 9 | rm -rf testMergeDriver 10 | exit $exit_code 11 | -------------------------------------------------------------------------------- /resources/scripts/setup.sh: -------------------------------------------------------------------------------- 1 | mkdir testMergeDriver 2 | cd testMergeDriver 3 | git init 4 | cp ../../initial/* . 5 | git add * 6 | git commit -a -m "0:0" 7 | git checkout -b branch1 8 | cp ../../branch1/* . 9 | git add * 10 | git commit -a -m "0:1" 11 | git checkout master 12 | git checkout -b branch2 13 | cp ../../branch2/* . 14 | git add * 15 | git commit -a -m "0:2" 16 | -------------------------------------------------------------------------------- /resources/scripts/succeedIfSet.sh: -------------------------------------------------------------------------------- 1 | cp ../git_attributes_for_repository testMergeDriver/.gitattributes 2 | (cd testMergeDriver; git checkout branch2; git merge --no-edit branch1) 3 | if [ $? -eq 0 ]; then 4 | exit_code=0 5 | else 6 | echo "git merge should not have failed" 7 | exit_code=1 8 | fi 9 | rm -rf testMergeDriver 10 | exit $exit_code 11 | -------------------------------------------------------------------------------- /resources/scripts/tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" && pwd )" 3 | echo $DIR 4 | cd $DIR 5 | mkdir ../test 6 | tests_status=0 7 | (cd ../test; ../scripts/setup.sh; ../scripts/failIfNotSet.sh) 8 | if [ $? -ne 0 ]; then 9 | tests_status=1 10 | fi 11 | (cd ../test; ../scripts/setup.sh; ../scripts/succeedIfSet.sh) 12 | if [ $? -ne 0 ]; then 13 | tests_status=1 14 | fi 15 | exit $tests_status --------------------------------------------------------------------------------