Skip to content

Johnpreed/do not merge #766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
40a22ed
Adding activesupport gem
kaltepeter Oct 26, 2018
f04ffec
Merge pull request #1 from github/master
Nov 26, 2018
050189c
fixing typo and adding format example
Nov 26, 2018
5915d11
updating rack and rack-protection verions to medigate vulnerabilities
Nov 26, 2018
60ccd18
Update GUID generations for PowerShell
michaelsainz Jan 17, 2019
c1839e8
Add support for paginated responses
Apr 28, 2019
8b638d1
Feat: add Search API demo
imjohnbo Jun 4, 2019
4432fad
Chore: update package.json description and name
imjohnbo Jun 4, 2019
066e4f1
Link to org security alerts script example
gpadak Jun 10, 2019
ed56a4b
Merge pull request #246 from github/gp-org-sec-alerts
azizshamim Jun 10, 2019
30b2d54
move scripts over from https://github.com/larsxschneider/git-repo-ana…
larsxschneider Jun 20, 2019
6df2ef6
Merge pull request #248 from github/ls/scripts
larsxschneider Jun 20, 2019
fd51e8f
add git-append-commit-trailer script
larsxschneider Jun 23, 2019
4261267
improve wording
larsxschneider Jun 25, 2019
ba3f240
Merge pull request #249 from github/ls/hash
larsxschneider Jun 25, 2019
19096bc
add git-find-stale-branches
larsxschneider Jun 25, 2019
b659858
Merge pull request #250 from github/ls/stale
larsxschneider Jun 26, 2019
e9eb649
Two one char typo fixes in script comments
mlinksva Jun 26, 2019
96f7b1c
added related issues to release
Jun 27, 2019
d89d440
Merge pull request #252 from github/primetheus/update-jira-example
Jun 28, 2019
2115c97
Merge pull request #226 from github/michaelsainz-patch-1
Jun 28, 2019
222f35d
Merge pull request #220 from selkins13/delete-repo-updates
Jun 28, 2019
a49c6d5
Merge pull request #238 from lbonanomi/pagination
Jun 28, 2019
7e3ebd8
Merge pull request #251 from github/comment-spels
Jun 28, 2019
3d40612
GitHub OAuth Example in Go (#224)
jonico Jun 28, 2019
289c5e9
Merge pull request #212 from kaltepeter/add-activesupport
Jun 28, 2019
7499136
improve pre-receive-hook that checks commit messages
larsxschneider Jul 4, 2019
fd0818b
Merge pull request #253 from github/ls/msghook
larsxschneider Jul 4, 2019
1cf25a1
improve git-purge-files script
larsxschneider Jun 29, 2019
22f02f2
add auditlog api graphql example (#262)
brianamarie Sep 24, 2019
2a4a034
Update scripts/git-purge-files
larsxschneider Sep 30, 2019
83e63bb
add comment
larsxschneider Sep 30, 2019
2cd1b3d
use --reencode=no if newer git version
larsxschneider Sep 30, 2019
6596df8
Merge pull request #254 from github/ls/improve-purge
larsxschneider Sep 30, 2019
0d22ef3
Create enterprise-sso-member-details.graphql
Nov 4, 2019
8644532
Formatting changes
Nov 4, 2019
ab319f3
add bootstrap script to download small LFS files efficiently
larsxschneider Nov 8, 2019
3571ac6
Merge pull request #267 from github/ls/lfsboot
larsxschneider Nov 11, 2019
cb48a92
Merge pull request #266 from github/hollywood/add-unified-identity-query
azizshamim Nov 27, 2019
583b365
Members with their scim identity in org
SvanBoxel Dec 5, 2019
6498e32
Members with their scim identity in enterprise
SvanBoxel Dec 5, 2019
c7ed3f6
Merge pull request #273 from github/link-member-to-scim
SvanBoxel Dec 5, 2019
c3f12cb
Better permission reporting and CSV file support for groovy examples …
jonico Dec 6, 2019
b19b6e5
Fix path in code snippet example
ppremk Dec 10, 2019
889524a
Merge pull request #274 from github/fix-path-typo
ppremk Dec 11, 2019
fd0d095
find_inactive_members works with advisories (#289)
jonico Jan 9, 2020
718ef76
Add org invite and actions artifact cleanup scripts
pierluigi Feb 21, 2020
fb8ee25
Merge pull request #296 from pierluigi/master
pierluigi Feb 21, 2020
021419b
Create users-in-org-with-sso.graphql
alwell-kevin Feb 21, 2020
c1d4f3d
Merge pull request #302 from github/query-users-in-org-with-sso
Feb 24, 2020
b6d15a8
Rename audit-log-api-example.graphql to org-audit-log-api-example.gra…
whatupfoo Mar 13, 2020
5294f61
Add audit log graphql at the enterprise level
whatupfoo Mar 13, 2020
1297977
Add purpose of graphql
whatupfoo Mar 13, 2020
0689199
Merge pull request #304 from github/edit-auditlog-graphql
whatupfoo Mar 16, 2020
903ce12
Fixing CSV generation. Also add column names to the CSV output. (#309)
spier Mar 20, 2020
68131c0
Update README.md (#307)
samwiskow Mar 20, 2020
b452ef1
[docs] simplify definition of Inactivity (#306)
spier Mar 20, 2020
eab100d
Bump rest-client from 1.6.7 to 1.8.0 in /api/ruby/basics-of-authentic…
dependabot[bot] Mar 20, 2020
aadecff
Bump rack from 1.6.5 to 1.6.13 in /hooks/ruby/delete-repository-event…
dependabot[bot] Mar 20, 2020
486ae4b
Bump rack from 1.5.2 to 1.6.13 in /api/ruby/building-a-ci-server (#316)
dependabot[bot] Mar 20, 2020
802cbff
Bump rack from 1.6.5 to 1.6.13 in /hooks/ruby/dismiss-review-server (…
dependabot[bot] Mar 20, 2020
454fedc
Bump rack from 1.5.2 to 1.6.13 in /hooks/ruby/configuring-your-server…
dependabot[bot] Mar 20, 2020
1ddcd5d
Bump rack from 1.6.8 to 1.6.13 in /app/ruby/app-issue-creator (#313)
dependabot[bot] Mar 20, 2020
1dd2f24
Bump rack from 1.5.2 to 1.6.13 in /api/ruby/basics-of-authentication …
dependabot[bot] Mar 20, 2020
3c18824
Bump rack from 1.6.8 to 1.6.13 in /api/ruby/rendering-data-as-graphs …
dependabot[bot] Mar 20, 2020
075eb86
Bump rack in /api/ruby/building-your-first-github-app (#310)
dependabot[bot] Mar 20, 2020
69dc644
Bump rack-protection in /api/ruby/rendering-data-as-graphs (#299)
dependabot[bot] Mar 20, 2020
0f66a9a
Bump rack-protection in /api/ruby/building-a-ci-server (#298)
dependabot[bot] Mar 20, 2020
1f7fbb2
Bump spark-core from 2.3 to 2.7.2 in /api/java/deployment (#297)
dependabot[bot] Mar 20, 2020
13c33b8
Update commit-current-user-check.sh (#293)
brooksClo19 Mar 20, 2020
459f28b
changed git-purge-path to git-purge-files in help (#290)
affrae Mar 20, 2020
d08243c
Add more information on OCTOKIT_ACCESS_TOKEN to README.md (#261)
mnuck Mar 20, 2020
5131b00
add hook to reject certain commits from being pushed to the repositor…
larsxschneider Mar 20, 2020
4a10583
Merge pull request #245 from github/imjohnbo/search-api
imjohnbo Mar 20, 2020
254f33a
Update README.md
jdweiner526 Apr 9, 2020
75f9fe4
Update README.md
jdweiner526 Apr 9, 2020
1c41ee4
Update master-branch-protect README
Apr 16, 2020
fe91e2f
Merge pull request #323 from github/hollywood/update-username-text
azizshamim Apr 28, 2020
4956d3f
Merge pull request #321 from jdweiner526/jdweiner526-docfix-1
azizshamim Apr 28, 2020
2065097
Update Readme. file
gamven May 9, 2020
297762a
Merge pull request #326 from gamventures/master
azizshamim May 11, 2020
93aaac9
Bump activesupport in /api/ruby/rendering-data-as-graphs
dependabot[bot] May 26, 2020
2e63399
Correct the argv test for user-supplied arguments
jparise Jun 5, 2020
bfd05c8
Merge pull request #335 from jparise/find-lfs-extensions-argv
larsxschneider Jun 11, 2020
82bc16c
added input check and 'usage'
jefeish Aug 20, 2020
32b939d
Update scripts/git-find-large-files
jefeish Aug 24, 2020
6df9d7d
Update scripts/git-find-large-files
jefeish Aug 24, 2020
59766bc
Merge pull request #363 from github/jefeish/patch-1
jefeish Aug 24, 2020
ff5a00f
add script for creating teams in bulk in github org
ppremk Oct 9, 2020
0e0be86
code review fix
ppremk Oct 9, 2020
c216345
Merge pull request #370 from github/bulk-team-create-scripts
ppremk Oct 9, 2020
886b315
Add invite_members_to_org.ps1 script
RamonPage Dec 11, 2020
688f274
Break some lines
RamonPage Dec 11, 2020
611b469
Fix SYNOPSIS
RamonPage Dec 11, 2020
03bed82
Merge pull request #375 from github/invite-members-to-org
andrewlayman Dec 16, 2020
e023d59
Update script description
RamonPage Dec 16, 2020
9d2b1b7
Merge pull request #376 from github/RamonPage-patch-1
RamonPage Dec 16, 2020
f67153a
Create search-for-issue-or-bug-requests.graphql
Jan 26, 2021
9de211b
Merge pull request #378 from github/hollywood/add-feature-search
azizshamim Jan 26, 2021
d5b2fc2
Adds block-outdated-clients pre-receive hook
droidpl Mar 23, 2021
33df05e
Fix bash interpreter path
stebje Mar 23, 2021
e2b8ea5
Merge pull request #387 from github/droidpl/outdated-clients
droidpl Mar 23, 2021
e5d4ec0
Bump ua-parser-js from 0.7.12 to 0.7.28 in /graphql/enterprise
dependabot[bot] May 9, 2021
9cd70d4
Merge pull request #393 from github/dependabot/npm_and_yarn/graphql/e…
evgenyrahman May 14, 2021
dfb549e
Bump addressable in /hooks/ruby/delete-repository-event
dependabot[bot] Jul 13, 2021
13746cb
Merge pull request #406 from github/dependabot/bundler/hooks/ruby/del…
evgenyrahman Aug 30, 2021
f591871
Merge pull request #331 from github/dependabot/bundler/api/ruby/rende…
evgenyrahman Aug 30, 2021
271a72a
add audit queries
some-natalie Sep 20, 2021
165b28e
add security reports
some-natalie Sep 20, 2021
f1490ed
add metrics reports
some-natalie Sep 20, 2021
88a7644
add usage directions
some-natalie Sep 20, 2021
053e8c1
add readme
some-natalie Sep 20, 2021
22893de
Add a monthly summary of commits
some-natalie Sep 22, 2021
7902037
add issue created summary
some-natalie Oct 27, 2021
37ae55f
Merge pull request #417 from some-natalie/master
zkoppert Dec 2, 2021
770e7d3
This is for demo purposes only to repro authentication/issues/1187
johnpreed Feb 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Make a pull request and we'll consider it.
* _graphql_: here's a bunch of sample GraphQL queries that can be run against our [GitHub GraphQL API](https://developer.github.com/early-access/graphql).
* _hooks_: want to find out how to write a consumer for [our web hooks](https://developer.github.com/webhooks/)? The examples in this subdirectory show you how. We are open for more contributions via pull requests.
* _pre-receive-hooks_: this one contains [pre-receive-hooks](https://help.github.com/enterprise/admin/guides/developer-workflow/about-pre-receive-hooks/) that can block commits on GitHub Enterprise that do not fit your requirements. Do you have more great examples? Create a pull request and we will check it out.
* _scripts_: want to analyze or clean-up your Git repository? The scripts in this subdirectory show you how. We are open for more contributions via pull requests.
17 changes: 17 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Git Repo Analysis Scripts

Git can become slow if a repository exceeds certain thresholds ([read this for details](http://larsxschneider.github.io/2016/09/21/large-git-repos)). Use the scripts explained below to identify possible culprits in a repository. The scripts have been tested on macOS but they should run on Linux as is.

_Hint:_ The scripts can run for a long time and output a lot lines. Pipe their output to a file (`./script > myfile`) for further processing.

## Large by File Size
Use the [git-find-large-files](git-find-large-files) script to identity large files in your Git repository that you could move to [Git LFS](https://git-lfs.github.com/) (e.g. using [git-lfs-migrate](https://github.com/git-lfs/git-lfs/blob/master/docs/man/git-lfs-migrate.1.ronn)).

Use the [git-find-lfs-extensions](git-find-lfs-extensions) script to identify certain file types that you could move to [Git LFS](https://git-lfs.github.com/).

## Large by File Count
Use the [git-find-dirs-many-files](git-find-dirs-many-files) and [git-find-dirs-unwanted](git-find-dirs-unwanted) scripts to identify directories with a large number of files. These might indicate 3rd party components that could be extracted.

Use the [git-find-dirs-deleted-files](git-find-dirs-deleted-files) to identify directories that have been deleted and used to contain a lot of files. If you purge all files under these directories from your history then you might be able significantly reduce the overall size of your repository.


29 changes: 29 additions & 0 deletions scripts/git-change-author
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#
# Fix an invalid committer/author all commits of your repository.
#
# Usage:
# git-change-author <old-email> <new-name> <new-email>
#
# Author: Lars Schneider, https://github.com/larsxschneider
#

filter=$(cat <<EOF
OLD_EMAIL='$1'
NEW_NAME='$2'
NEW_EMAIL='$3'

if [ "\$GIT_COMMITTER_EMAIL" = "\$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="\$NEW_NAME"
export GIT_COMMITTER_EMAIL="\$NEW_EMAIL"
fi
if [ "\$GIT_AUTHOR_EMAIL" = "\$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="\$NEW_NAME"
export GIT_AUTHOR_EMAIL="\$NEW_EMAIL"
fi
EOF
)

git filter-branch --env-filter "$filter" --tag-name-filter cat -- --all
34 changes: 34 additions & 0 deletions scripts/git-find-dirs-deleted-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#
# Print the number of deleted files per directory. The output indicates
# if the directory is present in the HEAD revision.
#
# A deleted directory with a lot of files could indicate a 3rd party
# component that has been deleted. 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-deleted-files
#
# Output: [deleted file count] [directory still in HEAD revision?] [directory]
#
# Author: Lars Schneider, https://github.com/larsxschneider
#

git -c diff.renameLimit=30000 log --diff-filter=D --summary |
grep ' delete mode ...... ' |
sed 's/ delete mode ...... //' |
while read -r F ; do
D=$(dirname "$F");
if ! [ -d "$D" ]; then
while ! [ -d "$(dirname "$D")" ] ; do D=$(dirname "$D"); done;
echo "deleted $D";
else
echo "present $D";
fi;
done |
sort |
uniq -c |
sort -k 2,2 -r
31 changes: 31 additions & 0 deletions scripts/git-find-dirs-many-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
65 changes: 65 additions & 0 deletions scripts/git-find-dirs-unwanted
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
#
# git-find-dirs-unwanted.sh
#
# Search the entire history of a Git repository for (potentially)
# unwanted directories. E.g. 3rd party directories, temp, build or
# Perforce stream directories.
#
# The script prints the number of files under each directory to see the
# impact on the Git tree. Directories with a large number of files can
# be good candidates for exclusions in repository migrations to Git.
#
# The script must be called in the Git root directory.
#
# Author: Lars Schneider, https://github.com/larsxschneider
#

DIRS=$(git -c diff.renameLimit=30000 log --all --name-only --pretty=format: \
| awk -F'[^/]*$' '{print $1}' \
| sort -u \
| grep -i \
-e 3p \
-e 3rd \
-e artifacts \
-e assemblies \
-e backup \
-e bin \
-e build \
-e components \
-e debug \
-e deploy \
-e generated \
-e install \
-e lib \
-e modules \
-e obj \
-e output \
-e packages \
-e party \
-e recycle.bin \
-e release \
-e resources \
-e streams \
-e temp \
-e third \
-e tmp \
-e tools \
-e util \
-e vendor \
-e x64 \
-e x86 \
)

IFS=$'\n'
for I in $DIRS; do
if [ -e "$I" ]; then
FILE_COUNT=$(find "$I" -type f | wc -l)
echo "$FILE_COUNT $I"
else
while ! [ -e $(dirname "$I") ]; do
I=$(dirname "$I")/;
done;
echo "deleted $I"
fi
done | sort -n -r | uniq
63 changes: 63 additions & 0 deletions scripts/git-find-ignored-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
#
# Find all files present in the index and working tree ignored by .gitignore.
#
# Usage:
# git-find-ignored-files [-s | --sort-by-size] [--help]
#
# Author: Patrick Lühne, https://www.luehne.de/
#

function print_help
{
grep "^# Usage" < "$0" | cut -c 3-
}

if [[ $# -gt 1 ]]
then
print_help
exit 1
fi

case "$1" in
-h|--help)
print_help
exit 0
;;
-s|--sort-by-size)
;;
*)
if [[ $# -gt 0 ]]
then
(>&2 echo "error: unknown option “$1”")
print_help
exit 1
fi
;;
esac

# Find all ignored files
files=$(git ls-files --ignored --exclude-standard)

# Stop if no ignored files were found
if [[ -z $files ]]
then
(>&2 echo "info: no ignored files in working tree or index")
exit 0
fi

# Compute the file sizes of all these files
file_sizes=$(echo "$files" | tr '\n' '\0' | xargs -0 du -sh)

# Obtain the origins why these files are ignored
gitignore_origins=$(echo "$files" | git check-ignore --verbose --stdin --no-index)

# Merge the two lists into one
command="join -1 2 -2 2 -t $'\t' -o 1.1,1.2,2.1 <(echo \"$file_sizes\") <(echo \"$gitignore_origins\")"

if [[ $1 =~ ^-s|--sort-by-size$ ]]
then
command="$command | sort -h"
fi

eval "$command"
91 changes: 91 additions & 0 deletions scripts/git-find-large-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash
#
# Print the largest files in a Git repository. The script must be called
# from the root of the Git repository. You can pass a threshold to print
# only files greater than a certain size (compressed size in Git database,
# default is 500kb).
#
# Files that have a large compressed size should usually be stored in
# Git LFS [2].
#
# Based on script from Antony Stubbs [1] and improved with ideas from Peff.
#
# [1] http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# [2] https://git-lfs.github.com/
#
# Usage:
# git-find-large-files [size threshold in KB]
#
# Author: Lars Schneider, https://github.com/larsxschneider
#

if [ -z "$1" ]; then
MIN_SIZE_IN_KB=500
else
MIN_SIZE_IN_KB=$1
fi

# Use "look" if it is available, otherwise use "grep" (e.g. on Windows)
if look >/dev/null 2>&1; then
# On Debian the "-b" is available and required to make "look" perform
# a binary search (see https://unix.stackexchange.com/a/499312/275508 ).
if look 2>&1 | grep -q .-b; then
search="look -b"
else
search=look
fi
else
search=grep
fi

# set the internal field separator to line break,
# so that we can iterate easily over the verify-pack output
IFS=$'\n';

# list all objects including their size, sort by compressed size
OBJECTS=$(
git cat-file \
--batch-all-objects \
--batch-check='%(objectsize:disk) %(objectname)' \
| sort -nr
)

TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/git-find-large-files.XXXXXX") || exit
trap "rm -rf '$TMP_DIR'" EXIT

git rev-list --all --objects | sort > "$TMP_DIR/objects"
git rev-list --all --objects --max-count=1 | sort > "$TMP_DIR/objects.1"

for OBJ in $OBJECTS; do
# extract the compressed size in kilobytes
COMPRESSED_SIZE=$(($(echo $OBJ | cut -f 1 -d ' ')/1024))

if [ $COMPRESSED_SIZE -le $MIN_SIZE_IN_KB ]; then
break
fi

# extract the SHA
SHA=$(echo $OBJ | cut -f 2 -d ' ')

# find the objects location in the repository tree
LOCATION=$($search $SHA "$TMP_DIR/objects" | sed "s/$SHA //")
if $search $SHA "$TMP_DIR/objects.1" >/dev/null; then
# Object is in the head revision
HEAD="Present"
elif [ -e $LOCATION ]; then
# Objects path is in the head revision
HEAD="Changed"
else
# Object nor its path is in the head revision
HEAD="Deleted"
fi

echo "$COMPRESSED_SIZE,$HEAD,$LOCATION" >> "$TMP_DIR/output"
done

if [ -f "$TMP_DIR/output" ]; then
column -t -s ',' < "$TMP_DIR/output"
fi

rm -rf "$TMP_DIR"
exit 0
Loading