git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] Update documentation to describe git filter-branch --blob-filter.

From
Avery Pennarun <apenwarr@gmail.com>
Date
Apr 23, 2008, 19:42 UTC
Message-ID
<1208979757-30860-3-git-send-email-apenwarr@gmail.com>
In-Reply-To
<1208979757-30860-2-git-send-email-apenwarr@gmail.com>
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
---
 Documentation/git-filter-branch.txt |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 2a78549..367f119 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -12,6 +12,7 @@ SYNOPSIS
 	[--index-filter <command>] [--parent-filter <command>]
 	[--msg-filter <command>] [--commit-filter <command>]
 	[--tag-name-filter <command>] [--subdirectory-filter <directory>]
+	[--blob-filter <command]
 	[--original <namespace>] [-d <directory>] [-f | --force]
 	[<rev-list options>...]
 
@@ -143,6 +144,15 @@ definition impossible to preserve signatures at any rate.)
 	The result will contain that directory (and only that) as its
 	project root.
 
+--blob-filter <command>::
+	This is the filter for modifying the contents of each file (blob)
+	in the tree.  The contents of a file are provided on stdin, and
+	the new file contents should be provided on stdout.  For efficiency,
+	the before/after results of a given blob are only calculated once
+	and then cached, so your filter must always return the same output
+	blob for any given input blob.  You might use this filter for
+	converting CRLF to LF in all your files, for example.
+
 --original <namespace>::
 	Use this option to set the namespace where the original commits
 	will be stored. The default value is 'refs/original'.
@@ -185,6 +195,13 @@ git filter-branch --index-filter 'git update-index --remove filename' HEAD
 
 Now, you will get the rewritten history saved in HEAD.
 
+To convert CRLF to LF in all your files using the "fromdos" program (be
+careful: this will attempt to modify binary files too!):
+
+----------------------------------------------
+git filter-branch --blob-filter 'fromdos' HEAD
+----------------------------------------------
+
 To set a commit (which typically is at the tip of another
 history) to be the parent of the current initial commit, in
 order to paste the other history behind the current history:
-- 
1.5.4.3
Previous: Avery PennarunNext: Johannes Schindelin
Message 3 of 11 in “Add --blob-filter option to filter-branch.”
  1. 1/3 Add --blob-filter option to filter-branch.Avery Pennarun, Apr 23, 2008
  2. 2/3 Make filter-branch --glob-filter much faster by not calling 'cat'Avery Pennarun, Apr 23, 2008
  3. 3/3 Update documentation to describe git filter-branch --blob-filter.Avery Pennarun, Apr 23, 2008
  4. Johannes SchindelinApr 23, 2008
  5. Avery PennarunApr 23, 2008
  6. Johannes SchindelinApr 23, 2008
  7. 1/3 Add --blob-filter option to filter-branch.Avery Pennarun, Apr 23, 2008
  8. Johannes SchindelinApr 23, 2008
  9. Jeff KingApr 23, 2008
  10. Avery PennarunApr 23, 2008
  11. Jeff KingApr 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.