diff options
author | Matt Raybuck <mraybuc@us.ibm.com> | 2018-09-07 08:59:11 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-09-11 15:18:41 -0500 |
commit | 9b59223389e768975850f0c8bf44d7a2c7135fcf (patch) | |
tree | 59198864bab536df715ca02163be5ba3cb0e06aa /src/build/tools/insert_newlines.xsl | |
parent | 60d11f6f5f0720d2740cf990351c25d0f6bcd9c7 (diff) | |
download | talos-hostboot-9b59223389e768975850f0c8bf44d7a2c7135fcf.tar.gz talos-hostboot-9b59223389e768975850f0c8bf44d7a2c7135fcf.zip |
Add commit hook to sort the attribute xml files
When xml files were changed it would produce an instant merge
conflict. To resolve this issue a pre-commit hook was added that
will sort the xml attributes by id preventing instant conflicts.
Change-Id: Iffea1abfab459c542fe4f961616e0b5b4062804f
RTC: 180350
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65894
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/tools/insert_newlines.xsl')
-rw-r--r-- | src/build/tools/insert_newlines.xsl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/build/tools/insert_newlines.xsl b/src/build/tools/insert_newlines.xsl new file mode 100644 index 000000000..637c22b57 --- /dev/null +++ b/src/build/tools/insert_newlines.xsl @@ -0,0 +1,40 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/build/tools/insert_newlines.xsl $ --> +<!-- --> +<!-- OpenPOWER HostBoot Project --> +<!-- --> +<!-- Contributors Listed Below - COPYRIGHT 2018 --> +<!-- [+] International Business Machines Corp. --> +<!-- --> +<!-- --> +<!-- Licensed under the Apache License, Version 2.0 (the "License"); --> +<!-- you may not use this file except in compliance with the License. --> +<!-- You may obtain a copy of the License at --> +<!-- --> +<!-- http://www.apache.org/licenses/LICENSE-2.0 --> +<!-- --> +<!-- Unless required by applicable law or agreed to in writing, software --> +<!-- distributed under the License is distributed on an "AS IS" BASIS, --> +<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or --> +<!-- implied. See the License for the specific language governing --> +<!-- permissions and limitations under the License. --> +<!-- --> +<!-- IBM_PROLOG_END_TAG --> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="xml" indent="no" omit-xml-declaration="yes"/> + + <!-- Copy everything from the source file to the destination as it is but + add newlines if the current match is a child element of the root node. + --> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + <xsl:if test=". = /node()/*"> + <xsl:text>
</xsl:text> + </xsl:if> + </xsl:template> + +</xsl:stylesheet> |