<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-filter-branch.sh, branch v2.8.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.8.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.8.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-01-29T00:10:12Z</updated>
<entry>
<title>Merge branch 'jk/filter-branch-no-index'</title>
<updated>2016-01-29T00:10:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-01-29T00:10:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a2ec9484c1517305e2e28d64d8d77642f05e9a02'/>
<id>urn:sha1:a2ec9484c1517305e2e28d64d8d77642f05e9a02</id>
<content type='text'>
A recent optimization to filter-branch in v2.7.0 introduced a
regression when --prune-empty filter is used, which has been
corrected.

* jk/filter-branch-no-index:
  filter-branch: resolve $commit^{tree} in no-index case
</content>
</entry>
<entry>
<title>filter-branch: resolve $commit^{tree} in no-index case</title>
<updated>2016-01-19T22:20:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-01-19T22:07:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1dc413ebe52bd5dffed63d69a0a239b7fb6ef699'/>
<id>urn:sha1:1dc413ebe52bd5dffed63d69a0a239b7fb6ef699</id>
<content type='text'>
Commit 348d4f2 (filter-branch: skip index read/write when
possible, 2015-11-06) taught filter-branch to optimize out
the final "git write-tree" when we know we haven't touched
the tree with any of our filters. It does by simply putting
the literal text "$commit^{tree}" into the "$tree" variable,
avoiding a useless rev-parse call.

However, when we pass this to git_commit_non_empty_tree(),
it gets confused; it resolves "$commit^{tree}" itself, and
compares our string to the 40-hex sha1, which obviously
doesn't match. As a result, "--prune-empty" (or any custom
filter using git_commit_non_empty_tree) will fail to drop
an empty commit (when filter-branch is used without a tree
or index filter).

Let's resolve $tree to the 40-hex ourselves, so that
git_commit_non_empty_tree can work. Unfortunately, this is a
bit slower due to the extra process overhead:

  $ cd t/perf &amp;&amp; ./run 348d4f2 HEAD p7000-filter-branch.sh
  [...]
  Test                  348d4f2           HEAD
  --------------------------------------------------------------
  7000.2: noop filter   3.76(0.24+0.26)   4.54(0.28+0.24) +20.7%

We could try to make git_commit_non_empty_tree more clever.
However, the value of $tree here is technically
user-visible. The user can provide arbitrary shell code at
this stage, which could itself have a similar assumption to
what is in git_commit_non_empty_tree. So the conservative
choice to fix this regression is to take the 20% hit and
give the pre-348d4f2 behavior. We still end up much faster
than before the optimization:

  $ cd t/perf &amp;&amp; ./run 348d4f2^ HEAD p7000-filter-branch.sh
  [...]
  Test                  348d4f2^          HEAD
  --------------------------------------------------------------
  7000.2: noop filter   9.51(4.32+0.40)   4.51(0.28+0.23) -52.6%

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/filter-branch-no-index'</title>
<updated>2015-12-04T19:19:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-12-04T19:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e5adec97a65ce8c2c803b9e1cbb1c0d067e7e47'/>
<id>urn:sha1:2e5adec97a65ce8c2c803b9e1cbb1c0d067e7e47</id>
<content type='text'>
Speed up filter-branch for cases where we only care about rewriting
commits, not tree data.

* jk/filter-branch-no-index:
  filter-branch: skip index read/write when possible
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2015-12-01T22:32:38Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-12-01T22:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40fdcc535783f5c64e6aba9f4b2d2c8997c55a8d'/>
<id>urn:sha1:40fdcc535783f5c64e6aba9f4b2d2c8997c55a8d</id>
<content type='text'>
* maint:
  http: treat config options sslCAPath and sslCAInfo as paths
  Documentation/diff: give --word-diff-regex=. example
  filter-branch: deal with object name vs. pathname ambiguity in tree-filter
  check-ignore: correct documentation about output
  git-p4: clean up after p4 submit failure
  git-p4: work with a detached head
  git-p4: add option to system() to return subshell status
  git-p4: add failing test for submit from detached head
  remote-http(s): support SOCKS proxies
  t5813: avoid creating urls that break on cygwin
  Escape Git's exec path in contrib/rerere-train.sh script
  allow hooks to ignore their standard input stream
  rebase-i-exec: Allow space in SHELL_PATH
  Documentation: make environment variable formatting more consistent
</content>
</entry>
<entry>
<title>filter-branch: deal with object name vs. pathname ambiguity in tree-filter</title>
<updated>2015-11-24T23:37:50Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder@ira.uka.de</email>
</author>
<published>2015-11-23T12:23:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d2a3646d1f0285ce072cdfe34a7df64710f9357'/>
<id>urn:sha1:4d2a3646d1f0285ce072cdfe34a7df64710f9357</id>
<content type='text'>
'git filter-branch' fails complaining about an ambiguous argument, if
a tree-filter renames a path and the new pathname happens to match an
existing object name.

After the tree-filter has been applied, 'git filter-branch' looks for
changed paths by running:

  git diff-index -r --name-only --ignore-submodules $commit

which then, because of the lack of disambiguating double-dash, can't
decide whether to treat '$commit' as revision or path and errors out.

Add that disambiguating double-dash after 'git diff-index's revision
argument to make sure that '$commit' is interpreted as a revision.

Signed-off-by: SZEDER Gábor &lt;szeder@ira.uka.de&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>filter-branch: skip index read/write when possible</title>
<updated>2015-11-06T17:35:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-11-06T06:24:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=348d4f2fc5d3c4f7ba47079b96676b4e2dd831fc'/>
<id>urn:sha1:348d4f2fc5d3c4f7ba47079b96676b4e2dd831fc</id>
<content type='text'>
If the user specifies an index filter but not a tree filter,
filter-branch cleverly avoids checking out the tree
entirely. But we don't do the next level of optimization: if
you have no index or tree filter, we do not need to read the
index at all.

This can greatly speed up cases where we are only changing
the commit objects (e.g., cementing a graft into place).
Here are numbers from the newly-added perf test:

  Test                  HEAD^              HEAD
  ---------------------------------------------------------------
  7000.2: noop filter   13.81(4.95+0.83)   5.43(0.42+0.43) -60.7%

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'</title>
<updated>2015-10-16T21:42:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-16T21:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1551511bdbeb893a604234130544dda11ab8488d'/>
<id>urn:sha1:1551511bdbeb893a604234130544dda11ab8488d</id>
<content type='text'>
A recent "filter-branch --msg-filter" broke skipping of the commit
object header, which is fixed.

* jk/filter-branch-use-of-sed-on-incomplete-line:
  filter-branch: remove multi-line headers in msg filter
</content>
</entry>
<entry>
<title>filter-branch: remove multi-line headers in msg filter</title>
<updated>2015-10-12T18:23:19Z</updated>
<author>
<name>James McCoy</name>
<email>vega.james@gmail.com</email>
</author>
<published>2015-10-09T00:21:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5a4b3ff4d73be736984fd499551b1b0c10d33a1'/>
<id>urn:sha1:a5a4b3ff4d73be736984fd499551b1b0c10d33a1</id>
<content type='text'>
df062010 (filter-branch: avoid passing commit message through sed)
introduced a regression when filtering commits with multi-line headers,
if the header contains a blank line.  An example of this is a gpg-signed
commit:

  $ git cat-file commit signed-commit
  tree 3d4038e029712da9fc59a72afbfcc90418451630
  parent 110eac945dc1713b27bdf49e74e5805db66971f0
  author A U Thor &lt;author@example.com&gt; 1112912413 -0700
  committer C O Mitter &lt;committer@example.com&gt; 1112912413 -0700
  gpgsig -----BEGIN PGP SIGNATURE-----
   Version: GnuPG v1

   iEYEABECAAYFAlYXADwACgkQE7b1Hs3eQw23CACgldB/InRyDgQwyiFyMMm3zFpj
   pUsAnA+f3aMUsd9mNroloSmlOgL6jIMO
   =0Hgm
   -----END PGP SIGNATURE-----

  Adding gpg

As a consequence, "filter-branch --msg-filter cat" (which should leave the
commit message unchanged) spills the signature (after the internal blank
line) into the original commit message.

The reason is that although the signature is indented, making the line a
whitespace only line, the "read" call is splitting the line based on
the shell's IFS, which defaults to &lt;space&gt;&lt;tab&gt;&lt;newline&gt;.  The leading
space is consumed and $header_line is empty, causing the "skip header
lines" loop to exit.

The rest of the commit object is then re-used as the rewritten commit
message, causing the new message to include the signature of the
original commit.

Set IFS to an empty string for the "read" call, thus disabling the word
splitting, which causes $header_line to be set to the non-empty value ' '.
This allows the loop to fully consume the header lines before
emitting the original, intact commit message.

[jc: this is literally based on MJG's suggestion]

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: James McCoy &lt;vega.james@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch: make report-progress more readable</title>
<updated>2015-09-21T22:19:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-21T22:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71400d97b12abeba25f2e8245a9751daf8583142'/>
<id>urn:sha1:71400d97b12abeba25f2e8245a9751daf8583142</id>
<content type='text'>
The name of some variables that are used very locally in this
function were overly long; they were making the lines harder to read
and the longer names didn't add much more information.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch: add passed/remaining seconds on progress</title>
<updated>2015-09-21T22:19:06Z</updated>
<author>
<name>Gabor Bernat</name>
<email>gabor.bernat@gravityrd.com</email>
</author>
<published>2015-09-07T13:52:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a9d16a0a80ef53c1fcc0f6bc3d1d24d21961272'/>
<id>urn:sha1:6a9d16a0a80ef53c1fcc0f6bc3d1d24d21961272</id>
<content type='text'>
adds seconds progress and estimated seconds time if getting the current
timestamp is supported by the date +%s command

Signed-off-by: Gabor Bernat &lt;gabor.bernat@gravityrd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
