Commit Diff


commit - c46b93520a1536b30c3ccaf95007c9d74ad4c20e
commit + 7a2921f9f5de672cb5107b005351dd15771c41c5
blob - dcd134caf7070697867b72bfa2aecf3dcc285c91
blob + c42a383ccd6edee22170796bdb11a16ac15d5a98
--- tog/tog.1
+++ tog/tog.1
@@ -127,6 +127,11 @@ view for the currently selected line's commit.
 Show the
 .Cm blame
 view for the version of the file in the currently selected line's commit.
+.It Cm p
+Show the
+.Cm blame
+view for the version of the file in the currently selected line's commit's
+parent commit.
 .It Cm B
 Switch the
 .Cm blame
blob - a39d6b3eba1f29d911941a345e5b23bd9c747ab8
blob + 00d46717dff455d72bdbbf3ecec6959326765fdd
--- tog/tog.c
+++ tog/tog.c
@@ -1563,7 +1563,8 @@ show_blame_view(const char *path, struct got_object_id
 				else if (last_displayed_line < blame.nlines)
 					first_displayed_line++;
 				break;
-			case 'b': {
+			case 'b':
+			case 'p': {
 				struct got_object_id *id;
 				id = get_selected_commit_id(blame.lines,
 				    first_displayed_line, selected_line);
@@ -1577,6 +1578,8 @@ show_blame_view(const char *path, struct got_object_id
 					break;
 				if (pobj == NULL && obj == NULL)
 					break;
+				if (ch == 'p' && pobj == NULL)
+					break;
 				done = 1;
 				if (pthread_mutex_unlock(&mutex) != 0) {
 					err = got_error_from_errno();
@@ -1591,7 +1594,7 @@ show_blame_view(const char *path, struct got_object_id
 				}
 				if (thread_err)
 					break;
-				id = got_object_get_id(obj);
+				id = got_object_get_id(ch == 'b' ? obj : pobj);
 				if (id == NULL) {
 					err = got_error_from_errno();
 					break;