|
33 | 33 | - Display the first n lines of the diff output with the `--head` option
|
34 | 34 | - Display the last n lines of the diff output with the `--tail` option
|
35 | 35 | - Execute the diff with an external diff tool using the `--external` option
|
| 36 | +- Use in Git as a diff-driver to be the default diff tool for fonts |
36 | 37 |
|
37 | 38 | Run `fdiff --help` to view all available options.
|
38 | 39 |
|
@@ -101,6 +102,30 @@ $ fdiff [OPTIONS] [PRE-FONT FILE URL] [POST-FONT FILE FILE PATH]
|
101 | 102 |
|
102 | 103 | ⭐ **Tip**: Remote git repository hosting services (like Github) support access to files on different git branches by URL. Use these repository branch URL to compare fonts across git branches in your repository.
|
103 | 104 |
|
| 105 | +#### As Git's diff driver for fonts |
| 106 | + |
| 107 | +Git can be configured to automatically use a specific tool to diff specific file types. These are the steps to use `fdiff` as the default diff output for font files. |
| 108 | + |
| 109 | +1. Tell Git how to run the tool. As with most git configuration options this may be set for a repository (`--local`), for your user (`--global`), or system (`--system`). We recommend setting this at the user level. Assuming `fdiff` is available in your path, this setting should do the trick: |
| 110 | + |
| 111 | + git config --global diff.fdiff.command 'fdiff -c --git' |
| 112 | + |
| 113 | + This will write it to your `$HOME/.gitconfig` file looking like this: |
| 114 | + |
| 115 | + ```gitconfig |
| 116 | + [diff "fdiff"] |
| 117 | + command = fdiff -c --git |
| 118 | + ``` |
| 119 | + |
| 120 | + Of course you may also edit it there. |
| 121 | + |
| 122 | +2. Tell Git to use that specific tool for supported file types. This may also be done at multiple places. Each repository may have it's own `.gitattributes` file, a user may have one setting global defaults in `$XDG_HOME/git/attributes`, or there may be a system wide default file. Wherever you choose to place this, the lines are the same: |
| 123 | + |
| 124 | + ```gitattributes |
| 125 | + .otf diff=fdiff |
| 126 | + .ttf diff=fdiff |
| 127 | + ``` |
| 128 | + |
104 | 129 | ### Options
|
105 | 130 |
|
106 | 131 | #### Color diffs
|
@@ -227,5 +252,3 @@ Unless required by applicable law or agreed to in writing, software distributed
|
227 | 252 | #### CPython `difflib` library
|
228 | 253 |
|
229 | 254 | This project distributes a modified version of third party source code from the [Python programming language standard library](https://github.com/python/cpython). The `difflib.py` v3.7.4 module is Copyright © 2001-2019 Python Software Foundation; All Rights Reserved. This source is modified and distributed in this project under the [PSF LICENSE AGREEMENT FOR PYTHON 3.7.4](https://github.com/source-foundry/fdiff/blob/master/lib/fdiff/thirdparty/PYTHON_LICENSE). The module is renamed to `fdifflib.py` to distinguish it from the upstream source, and modifications made here are documented in comments at the head of the module.
|
230 |
| - |
231 |
| - |
|
0 commit comments