tweak the way 'got tag -l' displays tagged objectsI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
diff --git a/got/got.c b/got/got.c
index 091fe91..7f0160e 100644
--- a/got/got.c
+++ b/got/got.c
@@ -3346,32 +3346,32 @@ list_tags(struct got_repository *repo, struct got_worktree *worktree)
free(id);
if (err)
break;
+ printf("from: %s\n", got_object_tag_get_tagger(tag));
+ tagger_time = got_object_tag_get_tagger_time(tag);
+ datestr = get_datestr(&tagger_time, datebuf);
+ if (datestr)
+ printf("date: %s UTC\n", datestr);
err = got_object_id_str(&id_str,
got_object_tag_get_object_id(tag));
if (err)
break;
switch (got_object_tag_get_object_type(tag)) {
case GOT_OBJ_TYPE_BLOB:
- printf("%s: %s\n", GOT_OBJ_LABEL_BLOB, id_str);
+ printf("object: %s %s\n", GOT_OBJ_LABEL_BLOB, id_str);
break;
case GOT_OBJ_TYPE_TREE:
- printf("%s: %s\n", GOT_OBJ_LABEL_TREE, id_str);
+ printf("object: %s %s\n", GOT_OBJ_LABEL_TREE, id_str);
break;
case GOT_OBJ_TYPE_COMMIT:
- printf("%s: %s\n", GOT_OBJ_LABEL_COMMIT, id_str);
+ printf("object: %s %s\n", GOT_OBJ_LABEL_COMMIT, id_str);
break;
case GOT_OBJ_TYPE_TAG:
- printf("%s: %s\n", GOT_OBJ_LABEL_TAG, id_str);
+ printf("object: %s %s\n", GOT_OBJ_LABEL_TAG, id_str);
break;
default:
break;
}
free(id_str);
- printf("from: %s\n", got_object_tag_get_tagger(tag));
- tagger_time = got_object_tag_get_tagger_time(tag);
- datestr = get_datestr(&tagger_time, datebuf);
- if (datestr)
- printf("date: %s UTC\n", datestr);
tagmsg0 = strdup(got_object_tag_get_message(tag));
got_object_tag_close(tag);
if (tagmsg0 == NULL) {
diff --git a/regress/cmdline/tag.sh b/regress/cmdline/tag.sh
index 6662a98..053f3a2 100755
--- a/regress/cmdline/tag.sh
+++ b/regress/cmdline/tag.sh
@@ -145,18 +145,18 @@ function test_tag_list {
echo "-----------------------------------------------" \
> $testroot/stdout.expected
echo "tag $tag $tag_id" >> $testroot/stdout.expected
- echo "commit: $commit_id" >> $testroot/stdout.expected
echo "from: $GOT_AUTHOR" >> $testroot/stdout.expected
echo "date: $d1" >> $testroot/stdout.expected
+ echo "object: commit $commit_id" >> $testroot/stdout.expected
echo " " >> $testroot/stdout.expected
echo " test" >> $testroot/stdout.expected
echo " " >> $testroot/stdout.expected
echo "-----------------------------------------------" \
>> $testroot/stdout.expected
echo "tag $tag2 $tag_id2" >> $testroot/stdout.expected
- echo "commit: $commit_id" >> $testroot/stdout.expected
echo "from: $GOT_AUTHOR" >> $testroot/stdout.expected
echo "date: $d2" >> $testroot/stdout.expected
+ echo "object: commit $commit_id" >> $testroot/stdout.expected
echo " " >> $testroot/stdout.expected
echo " test" >> $testroot/stdout.expected
echo " " >> $testroot/stdout.expected