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

Extend handling of symbolic links #222

Closed
reporter123 opened this issue Nov 29, 2019 · 12 comments
Closed

Extend handling of symbolic links #222

reporter123 opened this issue Nov 29, 2019 · 12 comments
Assignees
Labels
improvement An improvement to existing functionality
Milestone

Comments

@reporter123
Copy link

Steps to Reproduce
Steps to reproduce the behaviour:
Create an Issue Linking regexp in "Respository Settings"
Close vscode
Relaunch vscode with same workspace
"Issue Linking" is blank.

Expected Behaviour
"Issue Linking" regexp should be restored.

Environment

  • Git Graph Extension Version: 1.19.1]
  • Visual Studio Code Version: 1.40.2
  • Operating System: Linux-x64
@reporter123 reporter123 added the bug Something isn't working label Nov 29, 2019
@mhutchie
Copy link
Owner

I haven't been able to replicate the incorrect behaviour you're describing.

Could you please confirm the following details:

  • After using the "Add Issue Linking" dialog, and pressing save, has the Repository Settings Widget > Issue Linking section changed to display the "Issue Regex" & "Issue URL" you have entered?
  • What do you mean by "Issue Linking" is blank: does it shown nothing at all in the section, the "Add Issue Linking" message & button, or are the "Issue Regex" & "Issue URL" fields are listed but the values are blank?
  • Is the Issue Linking configuration also not saved if you close the Git Graph View, and then re-open the Git Graph View? (i.e. your re-opening the Git Graph View, not the application) (from a saving state perspective, this is identical to re-lauching Visual Studio Code)
  • Open the Commit Details View on a commit in the repository, and switch it to the "File List View". When you close & relaunch Visual Studio Code, and re-open the Commit Details View, is it still set to "File List View"? (this uses the same state mechanism to store your settings)
  • Once you've re-launched Visual Studio Code, open the Visual Studio Code Output View, and switch to viewing the "Git Graph" Output Channel. Please copy and paste the output into a text file and include it in your response.

@mhutchie mhutchie added the needs more info More information has been requested label Nov 29, 2019
@reporter123
Copy link
Author

After using the "Add Issue Linking" dialog, and pressing save, has the Repository Settings Widget > Issue Linking section changed to display the "Issue Regex" & "Issue URL" you have entered?
yes.
image

What do you mean by "Issue Linking" is blank: does it shown nothing at all in the section, the "Add Issue Linking" message & button, or are the "Issue Regex" & "Issue URL" fields are listed but the values are blank?

Looks like nothing is setup

image

Comments
@reporter123
reporter123 commented 1 hour ago

Steps to Reproduce
Steps to reproduce the behaviour:
Create an Issue Linking regexp in "Respository Settings"
Close vscode
Relaunch vscode with same workspace
"Issue Linking" is blank.

Expected Behaviour
"Issue Linking" regexp should be restored.

Environment

Git Graph Extension Version: 1.19.1]
Visual Studio Code Version: 1.40.2
Operating System: Linux-x64

@reporter123 reporter123 added the bug label 1 hour ago
@reporter123 reporter123 assigned mhutchie 1 hour ago
@mhutchie
Owner
mhutchie commented 12 minutes ago

I haven't been able to replicate the incorrect behaviour you're describing.

Could you please confirm the following details:

After using the "Add Issue Linking" dialog, and pressing save, has the Repository Settings Widget > Issue Linking section changed to display the "Issue Regex" & "Issue URL" you have entered?
What do you mean by "Issue Linking" is blank: does it shown nothing at all in the section, the "Add Issue Linking" message & button, or are the "Issue Regex" & "Issue URL" fields are listed but the values are blank?
Is the Issue Linking configuration also not saved if you close the Git Graph View, and then re-open the Git Graph View? (i.e. your re-opening the Git Graph View, not the application) (from a saving state perspective, this is identical to re-lauching Visual Studio Code)
Open the Commit Details View on a commit in the repository, and switch it to the "File List View". When you close & relaunch Visual Studio Code, and re-open the Commit Details View, is it still set to "File List View"?

This also fails to save.

Once you've re-launched Visual Studio Code, open the Visual Studio Code Output View, and switch to viewing the "Git Graph" Output Channel. Please copy and paste the output into a text file and include it in your response.

[2019-11-29 16:18:22.254] Starting Git Graph ...
[2019-11-29 16:18:22.921] Using git (version: 2.24.0)
[2019-11-29 16:18:22.930] Removed repo: /usr/src/kdesrc/kdiff3
[2019-11-29 16:18:22.944] > git rev-parse --show-toplevel
[2019-11-29 16:18:22.946] Started Git Graph - Ready to use!
[2019-11-29 16:18:23.315] Searching workspace for new repos ...
[2019-11-29 16:18:23.315] Completed searching workspace for new repos
[2019-11-29 16:18:45.104] > git rev-parse --show-toplevel
[2019-11-29 16:18:45.340] Added new repo: /usr/src/kdesrc/kdiff3
[2019-11-29 16:18:45.362] Created Git Graph View
[2019-11-29 16:18:49.156] > git branch -a --no-color
[2019-11-29 16:18:49.168] > git remote
[2019-11-29 16:18:49.174] Started watching repo: /usr/src/kdesrc/kdiff3
[2019-11-29 16:18:49.205] > git log --max-count=301 --format=... --date-order --branches --tags --remotes HEAD --
[2019-11-29 16:18:49.225] > git show-ref -d --head
[2019-11-29 16:18:49.245] > git reflog --format=... refs/stash --
[2019-11-29 16:18:49.277] > git status -s --branch --untracked-files --porcelain
[2019-11-29 16:18:53.320] > git --no-pager config --list --local
[2019-11-29 16:18:53.343] > git remote

@mhutchie
Copy link
Owner

mhutchie commented Nov 29, 2019

Thanks for your response, as you can see in the Output Channel, line 3 Removed repo: /usr/src/kdesrc/kdiff3, and then a few lines later Added new repo: /usr/src/kdesrc/kdiff3. This is causing the extensions repository state to be lost as the old repo state is deleted, and the new one that is created is created fresh with no Issue Linking. It also indicates this issue is unrelated to Issue Linking itself, and is affecting the extensions ability to persist a repositories state across Visual Studio Code sessions.

On startup the extension performs two checks for each existing repository that results in them being deleted, either:

  • The repo does not appear to be in the Visual Studio Code Workspace (the repo is in the workspace if the workspaces path is within the repo, the same as the repo, or contains the repo)
  • The path could not be checked and confirmed as a Git repository.

What is the workspaces path that you're opening in Visual Studio Code?
Are you using symbolic links in the repository or workspaces paths (this could cause Condition 1 to be incorrectly triggered)?

@reporter123
Copy link
Author

I have not specifically opened a workspace so vscode is using whatever default it goes to when using "Open Folder". The repo was indeed opened via symlink what you see in the logs is the resolved absolute path.

@mhutchie
Copy link
Owner

mhutchie commented Nov 29, 2019

Thanks for confirming that!

Could you please provide the full path of the symbolic link that you're opening with the "Open Folder" dialog? (so I can see the symbolic link and the absolute path it resolves to)

Because the symlink you're opening in Visual Studio Code appears to be a different path to the absolute path of the detected repository, Git Graph is not detecting that the repository belongs to the workspace, and is consequently deleting it's stored state. This is preventing any Git Graph repository state from being persisted across Visual Studio Code sessions (which prevents configuration of functionality like Issue Linking, and the Commit Details View File View Type from being persisted across sessions).

I'll rename & relabel this issue accordingly, as the current behaviour is functioning correctly, the extension just doesn't fully support symbolic links (in the specific circumstance you have). I'll include this functionality in the next beta release, which should be available in the next few days.

@mhutchie mhutchie changed the title Issue Linking configure not saved Extend handling of symbolic links Nov 29, 2019
@mhutchie mhutchie added improvement An improvement to existing functionality and removed bug Something isn't working needs more info More information has been requested labels Nov 29, 2019
@mhutchie mhutchie added this to the v1.20.0 milestone Nov 29, 2019
@reporter123
Copy link
Author

The symlink path is /home/michael/kdesrc. Usually shown as ~/kdesrc.

@mhutchie
Copy link
Owner

Which of the following is the actual symlink?

  • /home/michael -> /usr/src
  • /home/michael/kdesrc -> /usr/src/kdesrc
  • /home/michael/kdesrc -> /usr/src/kdesrc/kdiff3

@reporter123
Copy link
Author

/home/michael/kdesrc -> /usr/src/kdesrc

@mhutchie
Copy link
Owner

mhutchie commented Dec 5, 2019

Could you confirm how you're opening the Git Graph View, is it via the Status Bar Item, or from the Visual Studio Code Git Panel?

I've tried Windows, Mac, WSL & Linux, and the only way I've found that causes the extension to fall back to the actual path (instead of using the symbolic link) is if the Git Graph View is opened via the VSCode Git Panel. If this is the case, in the repo dropdown in the Git Graph View you should be able to select the symbolic path repo instead of the actual path version (using the repo with the symbolic path will allow Git Graph to retain the previous sessions state).

I found that the VSCode Git Panel provides the actual path of the repo, not the symbolic path (unlike every other integration point with VSCode). If opened from it, Git Graph currently creates a new repo using the actual path, instead of opening the symbolic path version. (I'll definitely extend symbolic link support for this)

@reporter123
Copy link
Author

I use the "Visual Studio Code Git Panel" incidentally your extension isn't the only one that seems be confused by the symlink.

@mhutchie
Copy link
Owner

mhutchie commented Dec 5, 2019

Awesome, I just updated my previous reply with more information (which you might find interesting). I'll implement support for this now and have a beta release available soon.

Apologies for the delay, it took a while to work out the cause of your issue.

mhutchie added a commit that referenced this issue Dec 6, 2019
@mhutchie
Copy link
Owner

mhutchie commented Dec 6, 2019

This will be available in v1.20.0.

If you'd like to use it before the next release, you can download v1.20.0-beta.0, and install it following the instructions provided here.

@mhutchie mhutchie closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement An improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants