Commit Diff


commit - 60b94e7d2a2d0fd6dc815d562ee11ba673819a7c
commit + f69c5a468f5e08db053b390fc00d2e2e70bf4d53
blob - 4ec26b8962b911a5c478faf7aebc3d0686931d6e
blob + 765c5ecd53d258c8af195523d4fb1fea0c8f41d3
--- tog/tog.1
+++ tog/tog.1
@@ -214,6 +214,8 @@ view listing all references in the repository.
 This can then be used to open a new
 .Cm log
 view for arbitrary branches and tags.
+.It Cm @
+Toggle between showing the author and the committer name.
 .El
 .Pp
 The options for
blob - 3bc621c521f234691dee4e06c4349babd8903aa3
blob + 243bc3031c43c95c8bb3942763da45e096287e66
--- tog/tog.c
+++ tog/tog.c
@@ -381,6 +381,7 @@ struct tog_log_view_state {
 	struct commit_queue_entry *matched_entry;
 	struct commit_queue_entry *search_entry;
 	struct tog_colors colors;
+	int use_committer;
 };
 
 #define TOG_COLOR_DIFF_MINUS		1
@@ -1976,7 +1977,10 @@ draw_commit(struct tog_view *view, struct got_commit_o
 			goto done;
 	}
 
-	author = strdup(got_object_commit_get_author(commit));
+	if (s->use_committer)
+		author = strdup(got_object_commit_get_committer(commit));
+	else
+		author = strdup(got_object_commit_get_author(commit));
 	if (author == NULL) {
 		err = got_error_from_errno("strdup");
 		goto done;
@@ -2286,12 +2290,16 @@ draw_commits(struct tog_view *view)
 	ncommits = 0;
 	view->maxx = 0;
 	while (entry) {
+		struct got_commit_object *c = entry->commit;
 		char *author, *eol, *msg, *msg0;
 		wchar_t *wauthor, *wmsg;
 		int width;
 		if (ncommits >= limit - 1)
 			break;
-		author = strdup(got_object_commit_get_author(entry->commit));
+		if (s->use_committer)
+			author = strdup(got_object_commit_get_committer(c));
+		else
+			author = strdup(got_object_commit_get_author(c));
 		if (author == NULL) {
 			err = got_error_from_errno("strdup");
 			goto done;
@@ -2302,7 +2310,7 @@ draw_commits(struct tog_view *view)
 			author_cols = width;
 		free(wauthor);
 		free(author);
-		err = got_object_commit_get_logmsg(&msg0, entry->commit);
+		err = got_object_commit_get_logmsg(&msg0, c);
 		if (err)
 			goto done;
 		msg = msg0;
@@ -3273,6 +3281,9 @@ input_log_view(struct tog_view **new_view, struct tog_
 	case CTRL('n'):
 		err = log_move_cursor_down(view, 0);
 		break;
+	case '@':
+		s->use_committer = !s->use_committer;
+		break;
 	case 'G':
 	case KEY_END: {
 		/* We don't know yet how many commits, so we're forced to