Commit 499d7ecc534806c7daf8795b1c9f76575520921f

Stefan Sperling 2019-05-22T16:19:11

rename got log's -f option to -b

diff --git a/got/got.1 b/got/got.1
index be99b41..6fa26ab 100644
--- a/got/got.1
+++ b/got/got.1
@@ -156,7 +156,7 @@ using the following status codes:
 If a
 .Ar path
 is specified, only show modifications within this path.
-.It Cm log [ Fl c Ar commit ] [ Fl C Ar number ] [ Fl f ] [ Fl l Ar N ] [ Fl p ] [ Fl r Ar repository-path ] [ path ]
+.It Cm log [ Fl b ] [ Fl c Ar commit ] [ Fl C Ar number ] [ Fl l Ar N ] [ Fl p ] [ Fl r Ar repository-path ] [ path ]
 Display history of a repository.
 If a
 .Ar path
@@ -166,6 +166,11 @@ The options for
 .Cm got log
 are as follows:
 .Bl -tag -width Ds
+.It Fl b
+Show the linear history of the current branch only by restricting
+history traversal to the first parent of each commit.
+Merge commits which affected the current branch will be shown but
+individual commits which originated on other branches will be omitted.
 .It Fl c Ar commit
 Start traversing history at the specified
 .Ar commit .
@@ -177,11 +182,6 @@ if invoked in a work tree, or to the repository's HEAD reference.
 Set the number of context lines shown in diffs with
 .Fl p .
 By default, 3 lines of context are shown.
-.It Fl f
-Restrict history traversal to the first parent of each commit.
-This shows the linear history of the current branch only.
-Merge commits which affected the current branch will be shown but
-individual commits which originated on other branches will be omitted.
 .It Fl l Ar N
 Limit history traversal to a given number of commits.
 .It Fl p
@@ -416,7 +416,7 @@ In a work tree or a git repository directory, view changes committed in
 the 3 most recent commits to the work tree's branch, or the branch resolved
 via the repository's HEAD reference, respectively:
 .Pp
-.Dl $ got log -p -l 3 -f
+.Dl $ got log -p -l 3 -b
 .Pp
 In a work tree or a git repository directory, create a new branch
 .Dq unified-buffer-cache
diff --git a/got/got.c b/got/got.c
index 4268650..4d034c8 100644
--- a/got/got.c
+++ b/got/got.c
@@ -924,7 +924,7 @@ done:
 __dead static void
 usage_log(void)
 {
-	fprintf(stderr, "usage: %s log [-c commit] [-C number] [-f] [ -l N ] [-p] "
+	fprintf(stderr, "usage: %s log [-b] [-c commit] [-C number] [ -l N ] [-p] "
 	    "[-r repository-path] [path]\n", getprogname());
 	exit(1);
 }
@@ -953,8 +953,11 @@ cmd_log(int argc, char *argv[])
 		err(1, "pledge");
 #endif
 
-	while ((ch = getopt(argc, argv, "b:pc:C:l:fr:")) != -1) {
+	while ((ch = getopt(argc, argv, "bpc:C:l:r:")) != -1) {
 		switch (ch) {
+		case 'b':
+			first_parent_traversal = 1;
+			break;
 		case 'p':
 			show_patch = 1;
 			break;
@@ -972,9 +975,6 @@ cmd_log(int argc, char *argv[])
 			if (errstr != NULL)
 				err(1, "-l option %s", errstr);
 			break;
-		case 'f':
-			first_parent_traversal = 1;
-			break;
 		case 'r':
 			repo_path = realpath(optarg, NULL);
 			if (repo_path == NULL)