-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix File Not Found Error - Github Actions #416
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
Conversation
|
@Aathish04 Can you check whether this work by commiting the |
behackl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would not check files that were moved by their new name. There is a simple solution for that:
Currently, you check the diff backwards, i.e.,
git diff --name-only HEAD HEAD~$($commits.count) > /d/changes.txt
Changing this to
git diff --name-only HEAD~$($commits.count) HEAD > /d/changes.txt
prints the new file names.
Regarding checking existence of files: I'd rather this were done with git diff itself as well: by querying git diff --diff-filter=d --name-only HEAD~$($commits.count) HEAD, the lowercase d tells diff to ignore deleted files.
I don't understand what this mean, It would be good if you provide an example situation. @behackl
I think it would be good. But I think the solution I recommended is lot better and easy. But anyhow @behackl If you confirm that it will work I will add it. |
|
@naveen521kk see this example here: [behackl@gc7 example]$ git init .
Initialized empty Git repository in /home/behackl/git/example/.git/
[behackl@gc7 example]$ touch some_file
[behackl@gc7 example]$ git add some_file && git commit -m "add a file"
[master (root-commit) acda2b1] add a file
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 some_file
[behackl@gc7 example]$ git checkout -b new_branch
Switched to a new branch 'new_branch'
[behackl@gc7 example]$ git mv some_file another_file
[behackl@gc7 example]$ git commit -m "renamed file"
[new_branch 20e172b] renamed file
1 file changed, 0 insertions(+), 0 deletions(-)
rename some_file => another_file (100%)
[behackl@gc7 example]$ git diff --name-only master HEAD
another_file
[behackl@gc7 example]$ git diff --name-only HEAD master
some_fileI create a new repository, add a file Asking for the diff in the other direction, namely And regarding your second question: continuing the example and deleting my file: [behackl@gc7 example]$ git rm another_file
rm 'another_file'
[behackl@gc7 example]$ git commit -m "removed file"
[new_branch 37b3165] removed file
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 another_file
[behackl@gc7 example]$ git diff --name-only master HEAD
some_file
[behackl@gc7 example]$ git diff --diff-filter=d --name-only master HEADAs you can see, I think it is better to have all these kind of preprocessing steps in one place / line, rather than distributed over two. (But I admit, in this case this is only a very weak preference.) |
|
Ok then I will make your suggestion in latest commit. What I will do is change git diff --name-only HEAD HEAD~$($commits.count) to git diff --name-only HEAD~$($commits.count) HEAD |
behackl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Because it checks for `.npy` files also https://github.com/ManimCommunity/manim/pull/402/checks?check_run_id=1075539216#step:6:560
|
Ok then this can be merged if any other bugs faced pls ping me. |
| while read file | ||
| do | ||
| if [ $(python -c "print('${file}'[-2:])") == "py" ] | ||
| if [[ ($(python -c "print('${file}'[-3:])") == ".py") && (-f ${file}) ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some reservations about using Python instead of Bash for this conditional, but its something we can come back and fix.
This works for the time being, and we have multiple PRs waiting for this one, so approved!
List of Changes
Motivation
Acknowledgement