Re: [PATCH RFC] parse_object: pass on the original sha1, not the replaced one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 5, 2010 at 9:41 PM, Christian Couder
<chriscool@xxxxxxxxxxxxx> wrote:
> It looks like parse_commit() is buggy regarding replaced objects. But I am not
> sure how it should be fixed.

It could be fixed the same way you did with parse_object(): replace
read_sha1_file() with read_sha1_file_repl(). You would also need to
fix parse_tree() and parse_tag(). But..

> Anyway if you use parse_object(), then you don't need parse_commit(). So if
> possible you should use parse_object() instead of both lookup_commit() and
> parse_commit().

That's how those functions are used. For example, in
traverse_commit_list(), lookup_*() may be called and uninteresting
objects marked UNINTERESTING. Later on in process_{tree,blob,tag},
parse_* may be called if their content is interesting.

To me, the fix above will leave a gap when object->sha1 is the
original sha1, until parse_*() is called. It just does not sound good.

Or, you could lookup_replace_object() inside
lookup_{object,tree,commit,tag,blob} and update object->sha1. Hm..
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]