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

git prevents pulling upstream due to non-existent local changes #471

Open
1 task done
GuMiner opened this issue Dec 1, 2021 · 4 comments
Open
1 task done

git prevents pulling upstream due to non-existent local changes #471

GuMiner opened this issue Dec 1, 2021 · 4 comments

Comments

@GuMiner
Copy link

GuMiner commented Dec 1, 2021

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

64-bit. However, this also repros on the macOS build of Git.

$ git --version --build-options
git version 2.34.0.vfs.0.0
cpu: x86_64
built from commit: 599a56ae91cee374b95d19c73aeead6ea18ea7a2
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.19044.1348]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Core
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I already had a sparse-checkout repository before using this version of Git.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

git pull origin <my-branch>

Unfortunately, this issue happened after using this version of git for a while and continued until I added the affected file paths to my sparse checkout list.

  • What did you expect to occur after running these commands?

Git pulls from the upstream

  • What actually happened instead?

Git didn't pull because files were changed that didn't exist locally. These file paths were not in my sparse checkout list. For instance, devapk/excel/en-us existed in the sparse-checkout list, but not devapk/excel/ja-jp.pseudo

git pull origin <my-branch>
Prefetch 1638298835 (2021-11-30 19:00:35 +0000) (bytes received): 8, done.
From https://dev.azure.com/office/office/_git/Office
 * branch                      official/appleauto -> FETCH_HEAD
warning: Fetch normally indicates which branches had a forced update,
but that check has been disabled. To re-enable, use '--show-forced-updates'
flag or run 'git config fetch.showForcedUpdates true'.
error: Your local changes to the following files would be overwritten by merge:
        devapk/excel/ja-jp.pseudo/product/build.gradle
        devapk/excel/ja-jp.pseudo/product/sources
        devapk/officemobile/ja-jp.pseudo/product/build.gradle
        devapk/officemobile/ja-jp.pseudo/product/sources
        devapk/onenote/ja-jp.pseudo/product/modernonenote/apk/build.gradle
        devapk/onenote/ja-jp.pseudo/product/modernonenote/apk/sources
        devapk/ppt/ja-jp.pseudo/product/build.gradle
        devapk/ppt/ja-jp.pseudo/product/sources
        devapk/rio/ar-sa.pseudo/build.gradle
        devapk/word/ja-jp.pseudo/product/build.gradle
        devapk/word/ja-jp.pseudo/product/sources
Please commit your changes or stash them before you merge.
Aborting
Updating 608889a9daba..bac8a2bed9c1
Calling 'git fetch' to pick up upstream refs...
Prefetch 1638298835 (2021-11-30 19:00:35 +0000) (bytes received): 8, done.
warning: Fetch normally indicates which branches had a forced update,
but that check has been disabled. To re-enable, use '--show-forced-updates'
flag or run 'git config fetch.showForcedUpdates true'.
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

https://office.visualstudio.com/Office/_git/Office

@derrickstolee
Copy link

Thanks for the report, @GuMiner. Do you still have a repro?

My guess is that you had some files leftover from a previous change that were left by a previous Git version, and git sparse-checkout reapply would have fixed this for you, too.

I have added these instructions to the release notes:

🚨 Special Instructions 🚨

If this is your first time using the sparse index, then you will need to run the following command after installing:

git sparse-checkout reapply

If we do get a repro of this issue, then the following would help us diagnose the problem:

  1. Run scalar diagnose and note where it places a .zip file. (It is important that you do this before adjusting the sparse-checkout.)
  2. Does the same thing happen if you run git fetch origin <branch> followed by git merge origin/<branch>?
  3. Does it happen again after running git sparse-checkout reapply?

Finally, sending the .zip from the scalar diagnose command to [email protected] would allows us to examine your index and related ref state to try and create a reproduction.

@GuMiner
Copy link
Author

GuMiner commented Dec 1, 2021

Unfortunately I no longer have a repro. However, I can confirm I did not run git sparse-checkout reapply after installing the new Git version.

@derrickstolee
Copy link

Thanks to Mike Marcelais, we found a reproducible situation that allowed us to tackle and fix this problem. The pull request is available as #473. We intend to review, merge, and release that fix early next week. (We will discuss as a team whether we should include other fixes, such as merging 2.34.1 or #470.)

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

No branches or pull requests

2 participants