Commit Graph

7 Commits

Author SHA1 Message Date
Fabio Scotto di Santolo
1302d5a946 Build with -O2 and a stricter warning set, and fix what it found
Without optimisation GCC skips the flow analysis most of these warnings
are derived from, so -O2 is what makes the existing -W flags do their job.

The new flags found three real defects:

  -Wstrict-prototypes/-Wold-style-definition: init_crc32_table() and
  RecordObjectNew() were declared with (), which in C11 means "no
  prototype", not "no arguments". RecordObjectNew even contradicted its
  own header, which declares (void).

  -Wwrite-strings: walk's blacklist held string literals in a
  non-const char *[], so they were writable through the array.

Also make ignore_file size its loop with sizeof(blacklist[0]) instead of
repeating the element type, and drop the order-only build/ prerequisite
on the link rule, which the %.o rule's mkdir -p already covers.

The tree builds clean under all twelve flags.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx
2026-08-26 15:13:08 +02:00
Fabio Scotto di Santolo
dcd17889ac Implement snapshot diff command
Add fsnap diff <old> <new> that compares two snapshots and reports
added (A), deleted (D), metadata changed (M), permissions changed (P),
and symlink target changed (L) records.

Both snapshots are loaded into memory, sorted by path using qsort,
and merged with a two-pointer algorithm. Residual records after the
merge are emitted as A or D. Escape sequences in paths are decoded
on output.

Also add GetTime accessor, set errno on load_in_memory failures
for meaningful error messages, and fix unused-variable warnings.
2026-08-25 18:13:29 +02:00
Fabio Scotto di Santolo
e5f5d559bc Add CRC-32 fingerprinting of symlink targets
Hash the followed target content with CRC-32 (hash.c/hash.h) and emit a FINGERPRINT field for non-directory records in create.c. Schema: TYPE|MODE|UID|GID|MTIME|SIZE|FINGERPRINT|TARGET per SPEC §17/§18.
2026-08-23 17:47:09 +02:00
Fabio Scotto di Santolo
9df9223b63 Extract snapshot parser into a reusable types module
Splits RecordObject, unpack, release, field and field_name out of list.c into types.c/types.h; declares field extern in the header with a single definition in types.c; adds src/types.c to SOURCES.
2026-08-21 00:00:23 +02:00
Fabio Scotto di Santolo
b542113252 Add list command [WIP] 2026-08-05 22:07:21 +02:00
Fabio Scotto di Santolo
3eae528f54 Add create command 2026-08-01 14:27:52 +02:00
Fabio Scotto di Santolo
078b95dc4b Add function scan directory 2026-07-31 23:54:45 +02:00