LoginSignup
1
0

More than 5 years have passed since last update.

first commit が古い順でファイルの一覧を取得する

Last updated at Posted at 2019-02-03
$ git ls-files *.php | xargs -n1 -I{} git log --reverse -1 --format='%cd {}' --date=short {} | sort

1 ファイルごとに git log するので、ファイル数が多いと重い。以下のように出力される。

  :
2015-10-07 src/.../a.php
2016-10-07 src/.../b.php
2017-10-07 src/.../c.php
  :

日付が不要なときは --format%cd (committer date) を消せば OK。

そもそもの動機としては会社で、first commit が古い --> 技術的負債がたまっている可能性あり? --> リファクタのしがいがあるかも、という考えに至ったため。
負債の程度は first commit date だけでなく、コミットの総数や修正行数なども判断材料として使えそうだけど、ただでさえ重い処理に拍車がかかりそうなので一旦見送り…。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0