Git Product home page Git Product logo

webdiff's Introduction

Build Status

git webdiff

Two-column web-based git difftool.

Features include:

  • Side-by-side (two column) diff view
  • Runs in the browser of your choice on any platform.
  • Syntax highlighting via highlight.js
  • Step back and forth through multiple files in a single diff
  • Rich support for image diffs

Screenshot of webdiff in action

Screenshot of image diffs

Installation

pip install webdiff

or, if you prefer Homebrew:

brew install danvk/webdiff/webdiff

(the latter will also install ImageMagick as a recommended dependency.)

Usage

Instead of running "git diff", run:

git webdiff

You can also start webdiff via:

git webdiff [args]

You can pass all the same arguments that you would to git diff, e.g. 1234..5678 or HEAD.

webdiff can also be invoked directly to diff two directories or files:

webdiff <left_dir> <right_dir>
webdiff <left_file> <right_file>

You can also use webdiff to view GitHub pull requests:

webdiff https://github.com/owner/repo/pull/123
webdiff #123  # if you're in a git repo with a github remote

This will download the files relevant to the Pull Request and run webdiff.

If you run into GitHub API quota limits or you'd like to use webdiff with private repos, you can set your credentials in a .githubrc file:

user.login: yourusername
user.token: your-personal-access-tokens

Make sure you chmod this file to only be readable by yourself. You can generate a personal access token for webdiff via github.com → profile → Settings → Personal access tokens. Make sure to grant all the "repo" privileges.

Development

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd ts
yarn
# see https://github.com/webpack/webpack/issues/14532
NODE_OPTIONS=--openssl-legacy-provider webpack

Then from the root directory:

PYTHONPATH=. ./webdiff/app.py testdata/dygraphsjs/{left,right}

or to launch in debug mode:

./test.sh $(pwd)/../testdata/webdiffdiff/{left,right}

(or any other directory in testdata)

To run the Python tests:

pytest

To run the JavaScript tests:

python -m SimpleHTTPServer
open tests/runner.html

To format the code, run:

./scripts/black.sh
cd ts
yarn prettier

To iterate on the PyPI package, run:

# from outside the webdiff virtualenv:
pip uninstall webdiff

# from inside the webdiff virtualenv, adjust for current version
python setup.py sdist
mkdir /tmp/webdiff-test
cp dist/webdiff-X.Y.Z.tar.gz /tmp/webdiff-test

deactivate
cd /tmp/webdiff-test
pip3 install webdiff-X.Y.Z.tar.gz

To publish to pypitest:

pip install --upgrade wheel setuptools twine
python setup.py sdist bdist_wheel
twine upload -r testpypi dist/*

And to the real pypi:

twine upload dist/*

See pypirc docs for details on setting up ~/.pypirc.

webdiff's People

Contributors

danvk avatar ryan-williams avatar nikolasoliveira avatar daytonb avatar xuv avatar

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.