git pull, git rebaseはシェルスクリプトで実装されていた

$ find /usr/local/Cellar/git/2.2.2/libexec/git-core -type f | xargs file | grep  script
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-add--interactive:         a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-am:                       POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-archimport:               a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-bisect:                   POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-citool:                   POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-cvsexportcommit:          a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-cvsimport:                a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-cvsserver:                a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-difftool:                 a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-difftool--helper:         POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-filter-branch:            POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-gui:                      POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-gui--askpass:             POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-instaweb:                 POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-merge-octopus:            POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-merge-one-file:           POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-merge-resolve:            POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-mergetool:                POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-p4:                       a /usr/bin/python script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-pull:                     POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-quiltimport:              POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-rebase:                   POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-relink:                   a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-request-pull:             POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-send-email:               a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-stash:                    POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-submodule:                POSIX shell script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-svn:                      a /usr/bin/perl script text executable
/usr/local/Cellar/git/2.2.2/libexec/git-core/git-web--browse:              POSIX shell script text executable
git pull, git rebaseなど、毎日使うコマンドがシェルスクリプトで実装されていて驚きました。
git=さくさく動く=C言語 なイメージがあったので、意外ですね。

シェルスクリプトであればC言語よりは読めそうな気がするのでソースコードリーディングしてみたくなりました。

あと、いつくかのコマンドはPerlで実装されているようです。(どおりで yum install git とかするとperlがついてくるわけだ)
カテゴリ: