forked from ethereum/go-ethereum
-
Couldn't load subscription status.
- Fork 5
chore(ci): automate detection of last auto-rename commit #99
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0fff08c
chore(ci): automate finding base commit
qdm12 65917f0
Automate input of rename go module workflow
qdm12 898dabb
Leave manual input for rename-module workflow
qdm12 66e2357
Use `git rev-list` directly to find base commit
qdm12 58c3768
Use shorter `rename Go module` for grep-ing commit message
qdm12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 characters
qdm12 marked this conversation as resolved.
Show resolved
Hide resolved
|
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 characters
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
|
|
||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # This script finds the base commit libevm changes should be considered from, | ||
| # and returns it to the caller. | ||
| # This base commit is the first child commit with its message containing | ||
| # "rename Go module + update internal import paths" of the last | ||
| # go-ethereum (aka geth) tag present in the main branch of libevm. | ||
| # If an error occurs, this one is echo-ed and the script exits with code 1. | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| base_geth_tag_hash="$($(dirname "$0")/geth-commit.sh)" | ||
|
|
||
| base_commit_hash="$(git log --oneline --grep="rename Go module + update internal import paths" --after "$base_geth_tag_hash" -n 1 origin/main | head -n 1 | awk '{print $1}')" | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if [ -z "$base_commit_hash" ]; then | ||
| echo "No child commit found after tag $base_geth_tag_hash on branch main." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo $base_commit_hash | tr -d '\n' | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
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 characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/bin/bash | ||
|
|
||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # This script finds the base commit corresponding to a geth tag | ||
| # from which libevm was last based on, and returns it to the caller. | ||
| # If an error occurs, this one is echo-ed and the script exits with code 1. | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| git remote add geth https://github.com/ethereum/go-ethereum.git | ||
| git fetch geth 'refs/tags/*:refs/tags/*' | ||
|
|
||
| geth_tags=$(git ls-remote --tags --sort=-version:refname geth "v[1-9]*" | awk '{print $2}' | sed 's/refs\/tags\///') | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| base_geth_tag_hash= | ||
| for geth_tag in $geth_tags; do | ||
| geth_tag_hash="$(git rev-parse --short $geth_tag)" | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if git merge-base --is-ancestor $geth_tag_hash "origin/main"; then | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| base_geth_tag_hash="$geth_tag_hash" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| if [ -z "$base_geth_tag_hash" ]; then | ||
| echo "No geth tag found in libevm main branch." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo $base_geth_tag_hash | tr -d '\n' | ||
qdm12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.