Changing git-fast-import(1)--date-format from raw to rfc22822 to support more GIT_COMMITTER_DATE date values.
PR: #100
Rationale:
In 2faa33c (Add support for GIT_COMMITTER_(NAME|EMAIL|DATE) env vars; resolves 98, 2022-04-27) the GIT_COMMITTER_DATE environment parameter was introduced.
The GIT_COMMITTER_DATE environment parameter ref supports three formats:
Unlike the rfc2822 format, this format is very strict. Any variation in formatting will cause fast-import to reject the value, and some sanity checks on the numeric values may also be performed.
This renders two out of three supported formats in GIT_COMMITTER_DATE as unsupported: RFC 2822 and ISO 8601, only the very strict Git internal format works.
On the other hand, when using git-fast-import(1) with --date-format=rfc2822, three out of three supported formats in GIT_COMMITTER_DATE are supported (100%), as it accepts both Git internal format as well as ISO 8601 as date formats.
Additionally in build context, raw does not support building at the beginning of the epoch (0 +0000), as with the Git internal format it must be after Jan 1, 2000 (git v0.99) / Mar 3 1973 (git v1.5.2.2). With rfc2822 it is possible to express this intend (Thu, 01 Jan 1970 00:00:00 +0000, 1970-01-01 00:00:00 +0000 etc.).
Notes:
Tested against git v2.25.1
Date formatraw-permissive was not available with my version ("fatal: unknown --date-format argument raw-permissive") ref
Date formatnow does not allow to specify the Git Comitter Date ("This is a toy format.") ref
Changing
git-fast-import(1)
--date-format
fromraw
torfc22822
to support moreGIT_COMMITTER_DATE
date values.PR: #100
Rationale:
In 2faa33c (Add support for
GIT_COMMITTER_(NAME|EMAIL|DATE)
env vars; resolves 98, 2022-04-27) theGIT_COMMITTER_DATE
environment parameter was introduced.The
GIT_COMMITTER_DATE
environment parameter ref supports three formats:The
git-fast-import(1)
ref comamnds--date-format
option ref supports four Date formats ref of which two are interesting:raw
refrfc2822
refCurrently in 2faa33c
--date-format=raw
is in use:This renders two out of three supported formats in
GIT_COMMITTER_DATE
as unsupported: RFC 2822 and ISO 8601, only the very strict Git internal format works.On the other hand, when using
git-fast-import(1)
with--date-format=rfc2822
, three out of three supported formats inGIT_COMMITTER_DATE
are supported (100%), as it accepts both Git internal format as well as ISO 8601 as date formats.Additionally in build context,
raw
does not support building at the beginning of the epoch (0 +0000
), as with the Git internal format it must be after Jan 1, 2000 (git v0.99) / Mar 3 1973 (git v1.5.2.2). Withrfc2822
it is possible to express this intend (Thu, 01 Jan 1970 00:00:00 +0000
,1970-01-01 00:00:00 +0000
etc.).Notes:
raw-permissive
was not available with my version ("fatal: unknown --date-format argument raw-permissive") refnow
does not allow to specify the Git Comitter Date ("This is a toy format.") refis to besuggested upstream to ghp-import: https://github.com/c-w/ghp-import/issues/108git_utils.make_when
stime.time()
reflectingSOURCE_DATE_EPOCH
deferred