threads / discuss / 10987

how to change/fake the time for next commit ?

Subject: how to change/fake the time for next commit ?

## tl;dr

4 messages between Nov 23, 2007 and Nov 23, 2007.

replies: 3people: 3as markdown or json

Christian MICHON· Nov 23, 2007, 00:29 UTC · lore
Hi Git list,

I'd like to recreate a git repo with kernel version, using exclusively tar.bz2 files.

I already did such approach in the past by script, but usually the dates of commit are the timestamps of current tar imports. I'd like the date of commit to match any date I would give (without changing the time on my linux system): the date I would give would be (of course) the date of the released version.

example: date of 2.6.23.8 release was 2007-11-16 18:16 UTC, so if I import linux-2.6.23.8.tar.bz2 into a dedicated "2.6.23.8" branch, I'd like the commit to have "2007-11-16 18:16 UTC" as date.

Is there a way to do this, by plumbing or porcelain ?
-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
Johannes Schindelin· Nov 23, 2007, 00:34 UTC · re: Christian MICHON · lore

Re: how to change/fake the time for next commit ?

Hi,
On Fri, 23 Nov 2007, Christian MICHON wrote:
> I already did such approach in the past by script, but usually the
> dates of commit are the timestamps of current tar imports.

Have you tried setting the environment variables GIT_COMMITTER_DATE and GIT_AUTHOR_DATE before committing?

Hth, Dscho

Christian MICHON· Nov 23, 2007, 00:45 UTC · re: Johannes Schindelin · lore

Re: how to change/fake the time for next commit ?

On Nov 23, 2007 1:34 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Have you tried setting the environment variables GIT_COMMITTER_DATE and
> GIT_AUTHOR_DATE before committing?
cool! yes indeed it helped. ;-)
Thanks Dscho!
-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
Johannes Sixt· Nov 23, 2007, 07:20 UTC · re: Christian MICHON · lore

Re: how to change/fake the time for next commit ?

Christian MICHON schrieb:
> I'd like to recreate a git repo with kernel version, using exclusively
> tar.bz2 files.
There's contrib/fast-import/import-tars.perl.
-- Hannes

← back to recent threads