summaryrefslogtreecommitdiffstats
path: root/git-filter-branch.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2008-07-06 05:20:31 +0000
committerJunio C Hamano <junio@hera.kernel.org>2008-07-06 05:20:31 +0000
commitba4b9286c25f18c7ebbb809ee5732a7810377ab6 (patch)
tree390507328a7564b65dc803683c34235700b97409 /git-filter-branch.html
parent05bf9c54a827e48b2b576488f5170a3490b5180e (diff)
downloadgit-htmldocs-ba4b9286c25f18c7ebbb809ee5732a7810377ab6.tar.gz
Autogenerated HTML docs for v1.5.6.2-212-g08b5
Diffstat (limited to 'git-filter-branch.html')
-rw-r--r--git-filter-branch.html204
1 files changed, 126 insertions, 78 deletions
diff --git a/git-filter-branch.html b/git-filter-branch.html
index 7cb33fa67..9e255390c 100644
--- a/git-filter-branch.html
+++ b/git-filter-branch.html
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<meta name="generator" content="AsciiDoc 7.0.2" />
+<meta name="generator" content="AsciiDoc 8.2.5" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
@@ -16,8 +16,13 @@ body {
margin: 1em 5% 1em 5%;
}
-a { color: blue; }
-a:visited { color: fuchsia; }
+a {
+ color: blue;
+ text-decoration: underline;
+}
+a:visited {
+ color: fuchsia;
+}
em {
font-style: italic;
@@ -39,13 +44,18 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1.3;
}
-h1 {
+h1, h2, h3 {
border-bottom: 2px solid silver;
}
h2 {
- border-bottom: 2px solid silver;
padding-top: 0.5em;
}
+h3 {
+ float: left;
+}
+h3 + * {
+ clear: left;
+}
div.sectionbody {
font-family: serif;
@@ -70,7 +80,7 @@ span#author {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
- font-size: 1.2em;
+ font-size: 1.1em;
}
span#email {
}
@@ -139,6 +149,9 @@ div.sidebarblock > div.content {
padding: 0.5em;
}
+div.listingblock {
+ margin-right: 0%;
+}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
@@ -148,9 +161,13 @@ div.listingblock > div.content {
div.quoteblock > div.content {
padding-left: 2.0em;
}
-div.quoteblock .attribution {
+
+div.attribution {
text-align: right;
}
+div.verseblock + div.attribution {
+ text-align: left;
+}
div.admonitionblock .icon {
vertical-align: top;
@@ -194,13 +211,12 @@ dd > *:first-child {
ul, ol {
list-style-position: outside;
}
-ol.olist2 {
+div.olist2 ol {
list-style-type: lower-alpha;
}
div.tableblock > table {
- border-color: #527bbd;
- border-width: 3px;
+ border: 3px solid #527bbd;
}
thead {
font-family: sans-serif;
@@ -214,6 +230,9 @@ div.hlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
+div.hlist td {
+ padding-bottom: 5px;
+}
td.hlist1 {
vertical-align: top;
font-style: italic;
@@ -226,7 +245,33 @@ td.hlist2 {
@media print {
div#footer-badges { display: none; }
}
-include::./stylesheets/xhtml11-manpage.css[]
+
+div#toctitle {
+ color: #527bbd;
+ font-family: sans-serif;
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 1.0em;
+ margin-bottom: 0.1em;
+}
+
+div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+div.toclevel2 {
+ margin-left: 2em;
+ font-size: 0.9em;
+}
+div.toclevel3 {
+ margin-left: 4em;
+ font-size: 0.9em;
+}
+div.toclevel4 {
+ margin-left: 6em;
+ font-size: 0.9em;
+}
+include1::./stylesheets/xhtml11-manpage.css[]
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
@@ -255,6 +300,9 @@ div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}
+
+/* IE6 sets dynamically generated links as visited. */
+div#toc a:visited { color: blue; }
</style>
<title>git-filter-branch(1)</title>
</head>
@@ -280,34 +328,34 @@ git-filter-branch(1) Manual Page
[--original &lt;namespace&gt;] [-d &lt;directory&gt;] [-f | --force]
[&lt;rev-list options&gt;&#8230;]</div></div>
</div>
-<h2>DESCRIPTION</h2>
+<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
-<p>Lets you rewrite git revision history by rewriting the branches mentioned
+<div class="para"><p>Lets you rewrite git revision history by rewriting the branches mentioned
in the &lt;rev-list options&gt;, applying custom filters on each revision.
Those filters can modify each tree (e.g. removing a file or running
a perl rewrite on all files) or information about each commit.
Otherwise, all information (including original commit times or merge
-information) will be preserved.</p>
-<p>The command will only rewrite the _positive_ refs mentioned in the
+information) will be preserved.</p></div>
+<div class="para"><p>The command will only rewrite the <em>positive</em> refs mentioned in the
command line (e.g. if you pass <em>a..b</em>, only <em>b</em> will be rewritten).
If you specify no filters, the commits will be recommitted without any
changes, which would normally have no effect. Nevertheless, this may be
useful in the future for compensating for some git bugs or such,
-therefore such a usage is permitted.</p>
-<p><strong>WARNING</strong>! The rewritten history will have different object names for all
+therefore such a usage is permitted.</p></div>
+<div class="para"><p><strong>WARNING</strong>! The rewritten history will have different object names for all
the objects and will not converge with the original branch. You will not
be able to easily push and distribute the rewritten branch on top of the
original branch. Please do not use this command if you do not know the
full implications, and avoid using it anyway, if a simple single commit
-would suffice to fix your problem.</p>
-<p>Always verify that the rewritten version is correct: The original refs,
+would suffice to fix your problem.</p></div>
+<div class="para"><p>Always verify that the rewritten version is correct: The original refs,
if different from the rewritten ones, will be stored in the namespace
-<em>refs/original/</em>.</p>
-<p>Note that since this operation is very I/O expensive, it might
+<em>refs/original/</em>.</p></div>
+<div class="para"><p>Note that since this operation is very I/O expensive, it might
be a good idea to redirect the temporary directory off-disk with the
-<em>-d</em> option, e.g. on tmpfs. Reportedly the speedup is very noticeable.</p>
-<h3>Filters</h3>
-<p>The filters are applied in the order as listed below. The &lt;command&gt;
+<em>-d</em> option, e.g. on tmpfs. Reportedly the speedup is very noticeable.</p></div>
+<h3 id="_filters">Filters</h3><div style="clear:left"></div>
+<div class="para"><p>The filters are applied in the order as listed below. The &lt;command&gt;
argument is always evaluated in the shell context using the <em>eval</em> command
(with the notable exception of the commit filter, for technical reasons).
Prior to that, the $GIT_COMMIT environment variable will be set to contain
@@ -316,16 +364,16 @@ GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,
and GIT_COMMITTER_DATE are set according to the current commit. The values
of these variables after the filters have run, are used for the new commit.
If any evaluation of &lt;command&gt; returns a non-zero exit status, the whole
-operation will be aborted.</p>
-<p>A <em>map</em> function is available that takes an "original sha1 id" argument
+operation will be aborted.</p></div>
+<div class="para"><p>A <em>map</em> function is available that takes an "original sha1 id" argument
and outputs a "rewritten sha1 id" if the commit has been already
rewritten, and "original sha1 id" otherwise; the <em>map</em> function can
return several ids on separate lines if your commit filter emitted
-multiple commits.</p>
+multiple commits.</p></div>
</div>
-<h2>OPTIONS</h2>
+<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
-<dl>
+<div class="vlist"><dl>
<dt>
--env-filter &lt;command&gt;
</dt>
@@ -392,17 +440,17 @@ multiple commits.</p>
<p>
This is the filter for performing the commit.
If this filter is specified, it will be called instead of the
- <tt>git-commit-tree</tt> command, with arguments of the form
+ <em>git-commit-tree</em> command, with arguments of the form
"&lt;TREE_ID&gt; [-p &lt;PARENT_COMMIT_ID&gt;]&#8230;" and the log message on
stdin. The commit id is expected on stdout.
</p>
-<p>As a special extension, the commit filter may emit multiple
+<div class="para"><p>As a special extension, the commit filter may emit multiple
commit ids; in that case, the rewritten children of the original commit will
-have all of them as parents.</p>
-<p>You can use the <em>map</em> convenience function in this filter, and other
+have all of them as parents.</p></div>
+<div class="para"><p>You can use the <em>map</em> convenience function in this filter, and other
convenience functions, too. For example, calling <em>skip_commit "$@"</em>
will leave out the current commit (but not its changes! If you want
-that, use <tt>git-rebase</tt> instead).</p>
+that, use <em>git-rebase</em> instead).</p></div>
</dd>
<dt>
--tag-name-filter &lt;command&gt;
@@ -415,11 +463,11 @@ that, use <tt>git-rebase</tt> instead).</p>
The original tag name is passed via standard input, and the new
tag name is expected on standard output.
</p>
-<p>The original tags are not deleted, but can be overwritten;
+<div class="para"><p>The original tags are not deleted, but can be overwritten;
use "--tag-name-filter cat" to simply update the tags. In this
case, be very careful and make sure you have the old tags
-backed up in case the conversion has run afoul.</p>
-<p>Nearly proper rewriting of tag objects is supported. If the tag has
+backed up in case the conversion has run afoul.</p></div>
+<div class="para"><p>Nearly proper rewriting of tag objects is supported. If the tag has
a message attached, a new tag object will be created with the same message,
author, and timestamp. If the tag has a signature attached, the
signature will be stripped. It is by definition impossible to preserve
@@ -428,7 +476,7 @@ the tag did not change (points to the same object, has the same name, etc.)
it should retain any signature. That is not the case, signatures will always
be removed, buyer beware. There is also no support for changing the
author or timestamp (or the tag message for that matter). Tags which point
-to other tags will be rewritten to point to the underlying commit.</p>
+to other tags will be rewritten to point to the underlying commit.</p></div>
</dd>
<dt>
--subdirectory-filter &lt;directory&gt;
@@ -470,7 +518,7 @@ to other tags will be rewritten to point to the underlying commit.</p>
</dt>
<dd>
<p>
- <tt>git filter-branch</tt> refuses to start with an existing temporary
+ <em>git-filter-branch</em> refuses to start with an existing temporary
directory or when there are already refs starting with
<em>refs/original/</em>, unless forced.
</p>
@@ -481,53 +529,53 @@ to other tags will be rewritten to point to the underlying commit.</p>
<dd>
<p>
When options are given after the new branch name, they will
- be passed to <tt>git-rev-list</tt>. Only commits in the resulting
+ be passed to <em>git-rev-list</em>. Only commits in the resulting
output will be filtered, although the filtered commits can still
reference parents which are outside of that set.
</p>
</dd>
-</dl>
+</dl></div>
</div>
-<h2>Examples</h2>
+<h2 id="_examples">Examples</h2>
<div class="sectionbody">
-<p>Suppose you want to remove a file (containing confidential information
-or copyright violation) from all commits:</p>
+<div class="para"><p>Suppose you want to remove a file (containing confidential information
+or copyright violation) from all commits:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --tree-filter 'rm filename' HEAD</tt></pre>
</div></div>
-<p>However, if the file is absent from the tree of some commit,
+<div class="para"><p>However, if the file is absent from the tree of some commit,
a simple <tt>rm filename</tt> will fail for that tree and commit.
-Thus you may instead want to use <tt>rm -f filename</tt> as the script.</p>
-<p>A significantly faster version:</p>
+Thus you may instead want to use <tt>rm -f filename</tt> as the script.</p></div>
+<div class="para"><p>A significantly faster version:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --index-filter 'git update-index --remove filename' HEAD</tt></pre>
</div></div>
-<p>Now, you will get the rewritten history saved in HEAD.</p>
-<p>To set a commit (which typically is at the tip of another
+<div class="para"><p>Now, you will get the rewritten history saved in HEAD.</p></div>
+<div class="para"><p>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:</p>
+order to paste the other history behind the current history:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --parent-filter 'sed "s/^\$/-p &lt;graft-id&gt;/"' HEAD</tt></pre>
</div></div>
-<p>(if the parent string is empty - which happens when we are dealing with
+<div class="para"><p>(if the parent string is empty - which happens when we are dealing with
the initial commit - add graftcommit as a parent). Note that this assumes
history with a single root (that is, no merge without common ancestors
-happened). If this is not the case, use:</p>
+happened). If this is not the case, use:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --parent-filter \
'test $GIT_COMMIT = &lt;commit-id&gt; &amp;&amp; echo "-p &lt;graft-id&gt;" || cat' HEAD</tt></pre>
</div></div>
-<p>or even simpler:</p>
+<div class="para"><p>or even simpler:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>echo "$commit-id $graft-id" &gt;&gt; .git/info/grafts
git filter-branch $graft-id..HEAD</tt></pre>
</div></div>
-<p>To remove commits authored by "Darl McBribe" from the history:</p>
+<div class="para"><p>To remove commits authored by "Darl McBribe" from the history:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --commit-filter '
@@ -538,7 +586,7 @@ git filter-branch $graft-id..HEAD</tt></pre>
git commit-tree "$@";
fi' HEAD</tt></pre>
</div></div>
-<p>The function <em>skip_commit</em> is defined as follows:</p>
+<div class="para"><p>The function <em>skip_commit</em> is defined as follows:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>skip_commit()
@@ -552,47 +600,47 @@ git filter-branch $graft-id..HEAD</tt></pre>
done;
}</tt></pre>
</div></div>
-<p>The shift magic first throws away the tree id and then the -p
+<div class="para"><p>The shift magic first throws away the tree id and then the -p
parameters. Note that this handles merges properly! In case Darl
committed a merge between P1 and P2, it will be propagated properly
and all children of the merge will become merge commits with P1,P2
-as their parents instead of the merge commit.</p>
-<p>You can rewrite the commit log messages using <tt>--msg-filter</tt>. For
-example, <tt>git-svn-id</tt> strings in a repository created by <tt>git-svn</tt> can
-be removed this way:</p>
+as their parents instead of the merge commit.</p></div>
+<div class="para"><p>You can rewrite the commit log messages using <tt>--msg-filter</tt>. For
+example, <em>git-svn-id</em> strings in a repository created by <em>git-svn</em> can
+be removed this way:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --msg-filter '
sed -e "/^git-svn-id:/d"
'</tt></pre>
</div></div>
-<p>To restrict rewriting to only part of the history, specify a revision
+<div class="para"><p>To restrict rewriting to only part of the history, specify a revision
range in addition to the new branch name. The new branch name will
-point to the top-most revision that a <tt>git-rev-list</tt> of this range
-will print.</p>
-<p><strong>NOTE</strong> the changes introduced by the commits, and which are not reverted
+point to the top-most revision that a <em>git-rev-list</em> of this range
+will print.</p></div>
+<div class="para"><p><strong>NOTE</strong> the changes introduced by the commits, and which are not reverted
by subsequent commits, will still be in the rewritten branch. If you want
-to throw out _changes_ together with the commits, you should use the
-interactive mode of <tt>git-rebase</tt>.</p>
-<p>Consider this history:</p>
+to throw out <em>changes</em> together with the commits, you should use the
+interactive mode of <em>git-rebase</em>.</p></div>
+<div class="para"><p>Consider this history:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt> D--E--F--G--H
/ /
A--B-----C</tt></pre>
</div></div>
-<p>To rewrite only commits D,E,F,G,H, but leave A, B and C alone, use:</p>
+<div class="para"><p>To rewrite only commits D,E,F,G,H, but leave A, B and C alone, use:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch ... C..H</tt></pre>
</div></div>
-<p>To rewrite commits E,F,G,H, use one of these:</p>
+<div class="para"><p>To rewrite commits E,F,G,H, use one of these:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch ... C..H --not D
git filter-branch ... D..H --not C</tt></pre>
</div></div>
-<p>To move the whole tree into a subdirectory, or remove it from there:</p>
+<div class="para"><p>To move the whole tree into a subdirectory, or remove it from there:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>git filter-branch --index-filter \
@@ -602,22 +650,22 @@ git filter-branch ... D..H --not C</tt></pre>
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD</tt></pre>
</div></div>
</div>
-<h2>Author</h2>
+<h2 id="_author">Author</h2>
<div class="sectionbody">
-<p>Written by Petr "Pasky" Baudis &lt;pasky@suse.cz&gt;,
-and the git list &lt;git@vger.kernel.org&gt;</p>
+<div class="para"><p>Written by Petr "Pasky" Baudis &lt;pasky@suse.cz&gt;,
+and the git list &lt;git@vger.kernel.org&gt;</p></div>
</div>
-<h2>Documentation</h2>
+<h2 id="_documentation">Documentation</h2>
<div class="sectionbody">
-<p>Documentation by Petr Baudis and the git list.</p>
+<div class="para"><p>Documentation by Petr Baudis and the git list.</p></div>
</div>
-<h2>GIT</h2>
+<h2 id="_git">GIT</h2>
<div class="sectionbody">
-<p>Part of the <a href="git.html">git(1)</a> suite</p>
+<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 02-Jul-2008 03:01:45 UTC
+Last updated 2008-07-06 05:16:46 UTC
</div>
</div>
</body>