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

Test: Git - repositories in parent directories #172010

Closed
2 tasks done
lszomoru opened this issue Jan 23, 2023 · 1 comment
Closed
2 tasks done

Test: Git - repositories in parent directories #172010

lszomoru opened this issue Jan 23, 2023 · 1 comment

Comments

@lszomoru
Copy link
Member

lszomoru commented Jan 23, 2023

Refs: #169256

Complexity: 5

Create Issue


Using default settings, Git repositories are discovered based on the workspace folders, and parent folders of the opened files. There are scenarios in which the Git repository root is in one of the parent folders of the workspace, opened file(s). This is a valuable feature as it allows users to open a subfolder of a Git repository yet have the ability to perform source control operations.

Unfortunately, we have seen that this behaviour can also cause confusion. One such scenario is when one opens a loose file in the home folder, and there is a Git repository in the home directory. In this case the repository from the home directory and can cause confusion as there are lots of changes in the "Source Control" view. Also discarding those changes results in data loss.

This milestone we have introduced a new setting, git.openRepositoryInParentFolders to control how repositories in parent directories are opened.

Pre-requisites

  • Install the latest version of VS Code Insiders
  • Ensure that the following settings are set to their default value:
    • git.autoRepositoryDetection to true
    • git.openRepositoryInParentFolders to prompt

Setting

  • Open VS Code Insiders
  • Open the settings editor and find the git.openRepositoryInParentFolders setting
  • Review the description or the setting and the options and let me know whether the descriptions are clear

Always

  • Open VS Code Insiders
  • Open settings editor and set git.openRepositoryInParentFolders to always
  • Clone the microsoft/vscode repository and open the extensions/git folder
  • Switch to the "Source Control" view
    • Confirm that the microsoft/vscode repository appears

Never

  • Open VS Code Insiders
  • Open settings editor and set git.openRepositoryInParentFolders to never
  • Clone the microsoft/vscode repository and open the extensions/git folder
  • Switch to the "Source Control" view
    • Confirm that no notification is being shown
    • Confirm that you are shown a welcome view informing you that a repository was found in the parent folders
    • Confirm that clicking on the link in the welcome view opens the Settings editor at git.openRepositoryInParentFolders

Prompt (loose file)

  • Open VS Code Insiders
  • Open settings editor and set git.openRepositoryInParentFolders to prompt
  • Clone the microsoft/vscode repository and open a loose file (ex: extensions/git/src/main.ts)
    • Confirm that a notification is shown that a git repository was found in the parent folders
    • Review the text in the notification and the options and let me know if there is any confusion
  • Open a "Source Control" view
    • Confirm that you are shown a welcome view informing you that a repository was found in the parent folders

Prompt (folder/workspace)

  • Open VS Code Insiders
  • Open settings editor and set git.openRepositoryInParentFolders to prompt
  • Clone the microsoft/vscode repository and open the extensions/git folder
    • Confirm that a notification is shown that a git repository was found in the parent folders
  • Open the "Source Control" view and click on the "Operation Repository" command
    • Confirm that a quick pick is opened showing the correct path of the git repository
  • Pick the git repository and press ENTER
    • Confirm that the microsoft/vscode repository appears
  • Close the folder
  • Open the extensions/github folder
    • Confirm that no notification is being shown
  • Open a "Source Control" view
    • Confirm that the microsoft/vscode repository appears

Prompt (aways)

  • Open VS Code Insiders
  • Open settings editor and set git.openRepositoryInParentFolders to prompt
  • Clone the microsoft/vscode repository to a separate folder (ex: vscode1) and open the extensions/git folder
    • Confirm that a notification is shown that a git repository was found in the parent folders
  • Choose "Always" in the notification
    • Confirm that a quick pick is opened showing the correct path of the git repository
  • Pick the git repository and press ENTER
  • Switch to the "Source Control" view
    • Confirm that the microsoft/vscode repository appears
  • Open the Settings Editor and find the git.openRepositoryInParentFolders setting
    • Confirm that the value has been updated to "Always"
@rzhao271
Copy link
Contributor

Nit: If I press the "Always" button on the notification for the "Prompt (always)" steps, the SCM viewlet automatically loads the repository. There is no quickpick for me to choose a repository from. I'm guessing this is because I only have one parent repository for the open file?

@rzhao271 rzhao271 removed their assignment Jan 24, 2023
@bhavyaus bhavyaus added verified Verification succeeded and removed verified Verification succeeded labels Jan 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants