Re: What can cause empty GIT_AUTHOR_NAME for 'git filter-branch --tree-filter' on Solaris?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 17, 2012 at 10:47:29AM +0400, Ilya Basin wrote:

> The filter-branch command, the contents of ~/.gitconfig and the tree
> are the same.
> The command succeeds on cygwin, but fails on Solaris due to
> unset GIT_AUTHOR_NAME and GIT_COMMITTER_NAME :

That shouldn't happen. The likely culprit is that the sed magic in the
set_ident function of git-filter-branch is not portable to your version
of sed.

What happens if you run this:

	echo 'author Your Name <you@xxxxxxxxxxx> 1350408529 -0400' >commit
	set -- author
	lid="$(echo "$1" | tr "[A-Z]" "[a-z]")"
	uid="$(echo "$1" | tr "[a-z]" "[A-Z]")"
        pick_id_script='
                /^'$lid' /{
                        s/'\''/'\''\\'\'\''/g
                        h
                        s/^'$lid' \([^<]*\) <[^>]*> .*$/\1/
                        s/'\''/'\''\'\'\''/g
                        s/.*/GIT_'$uid'_NAME='\''&'\''; export GIT_'$uid'_NAME/p

                        g
                        s/^'$lid' [^<]* <\([^>]*\)> .*$/\1/
                        s/'\''/'\''\'\'\''/g
                        s/.*/GIT_'$uid'_EMAIL='\''&'\''; export GIT_'$uid'_EMAIL/p

                        g
                        s/^'$lid' [^<]* <[^>]*> \(.*\)$/@\1/
                        s/'\''/'\''\'\'\''/g
                        s/.*/GIT_'$uid'_DATE='\''&'\''; export GIT_'$uid'_DATE/p

                        q
                }
        '
        LANG=C LC_ALL=C sed -ne "$pick_id_script" <commit

in your shell? You should get:

  GIT_AUTHOR_NAME='Your Name'; export GIT_AUTHOR_NAME
  GIT_AUTHOR_EMAIL='you@xxxxxxxxxxx'; export GIT_AUTHOR_EMAIL
  GIT_AUTHOR_DATE='@1350408529 -0400'; export GIT_AUTHOR_DATE

> I use git 1.7.6, from sunfreeware.

It might also be worth testing v1.7.12, but reading the logs, I don't
think there has been any meaningful update to filter-branch since then.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]