From: Johannes Sixt <johannes.sixt@telecom.at>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com,
Frank Lichtenheld <frank@lichtenheld.de>,
j.sixt@eudaptics.com, Johannes Sixt <johannes.sixt@telecom.at>
Subject: [PATCH] filter-branch documentation: some more touch-ups.
Date: Wed, 4 Jul 2007 09:32:47 +0200 [thread overview]
Message-ID: <1183534367401-git-send-email-johannes.sixt@telecom.at> (raw)
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
next prev parent reply other threads:[~2007-07-04 7:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-03 16:47 [PATCH] Document git-filter-branch Johannes Schindelin
2007-07-03 22:05 ` Frank Lichtenheld
2007-07-03 23:17 ` Johannes Schindelin
2007-07-04 11:29 ` Frank Lichtenheld
2007-07-04 14:50 ` [PATCH] filter-branch: a few more touch ups to the man page Johannes Schindelin
2007-07-04 15:06 ` Frank Lichtenheld
2007-07-11 16:53 ` [PATCH] Document git-filter-branch Jakub Narebski
2007-07-11 17:03 ` Johannes Schindelin
2007-07-03 23:41 ` Johannes Schindelin
2007-07-04 7:32 ` Johannes Sixt [this message]
2007-07-04 10:58 ` [PATCH] filter-branch documentation: some more touch-ups Johannes Schindelin
2007-07-04 16:56 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1183534367401-git-send-email-johannes.sixt@telecom.at \
--to=johannes.sixt@telecom.at \
--cc=Johannes.Schindelin@gmx.de \
--cc=frank@lichtenheld.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@eudaptics.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).