<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-filter-branch.sh, branch v1.6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-04-23T02:05:37Z</updated>
<entry>
<title>Convert to use quiet option when available</title>
<updated>2009-04-23T02:05:37Z</updated>
<author>
<name>Dan Loewenherz</name>
<email>daniel.loewenherz@yale.edu</email>
</author>
<published>2009-04-23T01:46:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7bd93c1c625ce5fa03f0d13d728f34f8ab868991'/>
<id>urn:sha1:7bd93c1c625ce5fa03f0d13d728f34f8ab868991</id>
<content type='text'>
A minor fix that eliminates usage of "2&gt;/dev/null" when --quiet or
-q has already been implemented.

Signed-off-by: Dan Loewenherz &lt;daniel.loewenherz@yale.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-filter-branch: avoid collisions with variables in eval'ed commands</title>
<updated>2009-03-25T23:35:52Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2009-03-25T21:51:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d5b0c97d138201c59b30cb759cedabb70b7bae81'/>
<id>urn:sha1:d5b0c97d138201c59b30cb759cedabb70b7bae81</id>
<content type='text'>
Avoid using simple variable names like 'i', since user commands are eval'ed
and may clash with and overwrite our values.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Acked-by: Petr Baudis &lt;pasky@suse.cz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Improve error message for git-filter-branch</title>
<updated>2009-03-04T08:56:52Z</updated>
<author>
<name>John Tapsell</name>
<email>johnflux@gmail.com</email>
</author>
<published>2009-02-19T07:36:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=734cd5726cf0f16fcbdc2fc121df23814513c420'/>
<id>urn:sha1:734cd5726cf0f16fcbdc2fc121df23814513c420</id>
<content type='text'>
Tell the user that a backup (original) already exists, and how to solve
this problem (with -f option)

Signed-off-by: John Tapsell &lt;johnflux@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch -d: Export GIT_DIR earlier</title>
<updated>2009-02-18T19:15:17Z</updated>
<author>
<name>Lars Noschinski</name>
<email>lars@public.noschinski.de</email>
</author>
<published>2009-02-18T08:35:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=88e38808cd52aaed327a82d6a6ffdb8b9da621f2'/>
<id>urn:sha1:88e38808cd52aaed327a82d6a6ffdb8b9da621f2</id>
<content type='text'>
The improved error handling catches a bug in filter-branch when using
-d pointing to a path outside any git repository:

$ git filter-branch -d /tmp/foo master
fatal: Not a git repository (or any of the parent directories): .git

This error message comes from git for-each-ref in line 224. GIT_DIR is
set correctly by git-sh-setup (to the foo.git repository), but not
exported (yet).

Signed-off-by: Lars Noschinski &lt;lars@public.noschinski.de&gt;
Acked-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch: Add more error-handling</title>
<updated>2009-02-12T02:26:52Z</updated>
<author>
<name>Eric Kidd</name>
<email>git@randomhacks.net</email>
</author>
<published>2009-02-11T21:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ea29cce4d099d2fa6613ec66c080776cfe869d5'/>
<id>urn:sha1:0ea29cce4d099d2fa6613ec66c080776cfe869d5</id>
<content type='text'>
9273b56 (filter-branch: Fix fatal error on bare repositories, 2009-02-03)
fixed a missing check of return status from an underlying command in
git-filter-branch, but there still are places that do not check errors.
For example, the command does not pay attention to the exit status of the
command given by --commit-filter.  It should abort in such a case.

This attempts to fix all the remaining places that fails to checks errors.

In two places, I've had to break apart pipelines in order to check the
error code for the first stage of the pipeline, as discussed here:

  http://kerneltrap.org/mailarchive/git/2009/1/28/4835614

Feedback on this patch was provided by Johannes Sixt, Johannes Schindelin
and Junio C Hamano.  Thomas Rast helped with pipeline error handling.

Signed-off-by: Eric Kidd &lt;git@randomhacks.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/filter-branch-submodule'</title>
<updated>2009-02-07T19:09:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-02-07T19:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df4364a42981dec067dbacfd6371d4ca910df48e'/>
<id>urn:sha1:df4364a42981dec067dbacfd6371d4ca910df48e</id>
<content type='text'>
* js/filter-branch-submodule:
  filter-branch: do not consider diverging submodules a 'dirty worktree'
  filter-branch: Fix fatal error on bare repositories
</content>
</entry>
<entry>
<title>filter-branch: do not consider diverging submodules a 'dirty worktree'</title>
<updated>2009-02-06T01:48:04Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2009-02-05T18:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26be15f09db15d2b53a13d0f184d77fb54367f33'/>
<id>urn:sha1:26be15f09db15d2b53a13d0f184d77fb54367f33</id>
<content type='text'>
At the end of filter-branch in a non-bare repository, the work tree is
updated with "read-tree -m -u HEAD", to carry the change forward in case
the current branch was rewritten.  In order to avoid losing any local
change during this step, filter-branch refuses to work when there are
local changes in the work tree.

This "read-tree -m -u HEAD" operation does not affect what commit is
checked out in a submodule (iow, it does not touch .git/HEAD in a
submodule checkout), and checking if there is any local change to the
submodule is not useful.

Staged submodules _are_ considered to be 'dirty', however,  as the
"read-tree -m -u HEAD" could result in loss of staged information
otherwise.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch: Fix fatal error on bare repositories</title>
<updated>2009-02-04T05:54:02Z</updated>
<author>
<name>Eric Kidd</name>
<email>git@randomhacks.net</email>
</author>
<published>2009-02-03T18:27:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9273b56278e64dd47b1a96a705ddf46aeaf6afe3'/>
<id>urn:sha1:9273b56278e64dd47b1a96a705ddf46aeaf6afe3</id>
<content type='text'>
When git filter-branch is run on a bare repository, it prints out a fatal
error message:

  $ git filter-branch branch
  Rewrite 476c4839280c219c2317376b661d9d95c1727fc3 (9/9)
  WARNING: Ref 'refs/heads/branch' is unchanged
  fatal: This operation must be run in a work tree

Note that this fatal error message doesn't prevent git filter-branch from
exiting successfully. (Why doesn't git filter-branch actually exit with an
error when a shell command fails? I'm not sure why it was designed this
way.)

This error message is caused by the following section of code at the end of
git-filter-branch.sh:

  if [ "$(is_bare_repository)" = false ]; then
          unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
          test -z "$ORIG_GIT_DIR" || {
                  GIT_DIR="$ORIG_GIT_DIR" &amp;&amp; export GIT_DIR
          }
          ... elided ...
          git read-tree -u -m HEAD
  fi

The problem is the call to $(is_bare_repository), which is made before
GIT_DIR and GIT_WORK_TREE are restored.  This call always returns "false",
even when we're running in a bare repository.  But this means that we will
attempt to call 'git read-tree' even in a bare repository, which will fail
and print an error.

This patch modifies git-filter-branch.sh to restore the original
environment variables before trying to call is_bare_repository.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch: add git_commit_non_empty_tree and --prune-empty.</title>
<updated>2009-01-11T01:35:58Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2008-10-31T09:12:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3240d935c4b844db71e4570eeedfac4cff73f78'/>
<id>urn:sha1:d3240d935c4b844db71e4570eeedfac4cff73f78</id>
<content type='text'>
git_commit_non_empty_tree is added to the functions that can be run from
commit filters. Its effect is to commit only commits actually touching the
tree and that are not merge points either.

The option --prune-empty is added. It defaults the commit-filter to
'git_commit_non_empty_tree "$@"', and can be used with any other
combination of filters, except --commit-hook that must used
'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"'
usually to achieve the same result.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter-branch: use git rev-parse -q</title>
<updated>2008-12-03T22:27:17Z</updated>
<author>
<name>Miklos Vajna</name>
<email>vmiklos@frugalware.org</email>
</author>
<published>2008-12-03T13:26:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d69da76dd0bc352e358c4beb5eb3aae5588c99de'/>
<id>urn:sha1:d69da76dd0bc352e358c4beb5eb3aae5588c99de</id>
<content type='text'>
Signed-off-by: Miklos Vajna &lt;vmiklos@frugalware.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
