# filter-branch --env-filter GIT_AUTHOR_DATE

6 messages from 2011-01-18 to 2011-01-19. Participants: Tuncer Ayaz, Johannes Sixt.
Thread: https://gitlist.dev/t/26300

## Tuncer Ayaz, 2011-01-18 16:43

Subject: filter-branch --env-filter GIT_AUTHOR_DATE
Message-ID: <AANLkTinx7cs6YTvSTTv-njHA+vk264u1EaJettSdBF9U@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinx7cs6YTvSTTv-njHA%2Bvk264u1EaJettSdBF9U%40mail.gmail.com

```
To fix invalid timezone info in a repo I ran
git filter-branch --env-filter '
  GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0000/-0800/`' HEAD

This fixed the invalid entries but the new timezone is -0700
instead of -0800. Is this expected?

git version 1.7.4.rc2

```

## Johannes Sixt, 2011-01-19 07:01

Subject: Re: filter-branch --env-filter GIT_AUTHOR_DATE
Message-ID: <4D368C49.3080105@viscovery.net>
URL: https://gitlist.dev/e/4D368C49.3080105%40viscovery.net
In-Reply-To: <AANLkTinx7cs6YTvSTTv-njHA+vk264u1EaJettSdBF9U@mail.gmail.com>

```
Am 1/18/2011 17:43, schrieb Tuncer Ayaz:
> To fix invalid timezone info in a repo I ran
> git filter-branch --env-filter '
>   GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0000/-0800/`' HEAD
> 
> This fixed the invalid entries but the new timezone is -0700
> instead of -0800. Is this expected?

Parse error. You fixed it, but it is not fixed? So what?

What do you mean by "the new timezone is"? Do you mean "...is reported
as"? If so, reported by which tools?

> git version 1.7.4.rc2

I tried your command, but the timezone was changed in the expected way.

-- Hannes

```

## Tuncer Ayaz, 2011-01-19 10:08

Subject: Re: filter-branch --env-filter GIT_AUTHOR_DATE
Message-ID: <AANLkTi=TAhYeWbyocag2myBXA2TfH7_r=hmam51YKbhm@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DTAhYeWbyocag2myBXA2TfH7_r%3Dhmam51YKbhm%40mail.gmail.com
In-Reply-To: <4D368C49.3080105@viscovery.net>

```
On Wed, Jan 19, 2011 at 8:01 AM, Johannes Sixt wrote:
> Am 1/18/2011 17:43, schrieb Tuncer Ayaz:
>> To fix invalid timezone info in a repo I ran
>> git filter-branch --env-filter '
>>   GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0000/-0800/`' HEAD
>>
>> This fixed the invalid entries but the new timezone is -0700
>> instead of -0800. Is this expected?
>
> Parse error. You fixed it, but it is not fixed? So what?

Fixed because it is not +0000 anymore. Surprised because the new
timezone is -0700 and not -0800.

> What do you mean by "the new timezone is"? Do you mean "...is reported
> as"? If so, reported by which tools?

git log
git cat-file $REV

>> git version 1.7.4.rc2
>
> I tried your command, but the timezone was changed in the expected way.

How did you check?

```

## Tuncer Ayaz, 2011-01-19 10:12

Subject: Re: filter-branch --env-filter GIT_AUTHOR_DATE
Message-ID: <AANLkTik43suRRzcPdBZMKifxKx8cwi01H+zGvj5nnvWa@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTik43suRRzcPdBZMKifxKx8cwi01H%2BzGvj5nnvWa%40mail.gmail.com
In-Reply-To: <AANLkTi=TAhYeWbyocag2myBXA2TfH7_r=hmam51YKbhm@mail.gmail.com>

```
On Wed, Jan 19, 2011 at 11:08 AM, Tuncer Ayaz wrote:
> git cat-file $REV

To be correct:
git cat-file -p $REV

```

## Johannes Sixt, 2011-01-19 10:32

Subject: Re: filter-branch --env-filter GIT_AUTHOR_DATE
Message-ID: <4D36BDD9.4050108@viscovery.net>
URL: https://gitlist.dev/e/4D36BDD9.4050108%40viscovery.net
In-Reply-To: <AANLkTi=TAhYeWbyocag2myBXA2TfH7_r=hmam51YKbhm@mail.gmail.com>

```
Am 1/19/2011 11:08, schrieb Tuncer Ayaz:
> On Wed, Jan 19, 2011 at 8:01 AM, Johannes Sixt wrote:
>> Am 1/18/2011 17:43, schrieb Tuncer Ayaz:
>>> To fix invalid timezone info in a repo I ran
>>> git filter-branch --env-filter '
>>>   GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0000/-0800/`' HEAD
>>>
>>> This fixed the invalid entries but the new timezone is -0700
>>> instead of -0800. Is this expected?
>>
>> Parse error. You fixed it, but it is not fixed? So what?
> 
> Fixed because it is not +0000 anymore. Surprised because the new
> timezone is -0700 and not -0800.
> 
>> What do you mean by "the new timezone is"? Do you mean "...is reported
>> as"? If so, reported by which tools?
> 
> git log
> git cat-file $REV

$ git filter-branch -f --env-filter 'echo; echo "$GIT_AUTHOR_DATE"; GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0100/-0800/`; echo "$GIT_AUTHOR_DATE"' -- -1
Rewrite 6fb5ec91707a4433628eae5d9d68153ca8b819fe (1/1)
1292311163 +0100
1292311163 -0800

Ref 'refs/heads/master' was rewritten
$ git cat-file commit HEAD
tree 43554f2216bbcfc96385db0641ae212409f26f21
parent 942f54790453970cfffbfedf29e47ac27b9ba995
author Johannes Sixt <j.sixt@viscovery.net> 1292311163 -0800
committer Johannes Sixt <j.sixt@viscovery.net> 1292311163 +0100

master

*Shrug*

-- Hannes

```

## Tuncer Ayaz, 2011-01-19 14:30

Subject: Re: filter-branch --env-filter GIT_AUTHOR_DATE
Message-ID: <AANLkTimiG=Tr=rfLtE54pJvN8G05mx=GGsLDN4AbzLO+@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimiG%3DTr%3DrfLtE54pJvN8G05mx%3DGGsLDN4AbzLO%2B%40mail.gmail.com
In-Reply-To: <4D36BDD9.4050108@viscovery.net>

```
On Wed, Jan 19, 2011 at 11:32 AM, Johannes Sixt wrote:
> Am 1/19/2011 11:08, schrieb Tuncer Ayaz:
>> On Wed, Jan 19, 2011 at 8:01 AM, Johannes Sixt wrote:
>>> Am 1/18/2011 17:43, schrieb Tuncer Ayaz:
>>>> To fix invalid timezone info in a repo I ran
>>>> git filter-branch --env-filter '
>>>>   GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0000/-0800/`' HEAD
>>>>
>>>> This fixed the invalid entries but the new timezone is -0700
>>>> instead of -0800. Is this expected?
>>>
>>> Parse error. You fixed it, but it is not fixed? So what?
>>
>> Fixed because it is not +0000 anymore. Surprised because the new
>> timezone is -0700 and not -0800.
>>
>>> What do you mean by "the new timezone is"? Do you mean "...is reported
>>> as"? If so, reported by which tools?
>>
>> git log
>> git cat-file $REV
>
> $ git filter-branch -f --env-filter 'echo; echo "$GIT_AUTHOR_DATE";
> GIT_AUTHOR_DATE=`echo ${GIT_AUTHOR_DATE}|sed s/+0100/-0800/`;
> echo "$GIT_AUTHOR_DATE"' -- -1
> Rewrite 6fb5ec91707a4433628eae5d9d68153ca8b819fe (1/1)
> 1292311163 +0100
> 1292311163 -0800
>
> Ref 'refs/heads/master' was rewritten
> $ git cat-file commit HEAD
> tree 43554f2216bbcfc96385db0641ae212409f26f21
> parent 942f54790453970cfffbfedf29e47ac27b9ba995
> author Johannes Sixt <j.sixt@viscovery.net> 1292311163 -0800
> committer Johannes Sixt <j.sixt@viscovery.net> 1292311163 +0100
>
> master
>
> *Shrug*

Cannot reproduce anymore. Works as expected.

Successfully rewrote all GIT_AUTHOR_DATE timezone entries:
  -0700 -> -0800
  -0800 -> +0000
  +0000 -> -0800

git version 1.7.4.rc2.3.g60a2e

```
