Git Product home page Git Product logo

Comments (4)

rhysd avatar rhysd commented on May 30, 2024

Would you make a repro? Do you mean following situation?

mkdir foo && cd foo
mkdir bar && cd bar && git init .
touch a && git add a && git commit -m test
cd ..
ln -s b ./foo/a
vim b

from git-messenger.vim.

anihm136 avatar anihm136 commented on May 30, 2024

Okay, sorry to file without exploring fully. The minimal case works fine. Here is the specific case that I'm having issues with -
Directory structure is as follows -

A.txt -> symlink to a file in a repo
B/ -> symlink to a directory in a repo
	C.txt -> file inside B (inside the repo) 

Now, it works fine when

  1. I open C.txt as nvim B/C.txt
  2. cd B && nvim ../A.txt
    However, the following cases don't work -
  3. nvim A.txt - does not detect A.txt as a version controlled file
  4. After opening A.txt. :edit B/C.txt - does not detect C.txt as a version controlled file
    This is probably a very niche case, and maybe not recommended by git itself (this is basically how I have all my dotfiles set up). Let me know if I can share any more info

from git-messenger.vim.

anihm136 avatar anihm136 commented on May 30, 2024

Also worth noting that I am using neovim, not vim

from git-messenger.vim.

rhysd avatar rhysd commented on May 30, 2024

This is not an issue because symlinks outside repository are not handled as files in the repository by Git.

$ mkdir foo && cd foo
$ git init .
$ touch A
$ cd ..
$ ln -s ./foo/A B
$ git add B
fatal: not a git repository (or any of the parent directories): .git

Symlink is not resolved automatically. The linked file is treated as if it is put in the same directory where the symlink is put in. This behavior seems standard in many other CLI tools; they don't resolve symlinks. git-messenger.vim also should follow this behavior, I think.

from git-messenger.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.