commit - bccd1d5d167c0b7fabb334513fdb5250df673c9a
commit + 4fe9456b4b22d120d0215786744a9f4c0762bf9a
blob - 7825117a1854a2737ac5b841f83716ac3749d20a
blob + 9512f370f13a1ee7374e4ca2bbf0fb1bfceafee7
--- got/got.1
+++ got/got.1
.Fl P
option.
.It Fl S Ar search-pattern
-If specified, show only commits with a log message matched by the extended
-regular expression
+If specified, show only commits with a log message, author name,
+committer name, or ID SHA1 hash matched by the extended regular
+expression
.Ar search-pattern .
Lines in committed patches will be matched if
.Fl p
blob - 28b7c58946126425fb58c0b17940971c270110ba
blob + 764c2ad6b17fe1432f8b902b43963dd4d9efd5e4
--- got/got.c
+++ got/got.c
}
static const struct got_error *
-match_logmsg(int *have_match, struct got_object_id *id,
+match_commit(int *have_match, struct got_object_id *id,
struct got_commit_object *commit, regex_t *regex)
{
const struct got_error *err = NULL;
if (err)
goto done;
- if (regexec(regex, logmsg, 1, ®match, 0) == 0)
+ if (regexec(regex, got_object_commit_get_author(commit), 1,
+ ®match, 0) == 0 ||
+ regexec(regex, got_object_commit_get_committer(commit), 1,
+ ®match, 0) == 0 ||
+ regexec(regex, id_str, 1, ®match, 0) == 0 ||
+ regexec(regex, logmsg, 1, ®match, 0) == 0)
*have_match = 1;
done:
free(id_str);
}
if (search_pattern) {
- err = match_logmsg(&have_match, id, commit, ®ex);
+ err = match_commit(&have_match, id, commit, ®ex);
if (err) {
got_object_commit_close(commit);
break;