Skip to content
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

Implement features for repoaction #6

Open
arjunsuresh opened this issue Jan 17, 2025 · 4 comments
Open

Implement features for repoaction #6

arjunsuresh opened this issue Jan 17, 2025 · 4 comments
Assignees
Labels

Comments

@arjunsuresh
Copy link
Contributor

We need to support all features needed for MLC RepoAction like mlc pull repo and verify if the output are as expected.

@arjunsuresh
Copy link
Contributor Author

Hi @anandhu-eng all the repo actions seems to be working fine now. But I'm thinking of the below situation.

  1. We clone a repo with checkout "abc" pointing to a commit hash
  2. We try a "mlc pull repo" -> it fails as expected as "git pull" is not valid on a given checkout
  3. We try to pull the same repo but with another checkout say "def". It currently fails saying the folder already exists

I think we should handle "3" in an automated way. We can check if there are any local changes and if not checkout to the new commit.

@anandhu-eng
Copy link
Contributor

Hi @arjunsuresh , this would be a nice addition as it could be used when we are distributing mlc-scripts. I do have a suggestion, currently I think the check for any local changes is not implemented for the case where we are checking out to a branch. Would it be ideal that we implement this as a general check?

@anandhu-eng
Copy link
Contributor

We try to pull the same repo but with another checkout say "def". It currently fails saying the folder already exists

I tried to replicate the same, the folder already exist message is just a warning. The error mainly is identical to the second point. I think mainly we have two scenarios to check:

  1. Whether there are any changes local change in the current branch.
  2. Whether the repo cloned locally is in detached state.
    2.1. Whether there is any local changes in the detached state

why 2.1? If there is no local changes, we have an option to checkout to another commit hash through git checkout and only do git pull after this step. But this becomes tricky when we want to checkout to a commit hash which is not present locally but on remote.

@arjunsuresh
Copy link
Contributor Author

@anandhu-eng I think for now we can output a warning for the "2.1" case and if there are no local changes, do "git fetch && git checkout "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants