[PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions

2012-10-18 Thread Jeff King
This saves us some code, but it also reduces the number of processes we start for each filtered commit. Since we can parse both author and committer in the same sed invocation, we save one process. And since the new interface avoids tr, we save 4 processes. It also avoids using tr, which has had

Re: [PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions

2012-10-18 Thread Johannes Sixt
Am 10/18/2012 9:25, schrieb Jeff King: -# When piped a commit, output a script to set the ident of either -# author or committer +# Ensure non-empty id name. +fallback_name() { + echo case \\$GIT_$1_NAME\ in \\) GIT_$1_NAME=\\${GIT_$1_EMAIL%%@*}\ export GIT_$1_NAME;; esac +}

Re: [PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions

2012-10-18 Thread Jeff King
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

Re: [PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions

2012-10-18 Thread Jeff King
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?

Re: [PATCH 2/2] filter-branch: use git-sh-setup's ident parsing functions

2012-10-18 Thread Jeff King
On Thu, Oct 18, 2012 at 06:22:17AM -0400, Jeff King wrote: Hrm. We _do_ test this in t7003. Weirder, if I instrument filter-branch like this: [...] 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... Oh, I see.