diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-25 19:08:14 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-25 19:08:14 +0200 |
| commit | 168361ef112c61391a615d8b1f0048b79a2b7237 (patch) | |
| tree | 6c2d2b89ac2876146872a0d5cb1ae231547eeded /patches | |
| parent | 8f99f1650e4a7363af1d83190b4082fb72a9f73f (diff) | |
| download | ttym-168361ef112c61391a615d8b1f0048b79a2b7237.tar.gz ttym-168361ef112c61391a615d8b1f0048b79a2b7237.zip | |
patches: drop generated config.h and binary sections from the diffs
The 3.0 patch files each carried a spurious diff section for config.h --
a file the Makefile generates from config.def.h -- plus "Binary files
a/timer and b/timer differ" noise. Applying any of them made patch(1)
stop and prompt "File to patch:", which stalls a non-interactive apply
and prints "1 out of 1 hunk ignored" otherwise.
Cause: the diff-generation step cleaned its scratch trees with a glob
that matched nothing, and the shell aborts the whole command line on a
failed glob, so the cleanup never ran and the build products were left
in place.
The resulting builds were correct either way, since make regenerates
config.h from config.def.h, but the patches were not clean. Each patch
now touches only ttym.c and config.def.h.
Verified with patch --batch < /dev/null so a prompt is fatal rather than
silently skipped: all five apply with no prompt, skip, ignored hunk or
fuzz, and compile.
Claude-Session: https://claude.ai/code/session_01APLBs8RB1FcUaC4viVkzbP
Diffstat (limited to 'patches')
| -rw-r--r-- | patches/ttym-config-file-3.0.diff | 23 | ||||
| -rw-r--r-- | patches/ttym-full-3.0.diff | 45 | ||||
| -rw-r--r-- | patches/ttym-hooks-3.0.diff | 5 | ||||
| -rw-r--r-- | patches/ttym-logging-3.0.diff | 24 | ||||
| -rw-r--r-- | patches/ttym-notify-3.0.diff | 32 |
5 files changed, 18 insertions, 111 deletions
diff --git a/patches/ttym-config-file-3.0.diff b/patches/ttym-config-file-3.0.diff index 031f105..cc7a14b 100644 --- a/patches/ttym-config-file-3.0.diff +++ b/patches/ttym-config-file-3.0.diff @@ -1,6 +1,6 @@ diff -ruN a/config.def.h b/config.def.h ---- a/config.def.h 2026-08-25 17:18:15.738123728 +0200 -+++ b/config.def.h 2026-08-25 17:18:15.738123728 +0200 +--- a/config.def.h 2026-08-25 19:07:53.233903707 +0200 ++++ b/config.def.h 2026-08-25 19:07:53.233903707 +0200 @@ -1,5 +1,10 @@ /* See LICENSE file for copyright and license details. */ @@ -12,24 +12,9 @@ diff -ruN a/config.def.h b/config.def.h /* progress bar glyphs (ASCII default) */ static const char *const BAR_FILL = ">"; static const char *const BAR_EMPTY = "-"; -diff -ruN a/config.h b/config.h ---- a/config.h 2026-08-25 17:18:15.738123728 +0200 -+++ b/config.h 2026-08-25 17:18:15.738123728 +0200 -@@ -1,5 +1,10 @@ - /* See LICENSE file for copyright and license details. */ - -+/* Defaults below are compile-time. Many can be overridden at runtime by -+ * /etc/ttym.conf and ~/.config/ttym/config; command-line flags override -+ * both. Run `timer --dump-config` for a commented template. See timer(1). -+ */ -+ - /* progress bar glyphs (ASCII default) */ - static const char *const BAR_FILL = ">"; - static const char *const BAR_EMPTY = "-"; -Binary files a/timer and b/timer differ diff -ruN a/ttym.c b/ttym.c ---- a/ttym.c 2026-08-25 17:18:15.738123728 +0200 -+++ b/ttym.c 2026-08-25 17:18:15.738123728 +0200 +--- a/ttym.c 2026-08-25 19:07:53.233903707 +0200 ++++ b/ttym.c 2026-08-25 19:07:53.233903707 +0200 @@ -25,13 +25,15 @@ typedef struct { int quiet; /* -q: suppress completion bell */ diff --git a/patches/ttym-full-3.0.diff b/patches/ttym-full-3.0.diff index 166c869..ebbcd43 100644 --- a/patches/ttym-full-3.0.diff +++ b/patches/ttym-full-3.0.diff @@ -1,6 +1,6 @@ diff -ruN a/config.def.h b/config.def.h ---- a/config.def.h 2026-08-25 17:18:15.750123947 +0200 -+++ b/config.def.h 2026-08-25 17:18:15.750123947 +0200 +--- a/config.def.h 2026-08-25 19:07:53.325905382 +0200 ++++ b/config.def.h 2026-08-25 19:07:53.329905455 +0200 @@ -1,9 +1,32 @@ /* See LICENSE file for copyright and license details. */ @@ -34,46 +34,9 @@ diff -ruN a/config.def.h b/config.def.h /* persistent alert: keep ringing the bell until any key is pressed. * Foreground-only; backgrounded runs always fall through. * Override per-run with --no-persist. -diff -ruN a/config.h b/config.h ---- a/config.h 2026-08-25 17:18:15.750123947 +0200 -+++ b/config.h 2026-08-25 17:18:15.750123947 +0200 -@@ -1,9 +1,32 @@ - /* See LICENSE file for copyright and license details. */ - -+/* Defaults below are compile-time. Many can be overridden at runtime by -+ * /etc/ttym.conf and ~/.config/ttym/config; command-line flags override -+ * both. Run `timer --dump-config` for a commented template. See timer(1). -+ */ -+ - /* progress bar glyphs (ASCII default) */ - static const char *const BAR_FILL = ">"; - static const char *const BAR_EMPTY = "-"; - -+/* desktop notification on countdown completion. -+ * Tokens are split on whitespace; placeholders {title} and {msg} are expanded. -+ * Set NULL or "" to disable. -+ */ -+static const char *const TITLE = "Timer"; -+static const char *const NOTIFY_CMD = "notify-send -u critical {title} {msg}"; -+ -+/* sound on countdown completion. If SOUND_CMD is "" the binary autodetects -+ * a player (paplay/aplay/mpv/ffplay) and plays a default freedesktop sound. -+ * SOUND_CMD is split on whitespace; same token rules as NOTIFY_CMD. -+ */ -+static const char *const SOUND_CMD = ""; -+ -+/* log location is ~/.config/ttym/ttym.log (honours $XDG_CONFIG_HOME). -+ * One-shot migration: ~/.config/timer/ -> ~/.config/ttym/ if the new -+ * directory doesn't already exist; legacy log file inside is renamed. -+ */ -+ - /* persistent alert: keep ringing the bell until any key is pressed. - * Foreground-only; backgrounded runs always fall through. - * Override per-run with --no-persist. -Binary files a/timer and b/timer differ diff -ruN a/ttym.c b/ttym.c ---- a/ttym.c 2026-08-25 17:18:15.750123947 +0200 -+++ b/ttym.c 2026-08-25 17:18:15.750123947 +0200 +--- a/ttym.c 2026-08-25 19:07:53.325905382 +0200 ++++ b/ttym.c 2026-08-25 19:07:53.329905455 +0200 @@ -13,6 +13,10 @@ #include <string.h> #include <strings.h> diff --git a/patches/ttym-hooks-3.0.diff b/patches/ttym-hooks-3.0.diff index fd505c9..245eba6 100644 --- a/patches/ttym-hooks-3.0.diff +++ b/patches/ttym-hooks-3.0.diff @@ -1,7 +1,6 @@ -Binary files a/timer and b/timer differ diff -ruN a/ttym.c b/ttym.c ---- a/ttym.c 2026-08-25 17:18:15.722123437 +0200 -+++ b/ttym.c 2026-08-25 17:18:15.726123510 +0200 +--- a/ttym.c 2026-08-25 19:07:53.181902760 +0200 ++++ b/ttym.c 2026-08-25 19:07:53.185902833 +0200 @@ -13,6 +13,8 @@ #include <string.h> #include <strings.h> diff --git a/patches/ttym-logging-3.0.diff b/patches/ttym-logging-3.0.diff index 0b16351..859b345 100644 --- a/patches/ttym-logging-3.0.diff +++ b/patches/ttym-logging-3.0.diff @@ -1,6 +1,6 @@ diff -ruN a/config.def.h b/config.def.h ---- a/config.def.h 2026-08-25 17:18:15.710123219 +0200 -+++ b/config.def.h 2026-08-25 17:18:15.714123291 +0200 +--- a/config.def.h 2026-08-25 19:07:53.121901667 +0200 ++++ b/config.def.h 2026-08-25 19:07:53.121901667 +0200 @@ -4,6 +4,11 @@ static const char *const BAR_FILL = ">"; static const char *const BAR_EMPTY = "-"; @@ -13,25 +13,9 @@ diff -ruN a/config.def.h b/config.def.h /* persistent alert: keep ringing the bell until any key is pressed. * Foreground-only; backgrounded runs always fall through. * Override per-run with --no-persist. -diff -ruN a/config.h b/config.h ---- a/config.h 2026-08-25 17:18:15.710123219 +0200 -+++ b/config.h 2026-08-25 17:18:15.714123291 +0200 -@@ -4,6 +4,11 @@ - static const char *const BAR_FILL = ">"; - static const char *const BAR_EMPTY = "-"; - -+/* log location is ~/.config/ttym/ttym.log (honours $XDG_CONFIG_HOME). -+ * One-shot migration: ~/.config/timer/ -> ~/.config/ttym/ if the new -+ * directory doesn't already exist; legacy log file inside is renamed. -+ */ -+ - /* persistent alert: keep ringing the bell until any key is pressed. - * Foreground-only; backgrounded runs always fall through. - * Override per-run with --no-persist. -Binary files a/timer and b/timer differ diff -ruN a/ttym.c b/ttym.c ---- a/ttym.c 2026-08-25 17:18:15.710123219 +0200 -+++ b/ttym.c 2026-08-25 17:18:15.714123291 +0200 +--- a/ttym.c 2026-08-25 19:07:53.121901667 +0200 ++++ b/ttym.c 2026-08-25 19:07:53.121901667 +0200 @@ -13,6 +13,7 @@ #include <string.h> #include <strings.h> diff --git a/patches/ttym-notify-3.0.diff b/patches/ttym-notify-3.0.diff index 9ccfd5c..0a21038 100644 --- a/patches/ttym-notify-3.0.diff +++ b/patches/ttym-notify-3.0.diff @@ -1,6 +1,6 @@ diff -ruN a/config.def.h b/config.def.h ---- a/config.def.h 2026-08-25 17:18:15.698123000 +0200 -+++ b/config.def.h 2026-08-25 17:18:15.702123073 +0200 +--- a/config.def.h 2026-08-25 19:07:53.037900137 +0200 ++++ b/config.def.h 2026-08-25 19:07:53.041900210 +0200 @@ -4,6 +4,19 @@ static const char *const BAR_FILL = ">"; static const char *const BAR_EMPTY = "-"; @@ -21,33 +21,9 @@ diff -ruN a/config.def.h b/config.def.h /* persistent alert: keep ringing the bell until any key is pressed. * Foreground-only; backgrounded runs always fall through. * Override per-run with --no-persist. -diff -ruN a/config.h b/config.h ---- a/config.h 2026-08-25 17:18:15.698123000 +0200 -+++ b/config.h 2026-08-25 17:18:15.702123073 +0200 -@@ -4,6 +4,19 @@ - static const char *const BAR_FILL = ">"; - static const char *const BAR_EMPTY = "-"; - -+/* desktop notification on countdown completion. -+ * Tokens are split on whitespace; placeholders {title} and {msg} are expanded. -+ * Set NULL or "" to disable. -+ */ -+static const char *const TITLE = "Timer"; -+static const char *const NOTIFY_CMD = "notify-send -u critical {title} {msg}"; -+ -+/* sound on countdown completion. If SOUND_CMD is "" the binary autodetects -+ * a player (paplay/aplay/mpv/ffplay) and plays a default freedesktop sound. -+ * SOUND_CMD is split on whitespace; same token rules as NOTIFY_CMD. -+ */ -+static const char *const SOUND_CMD = ""; -+ - /* persistent alert: keep ringing the bell until any key is pressed. - * Foreground-only; backgrounded runs always fall through. - * Override per-run with --no-persist. -Binary files a/timer and b/timer differ diff -ruN a/ttym.c b/ttym.c ---- a/ttym.c 2026-08-25 17:18:15.698123000 +0200 -+++ b/ttym.c 2026-08-25 17:18:15.702123073 +0200 +--- a/ttym.c 2026-08-25 19:07:53.037900137 +0200 ++++ b/ttym.c 2026-08-25 19:07:53.041900210 +0200 @@ -13,6 +13,7 @@ #include <string.h> #include <strings.h> |
