FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
platform-samples/scripts/git-find-dirs-many-files at master · y4code/platform-samples · GitHub
y4code
/
platform-samples
Public
forked from
github/platform-samples
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
platform-samples
/
scripts
/
git-find-dirs-many-files
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
31 lines (28 loc) · 799 Bytes
Breadcrumbs
platform-samples
/
scripts
/
git-find-dirs-many-files
Copy path
File metadata and controls
executable file
·
31 lines (28 loc) · 799 Bytes
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
#!
/usr/bin/env bash
#
#
Print directories with the number of files underneath them.
#
#
A directory with a lot of files could indicates a 3rd party component.
#
These are usually good candidates for purging to make Git repositories
#
smaller (see `git-purge-files`).
#
#
The script must be called from the root of the Git repository.
#
#
Usage:
#
git-find-dirs-many-files [file count threshold]
#
#
Author: Lars Schneider, https://github.com/larsxschneider
#
if
[
-z
"
$1
"
]
;
then
FILE_COUNT=100
else
FILE_COUNT=
$1
fi
IFS=
$'
\n
'
;
DIRS=
$(
find
.
-type d -not -path
"
./.git/*
"
-exec bash -c
'
COUNT=$(find "$0" -type f | wc -l); echo "$COUNT $0"
'
{}
\;
|
sort -nr
)
for
DIR
in
$DIRS
;
do
if
[
$((
$(echo
$DIR
|
sed 's
/
\..
*//
'
))
)
-le
$FILE_COUNT
]
;
then
break
fi
echo
$DIR
done
Back
|
FazBrowse Home
|
New Git URL