From add2b863d08091deb337dcfa7a8e73f178da0bb5 Mon Sep 17 00:00:00 2001 From: Lukas Waslowski Date: Thu, 25 Apr 2024 21:06:13 +0200 Subject: [PATCH] Update 2024-04-25-code-formatting-with-git-filter-branch.md --- .../2024-04-25-code-formatting-with-git-filter-branch.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_posts/2024-04-25-code-formatting-with-git-filter-branch.md b/_posts/2024-04-25-code-formatting-with-git-filter-branch.md index 3c6b818..5a2976d 100644 --- a/_posts/2024-04-25-code-formatting-with-git-filter-branch.md +++ b/_posts/2024-04-25-code-formatting-with-git-filter-branch.md @@ -193,8 +193,12 @@ Example output (truncated): ## Bonus: Custom code formatting tools -Your custom tool should accept a list of files to format either via stdin, or as command line arguments. -It should format the specified files in-place. Your `--tree-filter` should then look something like this. +You can still employ `git filter-branch` even if you do not use the `pre-commit` tool. +The only requirement is that you have a custom that accepts a list of files to format +either via stdin, or as command line arguments, and writes the formatted files back +to their original locations. + +Your `--tree-filter` should then look something like this, either inline or wrapped into a shell script file: ```bash # Pass the list of changed files via stdin