Information Technology Reference
In-Depth Information
1 Adam Coulombe
7 Adam J. Sontag
...
Parameter -n prints the results sorted in numeric order by the number of revisions.
To print the number of contributors we pipe the result of git shortlog -s to
wc -l :
$ git shortlog -s | wc -l
The next question is a little more difficult to answer. First, we want to print the out-
put of the git log command in a special form. We want every line to contain only a
commit's date in the form yyyy-mm-dd . It can be accomplished by:
$ git log --pretty=format:%cd --date=short
The above command will produce the list of dates:
2013-04-22
2013-04-22
2013-04-20
2013-04-20
2013-04-18
...
The date of every commit will be present in the output. Let's remove the duplicates.
We can do it using the uniq command:
$ git log --pretty=format:%cd --date=short | uniq
Thus, we will find out the different dates when contributions to the project were
made. If we pipe the result to wc -l :
$ git log --pretty=format:%cd --date=short | uniq | wc -l
We then get the desired number of days.
Search WWH ::




Custom Search