Commit Diff


commit - a0603db24cfd80ddb6d903450ed46baacbbd677e
commit + 3fe1abad43f057903efb7980e29ce93af766891e
blob - 0402e69c5ab82d8c2b0edd44b7545eabda924099
blob + 2d95db6d10ae667414a0bdd5a37904712901b380
--- got/got.c
+++ got/got.c
@@ -321,13 +321,14 @@ print_commit(struct got_commit_object *commit, struct 
 	printf("author: %s\n", commit->author);
 	if (strcmp(commit->author, commit->committer) != 0)
 		printf("committer: %s\n", commit->committer);
-	if (verbose) {
+	if (commit->nparents > 1) {
 		struct got_parent_id *pid;
+		int n = 1;
 		SIMPLEQ_FOREACH(pid, &commit->parent_ids, entry) {
 			err = got_object_id_str(&id_str, pid->id);
 			if (err)
 				return err;
-			printf("parent commit: %s\n", id_str);
+			printf("parent %d: %s\n", n++, id_str);
 			free(id_str);
 		}
 	}