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

Pull and Sync fails when name of tracking branch differs from name of tracked branch on remote #70136

Open
md2perpe opened this issue Mar 9, 2019 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Milestone

Comments

@md2perpe
Copy link
Contributor

md2perpe commented Mar 9, 2019

Issue Type: Bug

I have several branches that have another name, or rather path, in the upstream repository, e.g. local branch foo pushes to and fetches from branch path/to/foo in the upstream repository. But the tracking branch is upstream/foo, so the tracking branch path doesn't reflect the upstream branch path.

With this setup, the git.pull and git.sync commands fail with a message "Git: fatal: couldn't find remote ref foo".

Studying the code, I found that the bug is either at extensions/git/src/git.ts, lines 1462 - 1470, https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/git.ts#L1462-L1470
or at extensions/git/src/repository.ts, lines 924, 944 and 1006,
https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/repository.ts#L924
https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/repository.ts#L944
https://github.com/Microsoft/vscode/blob/c63c97c12848e85769e717209b73110e83c18ef6/extensions/git/src/repository.ts#L1006

Should the name field in the upstream object really be the name of the remote tracking branch? Shouldn't it be the name of the tracked branch on the remote? Or should the upstream object contain another field storing the name of the tracked branch on the remote which then should be used at extensions/git/src/repository.ts, lines 924, 944 and 1006?

VS Code version: Code 1.31.1 (1b8e830, 2019-02-12T02:20:54.427Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz (4 x 2592)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.89GB (0.31GB free)
Process Argv c:\Users\perpe\OneDrive - Adaptive Simulations Sweden AB\Source\VSCode Workspaces\NewPostProcessing.code-workspace
Screen Reader no
VM 0%
Extensions (55)
Extension Author (truncated) Version
calculate aca 2.1.0
Bookmarks ale 10.2.2
project-manager ale 10.3.2
code-gnu-global aus 0.2.2
awarest-align awa 1.1.0
path-intellisense chr 1.4.2
ssh chr 0.0.4
bracket-pair-colorizer Coe 1.0.61
vscode-markdownlint Dav 0.25.0
empty-indent Dmi 0.2.0
vscode-gitignore-syntax dun 0.1.2
gitlens eam 9.5.1
tslint eg2 1.0.43
hungry-backspace ekl 1.0.0
prettier-vscode esb 1.8.1
vscode-pyvmmonitor fab 0.0.3
file-icons fil 1.0.16
matlab Gim 0.9.0
todo-tree Gru 0.0.124
rest-client hum 0.21.2
python-coding-conventions igr 0.0.4
latex-workshop Jam 6.1.0
vscode-jira Kni 0.6.0
rest-client Kro 0.18.3
git-tree-compare let 1.5.0
Star lip 0.0.3
remotefs lix 0.0.13
vscode-smart-column-indenter lmc 0.0.13
vscode-3dviewer md2 1.0.0
rainbow-csv mec 1.0.0
git-graph mhu 1.4.1
vscode-deploy-reloaded mkl 0.87.2
vscode-remote-workspace mkl 0.41.0
prettify-json moh 0.0.3
python ms- 2019.2.5558
cpptools ms- 0.21.0
Go ms- 0.9.2
printcode nob 3.0.0
indent-rainbow ode 7.3.0
vscode-code-outline pat 0.2.1
vscode-versionlens pfl 0.22.0
material-icon-theme PKi 3.6.3
quicktype qui 12.0.46
datetime rid 1.0.5
vscode-paste-and-indent Rub 0.0.8
copy-text sal 0.4.3
gitconfig sid 2.0.0
open-file-between-two-folder sky 0.0.1
vscode-hexdump sle 1.7.2
python tht 0.2.3
hosts tom 1.1.1
python-extended-snippets tus 0.0.1
vscodeintellicode Vis 1.1.4
vscode-todo-highlight way 1.0.4
pull-requester yos 0.1.5
@vscodebot vscodebot bot added the git GIT issues label Mar 9, 2019
@joaomoreno
Copy link
Member

joaomoreno commented Mar 11, 2019

What does git rev-parse --symbolic-full-name foo@{u} return? Also what does git remote -vvv return? Also what does git config push.default return?

@joaomoreno joaomoreno self-assigned this Mar 11, 2019
@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Mar 11, 2019
@md2perpe
Copy link
Contributor Author

What does git rev-parse --symbolic-full-name foo@{u} return?

refs/remotes/upstream/foo

Also what does git remote -vvv return?

upstream      https://upstream.server/path/to/repository (fetch)
upstream      https://upstream.server/path/to/repository (push)

Also what does git config push.default return?

(nothing)

I've here modified the answers because I don't want to make the URLs public. Maybe I should make a test with a public gist.

@md2perpe
Copy link
Contributor Author

Here's a repository for testing: https://github.com/md2perpe/vscode-issue-70136/tree/master
Instructions for reproduction are given in README.md.

In the local repository created the answers to your questions are as follows:

What does git rev-parse --symbolic-full-name foo@{u} return?

refs/remotes/upstream/foo

Also what does git remote -vvv return?

upstream        git@github.com:md2perpe/vscode-issue-70136.git (fetch)
upstream        git@github.com:md2perpe/vscode-issue-70136.git (push)

Also what does git config push.default return?

(nothing)

@joaomoreno
Copy link
Member

What what's your git version?

@md2perpe
Copy link
Contributor Author

I use latest git for Windows.

$ git --version
git version 2.21.0.windows.1

@md2perpe
Copy link
Contributor Author

@joaomoreno Have you been able to reproduce?

@joaomoreno
Copy link
Member

Not really... If you change push.default to upstream, does it work?

@md2perpe
Copy link
Contributor Author

Using the command

git config push.default upstream

the following was added to .git/config:

[push]
	default = upstream

The error still occurs.

@md2perpe
Copy link
Contributor Author

md2perpe commented Mar 14, 2019

Did you follow my instructions to reproduce?

@joaomoreno
Copy link
Member

Yup, I understand it now.

The way I see us fixing this is just to remove the arguments passed to git pull. Not sure I would do this for everyone though... so maybe a setting?

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Mar 18, 2019
@joaomoreno joaomoreno added this to the Backlog milestone Mar 18, 2019
@lszomoru lszomoru self-assigned this Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

4 participants
@joaomoreno @md2perpe @lszomoru and others