Bug 1816741 - Corrupted date in patch
Summary: Corrupted date in patch
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: git
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Todd Zullinger
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-24 16:03 UTC by Remi Collet
Modified: 2020-03-25 19:03 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-25 08:08:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Remi Collet 2020-03-24 16:03:14 UTC
Description of problem:
All date are from Mon Sep 17 00:00:00 2001


Version-Release number of selected component (if applicable):
git-2.25.1-2.fc31.x86_64

How reproducible:
Always

Steps to Reproduce:
1. clone any repo
2. generate any patch using "git format-patch ..."
3. check first line

Actual results:
From 635dd9a3065ed88e1741e6b963044b80e913f96a Mon Sep 17 00:00:00 2001


Expected results:
From 635dd9a3065ed88e1741e6b963044b80e913f96a Tue Mar 24 01:02:03 2020


Additional info:
git log is correct.

Comment 1 Ondřej Pohořelský 2020-03-24 17:22:04 UTC
It looks like "git format-patch" is not reloading "default_date_mode", which
results into outputing date and time of repository creation.

"git format-patch" is not depending on "git log", that's why "git log" outputs 
correct date and time. 

I will investigate further tomorrow and try to verify my theory.

Comment 2 Todd Zullinger 2020-03-25 06:17:42 UTC
This is intentional and not a bug.  The ^From line is there to make it parse as a valid mbox file.  The date is fixed so it can be used as "magic" for tools like file to identify git format-patch output.

Reference: https://git-scm.com/docs/git-format-patch#_discussion

Comment 3 Ondřej Pohořelský 2020-03-25 07:29:41 UTC
(In reply to Todd Zullinger from comment #2)
> This is intentional and not a bug.  The ^From line is there to make it parse
> as a valid mbox file.  The date is fixed so it can be used as "magic" for
> tools like file to identify git format-patch output.
> 
> Reference: https://git-scm.com/docs/git-format-patch#_discussion

Oh, ok. I completely missed this information in documentation.
Thank you for your clarification!

Comment 4 Remi Collet 2020-03-25 08:08:12 UTC
Still a bit confusing ;)

Thanks for explanation.

Comment 5 Todd Zullinger 2020-03-25 19:03:29 UTC
(In reply to Remi Collet from comment #4)
> Still a bit confusing ;)

No arguments there. ;)

It's not something you'd suspect was there as file format magic.  I only know about it because it made me curious when I first saw it.


Note You need to log in before you can comment on or make changes to this bug.