[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jgit-dev] Questions about org.eclipse.jgit.lib.Tag
|
Chris Aniszczyk <caniszczyk@xxxxxxxxx> wrote:
> Why is there a setAuthor() and setTagger() when they point to the same
> object? Is this just an API goof since they point to the same
> PersonIdent?
Frick if I know.
{get,set}Author() should be removed from Tag.
> Also, I believe messages in Tag's are optional... if so...
> org.eclipse.jgit.lib.ObjectInserter.format(Tag) is expecting a
> non-null message otherwise we get an NPE. Should ObjectInserter be
> updated to handle the case of an optional message?
Yes. This is a bug in ObjectInserter. Its a simple fix:
w.write('\n');
if (tag.getMessage() != null)
w.write(tag.getMessage());
w.close();
Of course we also want a test... :-)
Also, FWIW, the tagger is optional. Historical accident. We might
want to be a bit more lenient in ObjectInserter.format() and allow
formatting a tag without a tagger. But your new TagCommand should
require the tagger to be present. Basically we want tags to have
a tagger field, but its not really an error to not have one, so we
should permit the lower-level code to do that if its demanded by
the caller.
--
Shawn.