sourcegit icon indicating copy to clipboard operation
sourcegit copied to clipboard

Cannot checkout newer branch commit when I don't have access to one of the submodule's repos

Open Cirtoyt opened this issue 7 months ago • 7 comments

I have a project where in my remote URL I has specified the target git username I want to run commands with. I have 10 submodules, 9 of which my git account has access to, and 1 of which I don't. I was able to clone the repo and work on a new branch I create, but now wanted to change to the main branch as it has new changes on it. The issue is whenever I try, it simply fails with the error message (I have obfuscated the project's name):

fatal: not a git repository: Packages/Assets/[project-name]/Ship/../../../../.git/modules/Packages/Assets/[project-name]/Ship

Please could a change be made where this error will still pop-up, but the checkout would happen regardless for the main repo and the sub-modules I have git access to so I can still switch branch to checkout what I should be able to checkout.

Cirtoyt avatar May 02 '25 11:05 Cirtoyt

Looks like this same issue also happens when trying to abort a bisect also.

Cirtoyt avatar May 06 '25 08:05 Cirtoyt

I just downloaded the latest from GitHub Actions and seems the issues has not been fixed by trying to change branch and unchecking the Update all Submodules checkbox.

It now downloads all of the changes as local changes, then now fires that message afterwards and doesn't transition me onto the new branch/commit. Before the message popped up but then nothing happened. So progress, but seems there's some other calls that's not respecting the new checkbox for non recursive updates also.

Cirtoyt avatar May 06 '25 09:05 Cirtoyt

As much as the addition of the Update all Submodules checkbox is, I'd also like to point out I'd prefer the calls to properly handle still being able to update all submodules, but just properly skipping over those' repos that aren't available to me, completing those that I do. Otherwise it's a real pain every single time I change branch and pull in the latest changes. Especially as for example this repo have 10 sub-modules, 9 of which I have access to and want to have updated when I pull in changes so I don't have to manually go between all 9 and pull in the latest. Regardless, until a solution is implemented I'm blocked from using SourceGit on this project.

Cirtoyt avatar May 07 '25 09:05 Cirtoyt

I have no idea about how to do this. If you know the exact git commands, you can directly create a Custom Action without using the functions provided by SourceGit.

love-linger avatar May 09 '25 05:05 love-linger

I have no idea about how to do this.

As in my modification in #936, --recurse-submodules does not skip errors occurring in any submodule operations, but instead modifies the working directory in a way similar to reset --mixed. It is better not to use this argument.

gadfly3173 avatar May 09 '25 06:05 gadfly3173

Regardless, I still can't switch branches even with the new option turned off, or abort a Bisect I accidentally started which is just a button. I'm now permanently stuck unable to exit the bisect (due to that action being switching branch back to where I started) and unable to switch branch in general at all. At least these 2 operations should be working when there's a sub-module I don't have access to. Git kraken handles this fine.

Cirtoyt avatar May 09 '25 08:05 Cirtoyt

@Cirtoyt Does it help to deinit the particular submodule that has issues?

(NOTE : Perhaps 'De-initialize Submodule' could be made a context command in the SUBMODULES list?)

goran-w avatar May 21 '25 11:05 goran-w