git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: git@vger.kernel.org
Subject: Validation of a commit object?
Date: Mon, 14 Aug 2006 02:28:30 -0400	[thread overview]
Message-ID: <20060814062830.GF18667@spearce.org> (raw)

In looking at fsck-objects.c the only thing it tries to validate
about a commit is:

 - the commit has a tree ("tree NNNNNN\n");
 - the commit maybe has parent(s) ("parent NNNNN\n");
 - the commit has "author ".

That's it.

Its OK for an author line to be completely corrupt and have no
timestamp, no name, no timezone.  Or to have a timestamp such as
"bobthetalkingdog".

Its OK for a committer line to just plain not exist or to be
equally corrupt.


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.

-- 
Shawn.

             reply	other threads:[~2006-08-14  6:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14  6:28 Shawn Pearce [this message]
2006-08-14  8:39 ` Validation of a commit object? Alex Riesen
2006-08-14 21:32 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060814062830.GF18667@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).