commit 33d869be77b0c87421075910bfadc9bce91a7a82 from: Stefan Sperling date: Sat Dec 22 11:44:02 2018 UTC undo previous; indentation is enough to avoid parsing problems commit - e52d343e4dfd46e567fd2a3a02f2760492b89293 commit + 33d869be77b0c87421075910bfadc9bce91a7a82 blob - 8e6e385e7a449469ddc931e52de70a8e71957d35 blob + b4d4bc167688eeb9100d55de06a3e87d2c0e62b7 --- got/got.c +++ got/got.c @@ -337,17 +337,6 @@ get_datestr(time_t *time, char *datebuf) if (p) *p = '\0'; return s; -} - -static int -count_lines(char *s) -{ - int nlines = 0; - while (*s) { - if (*s++ == '\n') - nlines++; - } - return nlines; } static const struct got_error * @@ -357,17 +346,12 @@ print_commit(struct got_commit_object *commit, struct const struct got_error *err = NULL; char *id_str, *datestr, *logmsg0, *logmsg, *line; char datebuf[26]; - int nlines = 3 + commit->nparents - 1; - - if (strcmp(commit->author, commit->committer) != 0) - nlines++; - nlines += count_lines(commit->logmsg); err = got_object_id_str(&id_str, id); if (err) return err; - printf("----------------------------------------------- %d\n", nlines); + printf("-----------------------------------------------\n"); printf("commit %s\n", id_str); free(id_str); printf("from: %s\n", commit->author);