tnesbitt210 / interactive-smartlog-issues

9 stars 0 forks source link

Extension is unusable without a primary branch #5

Closed pothos-dev closed 2 months ago

pothos-dev commented 3 months ago

So we don't have a master or main branch (our branches are named by the release version).

The extension seems to fail in this case:

Unable to fetch commits
No local branch is set up to track `origin/master`. Run `git fetch origin` followed by `git branch --track master origin/master`
Error: No local branch is set up to track `origin/master`.  Run `git fetch origin` followed by `git branch --track master origin/master`
    at Au.findPrimaryBranch (c:\Users\Daniel\.vscode\extensions\isl-server\src\Repository.ts:291:11)
    at c:\Users\Daniel\.vscode\extensions\isl-server\src\Repository.ts:798:34
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Not sure why it tries to find a primary branch, but maybe it should just use the active branch in case it doesn't find one.

tnesbitt210 commented 3 months ago

Thanks for the report @pothos-dev ! Just out of curiosity: if you don't have a main branch, where do you branch off new release-version branches from? Does each release version branch off of the previous version?

The error state you've encountered means that IGL used git remote to detect a remote named origin, and then it used the command git ls-remote --symref origin HEAD to find that there is a primary branch configured for origin and its name is master. If you're using github, then when you go to your repo on github the code that displays by default is from the primary branch.

Running the command suggested in the error ( git fetch origin && git branch --track master origin/master ) creates a local branch that tracks the primary origin/master branch. Have you tried this? And if so, does it change what IGL displays? If you have not tried, it should be safe to try. If you want to undo the action later, you can run git branch -D master

Please let me know what happens, or if you think that any of the information I shared above sounds incorrect.

tnesbitt210 commented 3 months ago

Hey @pothos-dev , just wanted to follow up here! Should I close this issue out?