Code Monkey home page Code Monkey logo

dmfo's Introduction

DMFO -- Diff and Merge For Office

badge:pypi-version badge:py-versions pre-commit pre-commit.ci status Code style: black Code style: prettier

This is a set of scripts that enable convenient diff and merge of Office-related file types (currently Word and PowerPoint (diff only)). The office application will be started using COM automation, thus an Office installation is required.

DMFO is LFS compatible.

Important: Legacy PowerShell scripts are located in ps1 and may still be used. However, not all new features will be ported back to the ps1 scripts.

Usage

Installation

Installable with pip or pipx (recommended).

pipx install DMFO

or

pipx install git+https://github.com/lcnittl/DMFO.git

Git Integration

These tools are intended to be used with Git, so that git diff and git merge will use Office applications to compare and "merge" files. Simply configure .gitattributes and .gitconfig to support the DMFO diff and merge driver. Enjoy to diff and merge Office documents by simply running:

> git diff
> git merge

as usual and with any paramter they accept.

.gitconfig

Simply register the diff and merge drivers by running dmfo install (scope can be given by appending system, global, local or worktree, default is global).

Alternatively, add the entries manually to your git config:

[diff "dmfo"]
	name = DMFO diff driver
	command = dmfo diff
	binary = true
[merge "dmfo"]
	name = DMFO merge driver
	driver = dmfo merge %O %A %B %L %P
	binary = true

Make sure that dmfo's path is in your path variable, otherwise prepand dmfo with the executable's path.

.gitattributes

Specify the following drivers in your .gitattributes file (currently DMFO is only supporting Word files):

*.doc diff=dmfo merge=dmfo
*.docx diff=dmfo merge=dmfo
*.ppt diff=dmfo
*.pptx diff=dmfo

CLI

This option might be added at a later time.

Reqirements

  • Git (for Windows)
  • Microsoft Office ([and/or]: Word, Powerpoint)

Platform

In its current implementation, DMFO is suited for Windows 10. Not tested on other platforms.

License

GNU General Public License v3.0 or later

See LICENSE for the full text.

dmfo's People

Contributors

lcnittl avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dmfo's Issues

Diff of New Files

Currently throws an error:

PS C:\...\repo> git diff --staged
Resolve-Path : Cannot find path 'C:\...\repo\nul' because it does not exist.
At C:\...\DMFO\dmfo-diff.ps1:28 char:18
+     $FileName = (Resolve-Path $FileNames[$key]).Path
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\...\repo\nul:String) [Resolve-Path], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand

fatal: external diff died, stopping at NewFile.pptx

Should open the newly added file without any comparison.

Move Equal Code

Move equal code (e.g. the defined constants) to a separate file that it included into both scripts.

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.