[RFC] fast-import: notemodify (N) command
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 31, 2011, 18:33 UTC
- Message-ID
- <20110131183350.GB31826@burratino>
- In-Reply-To
- <1255083738-23263-8-git-send-email-johan@herland.net>
Dear fast importers,
Another week, another fast-import protocol extension.
Most DVCSes do not allow one to non-disruptively change the log message for a commit. But sometimes people want to attach information to a commit after the fact:
- whether it was tested and worked correctly - who liked or disliked the commit (Acked-by, Reviewed-by) - corresponding revision number after export to another version control system - bug number - corresponding compiled binary
The N command allows such notes to be attached to commits, like so:
1. first the commit is imported as usual (let's say it's ":1"). 2. commit annotations are added separately, like so:
commit refs/notes/commits committer A. U. Thor <author@example.com> Mon, 31 Jan 2011 12:15:59 -0600 data <<END Notes after review. END
N inline :1 data <<END Acked-by: me END
Details:
- there can be multiple categories of notes: "refs/notes/commits" contains ordinary addenda to the commit message, but one might also see refs/notes/bugzilla, refs/notes/svn-commit, and so on.
- each commit gets at most one blob of notes in each category. Later notemodify (N) commands overwrite the effect from earlier ones.
- the syntax of a notemodify command is as follows:
'N' sp <dataref> sp <committish> lf
The <dataref> represents a blob with the annotations to be used
("inline" is allowed, too, just like with filemodify). The
<committish> can be any expression allowed in a 'from' command
(branch name, mark reference :<idnum>, other commit name) and
represents the commit that is to be annotated.- this has been supported in git since v1.6.6. There is no "feature" for it --- I don't think the feature declaration facility existed yet.
Do other DVCSes support something like this? Should it get a feature name?
Jonathan