Re: [RFC] fast-import: note deletion command
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 18, 2011, 20:35 UTC
- Message-ID
- <20110918203506.GG2308@elie>
- In-Reply-To
- <CA+gfSn9sdTzQghqQp6hcO-9kN9mPx2JLRig79Rgx2FqGWXXp=A@mail.gmail.com>
(+cc: Sverre for fast-import, Johan for notes, Thomas as a user of the note import feature, snipping less for their benefit)
Dmitry Ivankov wrote:
Show 14 quoted lines
> Hi,
>
> fast-import is able to write notes provided a command
> N <note_content_data_specification> <commit_specification>
>
> There is no documented command to delete a note. It can't be
> easily replaced with Delete command on notes tree because
> of notes fanout.
>
> But fast-import interprets 0{40} data_specification as a note
> deletion command. It is consistent with fast-import internals
> where null_sha1 is used for absent/unknown object. But is
> not consistent with file Modify command nor looks like a common
> convention in git ui.Right.
Show 9 quoted lines
> So the questions are:
> - should 0{40} not be treated as deletion toggle? Downside is that
> it is used as one in t/t9301-fast-import-notes.sh.
> - how should a documented way to delete notes look like?
> ND commit_sha1 # One may think there are also NC, NR, NM
> N delete commit_sha1
> # Only :mark, full-40-byte-sha1 and 'inline' are allowed currently.
> # So no clashes arise, but then one may also want M 'delete' path
> # command to work too.If I were doing it:
- advertise "N 0{40} <commit>" as the historical way to delete a
note, and make sure it keeps working- introduce 'ND' or 'notedelete <commit>' as a human-friendly synonym, keeping in mind that NC and NR could be introduced in the future if there is demand for them.
- don't add any new magic "N <magic keyword> <commit>" commands, since it's hard to know when they will clash with some VCS's convention for object names.
I imagine there are plenty of other acceptable ways to accomplish these things, though. :) Thanks for looking into it.