| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch.
Sorry, something went wrong.
|
The macOS failure is unrelated and can be ignored: https://bugs.python.org/issue40275#msg375122 |
Sorry, something went wrong.
|
This change can be associated to https://bugs.python.org/issue40548 which introduced the "Check for source changes" job. |
Sorry, something went wrong.
|
Oh, you are so quick. I try to fix it a minute ago: shihai1991#30 it) Lol~ |
Sorry, something went wrong.
| # into the PR branch anyway. | ||
| # | ||
| # https://github.com/python/core-workflow/issues/373 | ||
| git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true |
There was a problem hiding this comment.
I test it in last weekend, it can work. and removing the git fetch origin $GITHUB_BASE_REF --depth=1 can fix it too.
I guess depth=1 is not enough deep to find the merge base.
Sorry, something went wrong.
Correct. But depth=1 is part of https://bugs.python.org/issue40548 design to make the "Check for source changes" job fast. For example, on my latest change, it only took 18 seconds overall! I don't think that "..." (3 dots) to find the last common commit is needed for this job. ".." (2 dots) should be enough. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks, It's can work for me. so LGTM.
Sorry, something went wrong.
|
I tested manully: with this change, doc-only PR still skip build jobs. I created #21812 to test this PR. It's a "documentation-only" PR. Build GitHub Action jobs have been skipped as expected, and "Docs / Docs" is running as expected. |
Sorry, something went wrong.
|
@shihai1991 @brettcannon: Thanks for the review! I merged my PR. So far, it works as expected. If something goes wrong, we can change the test again. Python 3.9 is also affected, example: #21809 Check for source changes: "fatal: ... no merge base". I backport the change to 3.8 and 3.9. |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, something went wrong.
|
GH-21813 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
pythonGH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. (cherry picked from commit eaa5517) Co-authored-by: Victor Stinner <vstinner@python.org>
|
GH-21814 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
pythonGH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. (cherry picked from commit eaa5517) Co-authored-by: Victor Stinner <vstinner@python.org>
GH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. (cherry picked from commit eaa5517) Co-authored-by: Victor Stinner <vstinner@python.org>
GH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. (cherry picked from commit eaa5517) Co-authored-by: Victor Stinner <vstinner@python.org>
|
@vstinner sorry for the delay, I did not have access to my computer over the weekend. I implemented this in another project and was running into an issue, this was my solution: - name: Check for source changes
id: check
env:
PREVIOUS: ${{ github.event.before }}
CURRENT: ${{ github.sha }}
run: |
git fetch origin $PREVIOUS
git diff --name-only $PREVIOUS $CURRENT | grep -q ... || trueTurns out github actions makes the previous object SHA available for us to use. We can use this to explicitly fetch it and to run the diff. It should be more reliable than the current approach. What do you think? |
Sorry, something went wrong.
I tried git diff origin/$GITHUB_BASE_REF..$GITHUB_SHA: it avoids the "git checkout", but the checkout is part of actions/checkout@v2, we cannot avoid it. With the checkout, origin/$GITHUB_BASE_REF..$GITHUB_SHA is the same than origin/$GITHUB_BASE_REF..HEAD which is the same than origin/$GITHUB_BASE_REF... From what I understood, in practice, git diff $PREVIOUS $CURRENT is the same than git diff origin/$GITHUB_BASE_REF... |
Sorry, something went wrong.
|
No, GITHUB_BASE_REF (also github.base_ref) is different from github.event.before. github.base_ref:
github.event.before is the SHA of the top commit before the event. It is documented in the webhooks documentation, see https://docs.github.com/en/actions/reference/events-that-trigger-workflows for context. github.event.before:
Github is doing a bad job with the documentation here, it took a lot of digging to uncover this. But it does work and is documented. |
Sorry, something went wrong.
pythonGH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch.
pythonGH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
pythonGH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. (cherry picked from commit eaa5517) Co-authored-by: Victor Stinner <vstinner@python.org>
|
GH-92342 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
GH-21806) (GH-92342) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. (cherry picked from commit eaa5517) Co-authored-by: Victor Stinner <vstinner@python.org>
| Back | FazBrowse Home | New Git URL |
On Git 2.28, "git diff master..." (3 dots) no longer works when
"fetch --depth=1" is used, whereas it works on Git 2.26.
Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command
computing the list of modified files between the base branch and the
PR branch.
https://bugs.python.org/issue40548