Re: error: char103: premature end of data
From: Johan Herland <hidden>
Date: 2016-06-15 22:43:14
On Friday 08 June 2007, Johannes Schindelin wrote:
Hi, On Fri, 8 Jun 2007, Johan Herland wrote:quoted
On Friday 08 June 2007, Johannes Schindelin wrote:quoted
I just tried to fetch from one of my repos which was perfectly usable (and fetchable) before, and got this error message: error: char103: premature end of dataSorry about that. Do you have an idea of which tag object caused the failure? If so, could you send the output of "git-cat-file tag <name>" on it?Yes, I know what causes it. A tag with an empty message.
Of course. Although if one uses git-tag -a to create an annotated tag object I have a hard time seeing why one wouldn't supply a message. But it's of course entirly valid not to supply a message.
And I even know why it does that. It's easy. Look into git-tag.sh, and you will find that it does a git-stripspace on the final message. If that was empty, then the tag will just be the tag header.
You're right. I'll fix my code to handle this case. I'll also try to split that first patch in my series into more manageable chunks.
quoted
git-fsck on the repo should report the same error. If you run with -v (verbose) you should also get some hints as to which tag object causes this.Yes, it finds the error. And crashes. And costs me time. Why do we have to parse _everything_ in the tag to begin with? It's not like I will show the information of the darn thing when I just fetch it from repo A into repo B.
We parse the tag completely in order to detect corruption/invalid tags as early as possible. If I'm pulling from a corrupt repo, I'd sure as hell want git to tell me when I first fetched, and not a couple of weeks later when I'd try to use the corrupt data, or call fsck, or whatever. Again, I'm sorry for your problems. ...Johan -- Johan Herland, [off-list ref] www.herland.net