Re: [PATCH v2 1/4] notes: preserve object type given by "add -C"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 11, 2012, 21:16 UTC
- Message-ID
- <7vzk9eju4m.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1336699506-28388-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> _Automatically_ converting a non-blob object to a blob is > wrong. Either this way, or reject non-blob objects upfront.
But wouldn't it be even _more_ wrong to stuff a non-blob object at the leaf level of the notes tree?
It is not automatically "converting"; as far as the notes subsystem is concerned, the data you throw at it to be associated with an object the note annotates has always been uninterpreted stream of bytes. If an application wants to store the raw representation of a commit object including the log message and its header, it has every right to expect that it can use "git cat-file commit $argument_to_the_C_option" as the source of that uninterpreted stream of bytes, doesn't it?