Giter Club home page Giter Club logo

bearger-xml's Introduction

Bearger XML

Tool for creating useful diffs in xml files.

[LOGO HERE]

Why?

Git can create useless diffs when resolving conflicts in xml files. What's more, it can duplicate one part of file and drop another which makes it dangerous when using xmls to store configuration. This tool fetches version of file from two refs (branches, commit hashes...), builds xml tree and diffs it.

Warning

This tool(at least for now) does not support xml attributes and namespaces. They will not be printed out in diff file and should be added manually.

I should probably state that you are using this tool at your own risk and this tool (like any other) may contain bugs which can lead to data loss.

How to use

Merging configuration files

Configuration files are stored in

~/.config/bearger-xml/merging/

In this folder each top xml tag should have its config file with names like

TopTagName.json

Example if we want to create configuration file for merging salesforce labels files:

<?xml version="1.0" encoding="UTF-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
    <labels>
        <fullName>quoteManual</fullName>
        <value>This is a manual quote.</value>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>Manual Quote</shortDescription>
    </labels>
    <labels>
        <fullName>quoteAuto</fullName>
        <value>This is an automatically generated quote.</value>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>Automatic Quote</shortDescription>
    </labels>
</CustomLabels>

configuration should be placed in file

~/.config/bearger-xml/merging/CustomLabels.json

JSON Schema for configuration files is specified in this file. Example config files are stored in this folder

Main config file (TODO)

Main config file is optional and is stored in file

~/.config/bearger-xml/config.json

JSON Schema for main config file is specified in this file.

Running

java -jar pathToJarWithCompiledBearger.jar sourceBranchName mergedBranchName fileNames

TODO

  • Main config file support HEHEHEHE
  • support for namespaces and attributes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.