vscode-git-graph icon indicating copy to clipboard operation
vscode-git-graph copied to clipboard

Support for Git File Type Changes (e.g. symbolic links <-> files)

Open marco-m-pix4d opened this issue 3 years ago • 3 comments

Describe the Bug

Git allows to track symlinks. If a file was originally added to a git repo as a symlink, and subsequently is replaced with a normal file (so the name stays the same), it will be reported as typechange:

$ git status
...
    typechange: foo

This extension:

  • reports correctly the change count: "Uncommitted Changes (1)"
  • but does NOT list the change in the panel to the right of "Displaying all uncommitted changes."

Steps to Reproduce

$ git init
$ touch foo
$ ln -s foo bar
$ ls -l
lrwxrwxrwx bar -> foo
-rw-r--r-- foo
$ git add bar foo
$ git commit -m 1
[master (root-commit) 1b5fc81209] 1
 2 files changed, 1 insertion(+)
 create mode 120000 bar
 create mode 100644 foo
$ code --add .
$ rm bar
$ touch bar
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        typechange: bar

no changes added to commit (use "git add" and/or "git commit -a")

The extension shows:

graph

NOTE: The reproduction steps above use an empty file for simplicity, but the bug is present also if the file is not empty.

Expected Behaviour

The panel to the right of "Displaying all uncommitted changes." should show file bar.

Environment

  • Git Graph Extension Version: v1.30.0 (latest)
  • Visual Studio Code Version: 1.56.2 (latest)
  • Operating System: macOS Big Sur

Additional Context (optional)

Note that I am using Git Graph with the Remote SSH extension.

Additional notes

Once more, thanks for Git Graph!

marco-m-pix4d avatar Jun 08 '21 06:06 marco-m-pix4d