πŸ’Ύ Archived View for perso.pw β€Ί blog β€Ί articles β€Ί potw-diffoscope.gmi captured on 2023-04-19 at 23:16:40. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➑️ Next capture (2023-05-24)

-=-=-=-=-=-=-

Port of the week: diffoscope

NIL=> https://bsd.network/@solenepercent/105923559844144257 Comment on Mastodon

Introduction

Today I will introduce you to Diffoscope, a command line software to compare two directories. I find it very useful when looking for changes between two extracted tarballs, I use it to compare changes between two version of a program to see what changed.

Diffoscope project website

How to install

On OpenBSD you can use "pkg_add diffoscope", on other systems you may have a package for it, but it could be installed via pip too.

Usage

It is really easy to use, as parameter give the two directories you want to compare, diffoscope will then show the uid, gid, permissions, modification/creation/access time changes between the two directories.

The output on a simple example looks like the following:

--- t/
+++ a/
β”‚   --- t/foo
β”œβ”€β”€ +++ a/foo
β”‚ @@ -1 +1 @@
β”‚ -hello
β”‚ +not hello
β”‚ β”œβ”€β”€ stat {}
β”‚ β”‚ @@ -1 +1 @@
β”‚ β”‚ -1043 492483 -rw-r--r-- 1 solene wheel 1973218 6 "Mar 20 18:31:08 2021" "Mar 20 18:31:14 2021" "Mar 20 18:31:14 2021" 16384 4 0 t/foo
β”‚ β”‚ +1043 77762 -rw-r--r-- 1 solene wheel 314338 10 "Mar 20 18:31:08 2021" "Mar 20 18:31:18 2021" "Mar 20 18:31:18 2021" 16384 4 0 a/foo

Diffoscope has many flags, if you want to only compare the directories content, you have to use "--exclude-directory-metadata yes".

Using the same example as previously with --exclude-directory-metadata yes, it looks like:

--- t/
+++ a/
β”‚   --- t/foo
β”œβ”€β”€ +++ a/foo
β”‚ @@ -1 +1 @@
β”‚ -hello
β”‚ +not hello