Skip to content

Unstaged type changes and deletions are misrecognized as staged changes #536

Open
@mlell

Description

@mlell

Hi, thank you for maintaining this script, it helps me every day!

I am using git annex, so my repository contains a lot of symlinks (git-annex maintains a separate storage of large files in .git/ and commits symlinks to these files instead of the big files themselves). The files that are annexed are results of a scientific pipeline, so when the computation is executed, it will replace the committed version (i.e., the symlinks) by a regular file with the new content. Executing git annex add will move these files to the annex storage and create new symlinks in their place. This means that I get a lot of "typechange" git status outputs:

$ git status
On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .doit.db.db
        deleted:    data/03 Merge genomic and phenotypic/BLUEs/blues_across.qs
        deleted:    data/03 Merge genomic and phenotypic/BLUEs/blues_within.qs
        typechange: data/03 Merge genomic and phenotypic/Match genotype names/ARGV.rds
        typechange: data/03 Merge genomic and phenotypic/Match genotype names/genotypes.fst

or when using git status -s:

$ git status -s
 M .doit.db.db
 D "data/03 Merge genomic and phenotypic/BLUEs/blues_across.qs"
 D "data/03 Merge genomic and phenotypic/BLUEs/blues_within.qs"
 T "data/03 Merge genomic and phenotypic/Match genotype names/ARGV.rds"
 T "data/03 Merge genomic and phenotypic/Match genotype names/genotypes.fst"
  • Expectation: bash-git-prompt shows [master L|✚ 5]
  • Actual behaviour: bash-git-prompt shows [master L|●2✚ 3]
  • Version of bash-git-prompt: 5cf208c` (2023-10-12)

So it shows my deletions and typechanges are staged changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions