From 16601d0ffb3ad320b2ed3166c1adf5b0e0ab0633 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 21 Jul 2025 18:19:49 +0300 Subject: [PATCH] blog.gitignore: update gitignore example --- site/blog/2024-09-30-gitignore.md | 11 +++++++---- site/blog/2025-07-21-3-json.md | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/site/blog/2024-09-30-gitignore.md b/site/blog/2024-09-30-gitignore.md index 67ab938..be06b31 100644 --- a/site/blog/2024-09-30-gitignore.md +++ b/site/blog/2024-09-30-gitignore.md @@ -98,18 +98,21 @@ You change your gitignore to this: !.gitignore -!src/*.rs +# whitelist `src` directories and their children, regardless of place +!src/**/ +!src/**/*.rs !Cargo.{toml,lock} -!pysrc/*.py +# whitelist root `pysrc` directory +!/pysrc/*.py !pyproject.toml !poetry.lock -!cmd/*.go +!/cmd/*.go !main.go !go.{mod,sum} -!docs/*.md +!/docs/*.md ``` Now, nobody can accidentally commit undesired files, as git automatically diff --git a/site/blog/2025-07-21-3-json.md b/site/blog/2025-07-21-3-json.md index d92c3c8..e4efe42 100644 --- a/site/blog/2025-07-21-3-json.md +++ b/site/blog/2025-07-21-3-json.md @@ -26,8 +26,9 @@ Oops (from the `tree`version 2.0.2 release notes): > the environment variable STDDATA_FD is present or set to the descriptor to > produce the JSON output on. -Unix is a mess. But it's still cool we can have `tree` output structured data -using `STDDATA_FD`: +Assuming anything about the users environment is and will always be a mistake. +But it's still cool we can have `tree` output structured data using +`STDDATA_FD`: ```json > STDDATA_FD=1 tree