git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Validation of a commit object?

From
Junio C Hamano <junkio@cox.net>
Date
Aug 14, 2006, 21:32 UTC
Message-ID
<7vr6zjdmw9.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060814062830.GF18667@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
Show 14 quoted lines
> I'm thinking that can't be right.  Shouldn't fsck-objects be doing
> better checking on commits?
>
> The reason I ask is I'm working on my (bastard) fast-import program
> for Jon's Mozilla CVS -> GIT conversion effort and I'm taking the
> author and committer lines blind from the Python code.  If the
> Python code gives me a bad line its going to go into the pack that
> way, with that possibly resulting in a totally corrupt repository.
> I hoped to apply the same verification that fsck-objects applies
> but apparently it doesn't do anything.  :-)
>
> I'm willing to write some better validation in fsck-objects.c
> and submit the patch if folks think we should do stronger checks
> in there.

Historical repositories (e.g. very early days of git, linux-2.6 just after 2.6.12-rc2, and sparse) used to have commit objects that recorded committer dates in RFC2822 format not the current unixtime format. I think all of them have been converted later, but not warning or checking these fields may be related to it.

In general stricter check is always preferred. I just wanted to mention the older repositories as something we might want to keep in mind.

Previous: Alex Riesen
Message 3 of 3 in “Validation of a commit object?”
  1. Shawn PearceAug 14, 2006
  2. Alex RiesenAug 14, 2006
  3. Junio C HamanoAug 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.