Example #1
0
File: tags.go Project: jbrukh/ggit
func (f *formatter) TagPretty(t *objects.Tag) (int, error) {
	fmt.Fprintf(f.Writer, "object %s\n", t.Object())
	fmt.Fprintf(f.Writer, "type %s\n", t.ObjectType())
	fmt.Fprintf(f.Writer, "tag %s\n", t.Name())
	sf := NewStrFormat()
	sf.WhoWhenDate(t.Tagger()) // git-cat-file -p displays full dates for tags
	fmt.Fprintf(f.Writer, "tagger %s\n\n", sf.String())
	fmt.Fprintf(f.Writer, "%s", t.Message())
	return 0, nil // TODO
}
Example #2
0
File: tags.go Project: jbrukh/ggit
func (f *formatter) Tag(t *objects.Tag) (int, error) {
	fmt.Fprintf(f.Writer, "object %s\n", t.Object())
	fmt.Fprintf(f.Writer, "type %s\n", t.ObjectType())
	fmt.Fprintf(f.Writer, "tag %s\n", t.Name())
	sf := NewStrFormat()
	sf.WhoWhen(t.Tagger())
	fmt.Fprintf(f.Writer, "tagger %s\n\n", sf.String())
	fmt.Fprintf(f.Writer, "%s", t.Message())
	return 0, nil // TODO
}