From: Jeff King <peff@peff.net>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Junio C Hamano <gitster@pobox.com>,
Ilya Basin <basinilya@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions
Date: Thu, 18 Oct 2012 06:22:17 -0400 [thread overview]
Message-ID: <20121018102217.GA17332@sigill.intra.peff.net> (raw)
In-Reply-To: <20121018075429.GD9999@sigill.intra.peff.net>
On Thu, Oct 18, 2012 at 03:54:29AM -0400, Jeff King wrote:
> On Thu, Oct 18, 2012 at 09:49:04AM +0200, Johannes Sixt wrote:
>
> > > - s/.*/GIT_'$uid'_NAME='\''&'\''; export GIT_'$uid'_NAME/p
> >
> > Didn't you lose the export GIT_$uid_{NAME,EMAIL,DATE} parts somewhere on
> > the way?
>
> Yikes, you're right. I didn't even notice, as the test suite still
> passes. I can see how the env filter would still be able to see the
> variables, but the commit-tree call wouldn't. I guess it happens to work
> because we do not test alternate idents in our filter branch tests (IOW,
> we are silently rewriting each commit during the filter-branch, but it
> happens to have the same identities).
Hrm. We _do_ test this in t7003. Weirder, if I instrument filter-branch
like this:
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 69406ae..1b504ce 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -298,8 +298,13 @@ while read commit parents; do
git cat-file commit "$commit" >../commit ||
die "Cannot read commit $commit"
+ echo >&2 pre: $GIT_AUTHOR_NAME
+ sh -c 'echo >&2 pre, subshell: $GIT_AUTHOR_NAME'
+
eval "$(set_ident <../commit)" ||
die "setting author/committer failed for commit $commit"
+ echo >&2 post: $GIT_AUTHOR_NAME
+ sh -c 'echo >&2 post, subshell: $GIT_AUTHOR_NAME'
eval "$filter_env" < /dev/null ||
die "env filter failed: $filter_env"
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 4d13e10..ce57fc5 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -174,6 +174,8 @@ test_expect_success 'author information is preserved' '
test 1 = $(git rev-list --author="B V Uips" preserved-author | wc -l)
'
+test_done
+
test_expect_success "remove a certain author's commits" '
echo i > i &&
test_tick &&
and run t7003, it shows that the variable is properly exported to the
sub-process! But I can't seem to figure out why. Confused...
-Peff
next prev parent reply other threads:[~2012-10-18 10:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 6:47 What can cause empty GIT_AUTHOR_NAME for 'git filter-branch --tree-filter' on Solaris? Ilya Basin
2012-10-17 7:18 ` Jeff King
2012-10-17 7:23 ` Johannes Sixt
2012-10-17 8:58 ` Re[2]: " Ilya Basin
2012-10-17 10:36 ` Re[3]: " Ilya Basin
2012-10-17 22:13 ` Jeff King
2012-10-17 22:09 ` Jeff King
2012-10-18 5:31 ` Johannes Sixt
2012-10-18 5:36 ` Jeff King
2012-10-18 6:06 ` Junio C Hamano
2012-10-18 6:08 ` Jeff King
2012-10-18 7:22 ` [PATCH 0/2] clean up filter-branch ident parsing Jeff King
2012-10-18 7:25 ` [PATCH 1/2] git-sh-setup: refactor ident-parsing functions Jeff King
2012-11-12 17:44 ` Junio C Hamano
2012-11-12 19:44 ` Jeff King
2012-11-12 20:08 ` Junio C Hamano
2012-11-12 20:12 ` Jeff King
2012-11-12 20:32 ` Junio C Hamano
2012-10-18 7:25 ` [PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions Jeff King
2012-10-18 7:49 ` Johannes Sixt
2012-10-18 7:54 ` Jeff King
2012-10-18 10:22 ` Jeff King [this message]
2012-10-18 10:26 ` Jeff King
2012-10-18 10:33 ` [PATCHv2 " Jeff King
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=20121018102217.GA17332@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=basinilya@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
/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).