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

[PATCH] git-filter-branch.txt: Add picture to explain the graft-id

From
Jari Aalto <jari.aalto@cante.net>
Date
Mar 9, 2008, 09:01 UTC
Message-ID
<7igcz2xx.fsf@blue.sea.net>

Present a picture to demonstrate the positions of graft-id and commit-id in case of merging A with B.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 Documentation/git-filter-branch.txt |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
 I'd like to thank Mikael Magnusson explaining this.
diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt
index 543a1cf..73939e2 100644
--- a/Documentation/git-filter-branch.txt
+++ b/Documentation/git-filter-branch.txt
@@ -186,7 +186,7 @@ Now, you will get the rewritten history saved in 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:
+order to paste the other history behind the current history.
 
 -------------------------------------------------------------------
 git filter-branch --parent-filter 'sed "s/^\$/-p <graft-id>/"' HEAD
@@ -198,6 +198,12 @@ history with a single root (that is, no merge without common ancestors
 happened).  If this is not the case, use:
 
 --------------------------------------------------------------------------
+
+    The plan: supposing we're merging A with B
+    commit sequence A: a-b-c			graft-id  = b
+    commit sequence B: c'-d'-e'			commit-id = c'
+    Result	     : a-b-c'-d'-e'
+
 git filter-branch --parent-filter \
 	'test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>" || cat' HEAD
 --------------------------------------------------------------------------
-- 
1.5.3.8


-- 
Welcome to FOSS revolution: we fix and modify until it shines
Next: Junio C Hamano
Message 1 of 2 in “git-filter-branch.txt: Add picture to explain the graft-id”
  1. git-filter-branch.txt: Add picture to explain the graft-idJari Aalto, Mar 9, 2008
  2. Junio C HamanoMar 12, 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.