← 返回题目列表
UNSW COMP2041 · 困难

22T2 Q7 — Git 提交统计

在某目录运行。若不是 git 仓库打印 Not a git repository;若是仓库但无提交打印 No commits。否则打印:

  • Last commit: <YYYY-MM-DD> —— 最近一次提交的作者日期
  • 然后每个作者一行 <次数> <作者>,按提交次数降序,同数按作者名逆字母序。

要求用 git 命令,不得直接解析 .git/。


POSIX shell only (#!/bin/dash); use git commands — do not parse .git/ directly. From COMP2041/9044 22T2 Final.