Re: git-note -C changes commit type?
- From
Kyle J. McKay <mackyle@gmail.com>
- Date
- Feb 12, 2014, 05:16 UTC
- Message-ID
- <8E256253-7470-4195-9A62-489870530915@gmail.com>
- In-Reply-To
- <xmqqvbwlnqi1.fsf@gitster.dls.corp.google.com>
On Feb 11, 2014, at 16:06, Junio C Hamano wrote:
Show 18 quoted lines
> Johan Herland <johan@herland.net> writes: > >> There is currently no way the "git notes" commands will allow you to >> store the 3d7de37 commit object directly as a note. There is also >> (AFAICS) no easy workaround (git fast-import could've been a >> workaround if it did not already require the first N/notemodify >> argument to be a blob object). The best alternative, off the top of >> my >> head, would be to write your own program using the notes.h API to >> manipulate the notes tree directly (or - suboptimally - use other >> low-level Git operations to do the same). > > Even worse. I do not think such a non-blob object in the notes tree > does not participate in the reachability at all, so you won't be > able to fetch "refs/notes/whatever" and expect to get a useful > result. I do not think storing the raw bits of commit object as a > blob in the notes tree is useful behaviour, either. The command > probably should refuse to get anything non-blob via that option.
It would be nice if it let you store a tree or a blob, but I agree that it should complain about anything non-blob by default and if tree were to be allowed, that should require a special option.
If you do manually construct a notes tree that has a 'tree' entry instead of a blob, as soon as you add a new note, that 'tree' gets turned back into a blob again. I was trying to attach a 'tree' as my note a while back and decided not to pursue it further after I found it got transformed into a 'blob' on the next notes modification.