FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sourcegraph/dev/git-stats at main · flyinprogrammer/sourcegraph · GitHub
flyinprogrammer
/
sourcegraph
Public
forked from
sourcegraph/sourcegraph-public-snapshot
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sourcegraph
/
dev
/
git-stats
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
45 lines (38 loc) · 1.05 KB
Breadcrumbs
sourcegraph
/
dev
/
git-stats
Copy path
File metadata and controls
executable file
·
45 lines (38 loc) · 1.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!
/usr/bin/env bash
#
This script outputs statistics for the current git repository. This script
#
is used by the search-core team to understand the size and shape of a
#
repository. In particular we use this when understanding the scale of a
#
monorepo to help us guide our work.
set
-e
#
Do everything from the gitdir. Makes ls-tree below also not work on a
#
subtree.
cd
"
$(
git rev-parse --git-dir
)
"
#
The size of the git store (not the working copy).
echo
"
$(
du -sh .
)
"
gitdir
#
The number of commits reachable from HEAD
echo
"
$(
git rev-list --count HEAD
)
"
commits
#
Some awk which extracts statistics on the files in the latest commit.
echo
echo
HEAD statistics
git ls-tree -r --long HEAD
|
awk
'
BEGIN {
base = 10
logbase = log(base)
}
$4 != "-" {
if ($4 == 0) {
hist[0]++
} else {
hist[int(log($4) / logbase) + 1]++
}
total += $4
count++
}
END {
printf("%.3fGiB\n%d files\n", total / 1024 / 1024 / 1024, count)
printf("histogram:\n")
for (x in hist) {
printf("%d^%d\t%d\n", base, x, hist[x])
}
}
'
Back
|
FazBrowse Home
|
New Git URL