-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Check git status on upstream ultralytics
or origin
dynamically
#8694
Check git status on upstream ultralytics
or origin
dynamically
#8694
Conversation
Is this idea interesting to you? |
I
I find two commits noisy for the history of the repo:
It would be good if you rewrite history and cut them back to just these two commits: |
@Mandroide However I am willing to fix it if you have disabled squash commits in GitHub. |
ba4a9dc
to
d6f20c4
Compare
This is now squashed into one commit! |
Yes don't worry, only Squash and merge commits are allowed for PRs so all the individual commits get squashed into just one. |
@pourmand1376 this PR is a very good idea, but I wonder if there's a more concise way to implement this. The steps are 1) determine if ultralytics/yolov5:master is added as a remote origin, and 2) if not add it, then 3) get the diff using the existing code. |
@glenn-jocher For checking existence of a remote, I first do a |
This will not work if ssh is used as the cloning method. Perhaps the url search should be changed to just |
@pourmand1376 would @democat3457's idea here make this simpler?
|
I agree with @democat3457 but that would only remove Other that this, I think git should have a one-liner which outputs remote's name based on url. I haven't found that yet. Does anybody know any commands for this purpose? If that's not the case, I think I can rewrite the whole thing using list comprehension to make it simpler. I will do it as soon as I have my laptop :) |
@pourmand1376 I've made a few updates. The current implementation will not create new remotes if ultralytics/yolov5 is already linked to origin, and it should also be compatible with SSH clones (original PR only works for HTTPS). |
This also now advises on proper |
@pourmand1376 can you test this on your side? |
ultralytics
and check git status with thatultralytics
or origin
dynamically
@pourmand1376 PR is merged. Tested locally with a fork and everything works correctly. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
@AyushExel this should make it easier for forks to stay up to date. Automatically adds a new |
Thanks for all of this! I also tested locally and It works just fine. But, When I tested on colab, it says that:
I do not think this should be the case. Colab users should also get their updates. However I think I should report this bug on another issue. |
@pourmand1376 ah thanks for spotting the Colab issue, I see it too. This is likely related to a recent update to is_docker() in #8711 |
@pourmand1376 Colab issue should be resolved now in #8813 Not sure if I've introduced a Docker issue now though. Waiting for the Docker image to update and will test. EDIT: All Colab and Docker issues resolved. |
This is a great feature! |
@AyushExel yeah this is great. It's too bad the current 10k forks don't have this, but at least the next 10k will! |
@pourmand1376 got a slight issue with this. Was working on my local fork and when I pushed to the fork it also pushed to ultralytics repo by accident since it had been added for both fetching and pulling. Most users won't have this problem as they don't have push permissions to ultralytics/yolov5 but a few employees do so we need to be very careful. I couldn't find any easy way to add a remote only for fetching but not pushing, i.e. https://stackoverflow.com/questions/7556155/git-set-up-a-fetch-only-remote So I thought what if we simply do not add a remote but instead explicitly git fetch directly from ultralytics master, i.e.:
|
One idea is to add a Also, I think having a Note that this file should not be committed to repo. This one should be in |
@pourmand1376 are there any downsides to simply fetching directly from the master URL?
|
…ltralytics#8694) * Add remote ultralytics and check git status with that * Simplify * Update general.py * Update general.py * s fix Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher |
@pourmand1376 yes exactly. Then there's no push attempts to ultralytics master, i.e. we wouldn't need to add it as a remote |
This repo has 10k forks. Mosts of them would never update their repos and use outdated versions. We should warn them since this has great cost. Currently, It just compares it to
master
. This approach doesn't work for forked repos!Then, I separate them by '\n' character and find the name of the remote which has the address of main repo. For normal repos, this is origin, but for forked repos, this doesn't exist! We should create it for the first time and use it afterwards.
This is because I have wasted two days of my time debugging and finding errors in the code that has been already fixed. I think we should really warn users for outdated repos.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhanced git status checks in YOLOv5 with more robust handling of git remotes.
📊 Key Changes
check_git_status
function can now specify a repository.🎯 Purpose & Impact