UJP - difftastic

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ Macソフト の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - difftastic

difftastic

カテゴリ : 
Apple » Macソフト
ブロガー : 
ujpblog 2024/1/7 17:55
 diffの結果の可読性を上げてくれるというので試してみた.

Difftastic
https://difftastic.wilfred.me.uk

引用:
Difftastic is a CLI diff tool that compares files based on their syntax, not line-by-line. Difftastic produces accurate diffs that are easier for humans to read.
Difftastic は CLI の diff ツールであり、行単位ではなく構文に基づいてファイルを比較します。Difftastic は、人間が読みやすい正確な差分を生成します。

$ brew info difftastic🆑
==> difftastic: stable 0.53.1 (bottled)
Diff that understands syntax
https://github.com/Wilfred/difftastic
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/d/difftastic.rb
License: MIT
==> Dependencies
Build: rust ✘
==> Analytics
install: 963 (30 days), 3,478 (90 days), 9,863 (365 days)
install-on-request: 962 (30 days), 3,478 (90 days), 9,863 (365 days)
build-error: 1 (30 days)
$
$ brew install difftastic🆑
==> Downloading https://ghcr.io/v2/homebrew/core/difftastic/manifests/0.53.1
######################################################################## 100.0%
==> Fetching difftastic
==> Downloading https://ghcr.io/v2/homebrew/core/difftastic/blobs/sha256:33d84b70a7e79e0b0b5895355108856aa475124f426c
######################################################################## 100.0%
==> Pouring difftastic--0.53.1.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/difftastic/0.53.1: 8 files, 65.4MB
==> Running `brew cleanup difftastic`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
$
 インストールされたプログラムを調べる.
$ which difftastic🆑
 どこにインストールされたか調べる.
$ brew ls difftastic🆑
/usr/local/Cellar/difftastic/0.53.1/.crates.toml
/usr/local/Cellar/difftastic/0.53.1/.crates2.json
/usr/local/Cellar/difftastic/0.53.1/bin/difft 🈁
$
 difftコマンドだったのか.

 試してみる.
 準備したテキスト.
$ cat /tmp/diff1.txt🆑
1 This is a pen.
2 That is a pencil.
3 how do you do?
4 I beck your perdon?
5 may be tommorow
$
$ cat /tmp/diff2.txt🆑
1 This is a ball pen.
2 That is a pencil.
3 how do you do?
5 may be tommorow
$
 普通のdiffコマンドを実行.
$ diff /tmp/diff1.txt  /tmp/diff2.txt🆑
1c1
< 1 This is a pen.
---
> 1 This is a ball pen.
4,5c4
< 4 I beck your perdon?
< 5 may be tommorow
---
> 5 may BE tommorow
 difftコマンドを実行.
$ difft /tmp/diff1.txt /tmp/diff2.txt🆑
/tmp/diff2.txt --- Text
1 1 This is a pen.                                         1 1 This is a ball pen.
2 2 That is a pencil.                                      2 2 That is a pencil.
3 3 how do you do?                                         3 3 how do you do?
4 4 I beck your perdon?                                    .
5 5 may be tommorow                                        4 5 may BE tommorow

$
 色分けされているのでテキストで見るよりはカラーで見た方が良いかな.


 あまり考えずに用意した試験用ファイルのdiff結果なので,有意義かどうかまでの検証はできてないね.

トラックバック


広告スペース
Google