Skip to content

gix status shows submodule flagged with --assume-unchanged after replacing by symlink #2435

@pro7onmatrix

Description

@pro7onmatrix

Current behavior 😯

I have a number of repos which share a common submodule. To save on some disk space and ensure all are on the same version without loads of pushing and pulling, I have locally flagged the submodule with git update-index --assume-unchanged and then replaced the folder by a symlink to a single local checkout of the submodule.

gix status now gives output relating to the submodule.

Some notes:

  • If I only modify files within the submodule or even remove the directory altogether, nothing is shown
  • If I remove the directory and replace it by a file with the same name (instead of the symlink), the same thing happens. Perhaps some logic which tells gix status to expect the path to be a directory is triggered before checking the --assume-unchanged flag?

Expected behavior 🤔

gix status should give no output relating to the submodule.

Git behavior

After following the steps to reproduce, git status shows no changes:

$ git status
On branch master
nothing to commit, working tree clean

Steps to reproduce 🕹

  1. Setup:
    $ cargo install --git https://github.com/GitoxideLabs/gitoxide --tag gix-v0.79.0 gitoxide
    $ mkdir repo && cd repo
    $ git init
    $ git submodule add https://github.com/GitoxideLabs/gitoxide.git
    $ git commit -m "..."
    $ git update-index --assume-unchanged gitoxide
    
  2. Remove the directory (doesn't show up in gix status):
    $ rm -rf gitoxide
    $ gix status
     17:45:59 status done 2.0 files in 0.00s (2.5k files/s)
    
  3. Symlink the submodule path (now shows up in gix status):
    $ git clone https://github.com/GitoxideLabs/gitoxide.git ../gitoxide
    $ ln -s ../gitoxide
    $ gix status
     17:46:55 status done 2.0 files in 0.00s (2.5k files/s)
      ? gitoxide
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedan issue is accepted as shortcoming to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions