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.
This commit is contained in:
Fabio Scotto di Santolo
2026-08-25 18:01:44 +02:00
parent f08692679f
commit dcd17889ac
11 changed files with 448 additions and 112 deletions

View File

@@ -1,7 +1,7 @@
CC := cc
CPPFLAGS := -Iinclude -MMD -MP
CFLAGS := -std=c11 -Wall -Wextra -Wpedantic -Wconversion
CFLAGS := -std=c11 -Wall -Wextra -Wpedantic -Wconversion -ggdb
LDFLAGS :=
LDLIBS :=
@@ -16,7 +16,8 @@ SOURCES := \
src/walk.c \
src/scan.c \
src/create.c \
src/list.c
src/list.c \
src/diff.c
OBJECTS := $(SOURCES:%.c=$(BUILD_DIR)/%.o)
DEPENDENCIES := $(OBJECTS:.o=.d)