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

Submodule change revert removes submodule code from disk #18063

Open
celguar opened this issue Jan 22, 2024 · 4 comments
Open

Submodule change revert removes submodule code from disk #18063

celguar opened this issue Jan 22, 2024 · 4 comments
Assignees
Labels
investigation-needed Likely bugs, but haven't been reliably reproduced by a reviewer

Comments

@celguar
Copy link

celguar commented Jan 22, 2024

The problem

In old versions if I open main repository and revert changes to submodule of that repository it would revert submodule state to the last commited submodule version, as it should. But in latest version it just removes submodule code entirely so when I go to that repo in Github Desktop it asks wierd questions thinking submodule repo is main repo and I should update its upstream...

Release version

Version 3.3.6 (x64)

Operating system

Windows 11 x64

Steps to reproduce the behavior

  1. Clone repo with submodule
  2. Add both repo and submodule to Github Desktop
  3. Change something in submodule, e.g. make commit
  4. Open main repo in app - it shows submodule changes not commited
  5. Choose Discard changes on that one
  6. It removes submodule code entirely, instead of using original behavior of old version of the app - revert changes to last commited submodule revision and breaks that repo in github desktop. I have to remove it from app and re clone it to do what I want

Log files

No response

Screenshots

No response

Additional context

No response

@steveward
Copy link
Member

@celguar thanks for the report. The expected behavior for discarding a submodule is to discard the changed submodule files, which was implemented a few years back (#8218). There is an open issue in #10402 tracking submodules not discarding to trash.

But in latest version it just removes submodule code entirely so when I go to that repo in Github Desktop it asks wierd questions thinking submodule repo is main repo and I should update its upstream.

What questions are you referring to here? Can you share some screenshots or more information?

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Jan 31, 2024
@celguar
Copy link
Author

celguar commented Feb 1, 2024

Hello and thanks for the reply. I've recorded a short 2min video showing what happens in latest version
https://youtu.be/XYicD1sBbk4
In older versions it did not work like that, I did not have to restore files from Recycle Bin, it just automatically checked out submodule to proper commit.

And it generally makes no sense to delete submodule files from disk to Recycle Bin when I do discard changes on submodule changes in main repo. Plus breaking local repository UI in the process. After that I have to clone my submodule again from github to restore all that. As well as delete "broken" submodule repo from Github Desktop UI and add it again...

Currently I'm using that method - open repository in browser, click on submodule to see what commit it has as "last"...Then I checkout the submodule manually in GitHub Desktop to that commit so that submodule is not seen as changed in main repo. Then I git pull main repo changes. But that was all (except from pulling) done by GitHub Desktop before!

@github-actions github-actions bot removed the more-info-needed The submitter needs to provide more information about the issue label Feb 1, 2024
@celguar
Copy link
Author

celguar commented Feb 1, 2024

Just to be clear I understand that changed submodule files should and get removed to recycle bin, but this happens on a submodule with no unstaged changes

@steveward steveward added the investigation-needed Likely bugs, but haven't been reliably reproduced by a reviewer label Feb 22, 2024
@steveward steveward self-assigned this Feb 22, 2024
@celguar
Copy link
Author

celguar commented Apr 23, 2024

Any update on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation-needed Likely bugs, but haven't been reliably reproduced by a reviewer
Projects
None yet
Development

No branches or pull requests

2 participants