Last active
October 9, 2022 02:00
-
-
Save RedFlames/ce4eab93bc98df21e6d8cff7e7dd5c23 to your computer and use it in GitHub Desktop.
Revisions
-
RedFlames revised this gist
Oct 9, 2022 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,11 @@ Enough cheat sheets out there, https://jdsalaro.com/blog/git-cheat-sheet.html lo This is just other voodoo I've used before ```sh # Number of commits ahead / behind git rev-list --left-right --count main...mybranch ``` ```sh # list branches with dates, latest committed at the bottom git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' -
RedFlames revised this gist
Oct 9, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,7 @@ git log --all --source -- CelesteNet.Client/Components/CelesteNetMainComponent.c ```sh # yoink specific PRs commits for pull in 22 23 24 25 27; do curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token $PAT" "https://api.github.com/repos/0x0ade/CelesteNet/pulls/$pull/commits" > pr_$pull.txt done # dump out just the commit hashes from the jsons -
RedFlames revised this gist
Oct 9, 2022 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,13 @@ Enough cheat sheets out there, https://jdsalaro.com/blog/git-cheat-sheet.html lo This is just other voodoo I've used before ```sh # list branches with dates, latest committed at the bottom git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' --merged git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' --no-merged # both of the above two lines mashed together ( OPTS="--sort=committerdate refs/heads/ --format %(committerdate:iso)_%(refname:short)"; git for-each-ref $OPTS --merged=main | sed 's/:[0-9]\{2\} +0[0-9]00_/ -m- /g'; git for-each-ref $OPTS --no-merged=main | sed 's/:[0-9]\{2\} +0[0-9]00_/ - - /g' ) | sort -n # aka ( @@ -28,18 +30,22 @@ git rev-list --all | \ ``` ```sh # list branches that touch a file or idk git log --all --source -- CelesteNet.Client/Components/CelesteNetMainComponent.cs | grep -o "refs/heads/.*" | sort -u | xargs -I '{}' git log -1 --format=%aI%x20%S '{}' -- CelesteNet.Client/Components/CelesteNetMainComponent.cs | sort ``` ```sh # yoink specific PRs commits for pull in 22 23 24 25 27; do curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token $PAT" "https://api.github.com/repos/0x0ade/CelesteNet/pulls/$pull/commits > pr_$pull.txt done # dump out just the commit hashes from the jsons for pull in 22 23 24 25 27; do commits="$(jq -r '.[]|.sha' < pr_$pull.txt)" echo "$commits" done | tr -d '\r' > pr_commits.txt # list commits since date X that weren't in the PRs git log --no-merges --since=2022-01-19 --oneline --no-abbrev-commit | grep -v -f pr_commits.txt ``` -
RedFlames revised this gist
Oct 9, 2022 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ Enough cheat sheets out there, https://jdsalaro.com/blog/git-cheat-sheet.html looks interesting This is just other voodoo I've used before ```sh git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' -
RedFlames revised this gist
Oct 9, 2022 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ Enough cheat sheets, https://jdsalaro.com/blog/git-cheat-sheet.html looks interesting ```sh git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' --merged @@ -15,7 +15,7 @@ git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:shor ) | sort -n ``` ```sh # absurd: grep in all commits git rev-list --all | \ ( @@ -25,11 +25,11 @@ git rev-list --all | \ ) ``` ```sh git log --all --source -- CelesteNet.Client/Components/CelesteNetMainComponent.cs | grep -o "refs/heads/.*" | sort -u | xargs -I '{}' git log -1 --format=%aI%x20%S '{}' -- CelesteNet.Client/Components/CelesteNetMainComponent.cs | sort ``` ```sh for pull in 22 23 24 25 27; do curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token $PAT" "https://api.github.com/repos/0x0ade/CelesteNet/pulls/$pull/commits > pr_$pull.txt done -
RedFlames renamed this gist
Oct 9, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
RedFlames created this gist
Oct 9, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ Enough cheat sheets, https://jdsalaro.com/blog/git-cheat-sheet.html looks interesting ``` git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' --merged git for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' --no-merged ( OPTS="--sort=committerdate refs/heads/ --format %(committerdate:iso)_%(refname:short)"; git for-each-ref $OPTS --merged=main | sed 's/:[0-9]\{2\} +0[0-9]00_/ -m- /g'; git for-each-ref $OPTS --no-merged=main | sed 's/:[0-9]\{2\} +0[0-9]00_/ - - /g' ) | sort -n # aka ( OPTS="--sort=committerdate refs/heads/ --format %(committerdate:iso)_%(refname:short)" git for-each-ref $OPTS --merged=main | sed 's/:[0-9]\{2\} +0[0-9]00_/ -m- /g' git for-each-ref $OPTS --no-merged=main | sed 's/:[0-9]\{2\} +0[0-9]00_/ - - /g' ) | sort -n ``` ``` # absurd: grep in all commits git rev-list --all | \ ( while read revision; do git grep -F 'Something' $revision done ) ``` ``` git log --all --source -- CelesteNet.Client/Components/CelesteNetMainComponent.cs | grep -o "refs/heads/.*" | sort -u | xargs -I '{}' git log -1 --format=%aI%x20%S '{}' -- CelesteNet.Client/Components/CelesteNetMainComponent.cs | sort ``` ``` for pull in 22 23 24 25 27; do curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token $PAT" "https://api.github.com/repos/0x0ade/CelesteNet/pulls/$pull/commits > pr_$pull.txt done for pull in 22 23 24 25 27; do commits="$(jq -r '.[]|.sha' < pr_$pull.txt)" echo "$commits" done | tr -d '\r' > pr_commits.txt git log --no-merges --since=2022-01-19 --oneline --no-abbrev-commit | grep -v -f pr_commits.txt ```