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

[PATCH] filter-branch documentation: some more touch-ups.

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Jul 4, 2007, 07:32 UTC
Message-ID
<1183534367401-git-send-email-johannes.sixt@telecom.at>
In-Reply-To
<20070703220540.GN12721@planck.djpig.de>
- The map function used to fail, but no longer does (since 3520e1e8687.)
- Fix the "edge-graft" example.
- Show the same using .git/info/grafts.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---

I think that "edge-graft" makes more sense than "etch-graft". Native speakers, please?

I tried the example, and its quoting was incorrect. The reason is that the shell removes the single quotes even if they are in the middle of a word; so they didn't end up in the eval'd script and made sed barf.

-- Hannes
 Documentation/git-filter-branch.txt |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index ee60a1a..528ccc8 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -57,8 +57,9 @@ variables are set before the first filter is run.
 
 A 'map' function is available that takes an "original sha1 id" argument
 and outputs a "rewritten sha1 id" if the commit has been already
-rewritten, fails otherwise; the 'map' function can return several
-ids on separate lines if your commit filter emitted multiple commits.
+rewritten, and "original sha1 id" otherwise; the 'map' function can
+return several ids on separate lines if your commit filter emitted
+multiple commits.
 
 
 OPTIONS
@@ -164,12 +165,12 @@ git filter-branch --index-filter 'git update-index --remove filename' newbranch
 Now, you will get the rewritten history saved in the branch 'newbranch'
 (your current branch is left untouched).
 
-To "etch-graft" a commit to the revision history (set a commit to be
+To "edge-graft" a commit to the revision history (set a commit to be
 the parent of the current initial commit and propagate that):
 
-----------------------------------------------------------------------
-git filter-branch --parent-filter sed\ 's/^$/-p <graft-id>/' newbranch
-----------------------------------------------------------------------
+------------------------------------------------------------------------
+git filter-branch --parent-filter 'sed "s/^\$/-p <graft-id>/"' newbranch
+------------------------------------------------------------------------
 
 (if the parent string is empty - therefore we are dealing with the
 initial commit - add graftcommit as a parent).  Note that this assumes
@@ -181,6 +182,13 @@ git filter-branch --parent-filter \
 	'cat; test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>"' newbranch
 -------------------------------------------------------------------------------
 
+or even simpler:
+
+-----------------------------------------------
+echo "$commit-id $graft-id" >> .git/info/grafts
+git filter-branch newbranch $graft-id..
+-----------------------------------------------
+
 To remove commits authored by "Darl McBribe" from the history:
 
 ------------------------------------------------------------------------------
-- 
1.5.3.rc0.5.g7cd9
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 12 in “Document git-filter-branch”
  1. Document git-filter-branchJohannes Schindelin, Jul 3, 2007
  2. Frank LichtenheldJul 3, 2007
  3. Johannes SchindelinJul 3, 2007
  4. Frank LichtenheldJul 4, 2007
  5. filter-branch: a few more touch ups to the man pageJohannes Schindelin, Jul 4, 2007
  6. Frank LichtenheldJul 4, 2007
  7. Jakub NarebskiJul 11, 2007
  8. Johannes SchindelinJul 11, 2007
  9. Document git-filter-branchJohannes Schindelin, Jul 3, 2007
  10. filter-branch documentation: some more touch-ups.Johannes Sixt, Jul 4, 2007
  11. Johannes SchindelinJul 4, 2007
  12. Junio C HamanoJul 4, 2007

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.