[BUG] `git add -p` seems to corrupt a sparse index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What did you do before the bug happened? (Steps to reproduce your issue)

    git init
    for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
    git add -A && git commit -m'Some content'

    git sparse-checkout set --sparse-index b
    seq 1 20 > b/file-2
    git add -N b/file-2
    git add -p b/file-2
    git status

What did you expect to happen? (Expected behavior)

  I expected to be dropped into the interactive-add workflow / see my
  changes in git-status.

What happened instead? (Actual behavior)

  git-add reports 'No changes' and git-status reports nothing at all
  (empty output).

  The original internal report also was able reproduce messaging like

      fatal: cache entry out of order
      warning: die() called many times. Recursion error or racy threaded death!
      fatal: cache entry out of order
      fatal: cache entry out of order
      fatal: cache entry out of order

  though I've not been able to reproduce that myself. It seems relevant
  / worth noting that core.fsmonitor would be set to 'true' in that
  repository.

What's different between what you expected and what actually happened?

  git-status appears to silently crash in the error case.

  Compare the broken workflow with any of the following variants (all of
  which work as expected):

  - don't use `--intent-to-add`:

      git init
      for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
      git add -A && git commit -m'Some content'
      git sparse-checkout set --sparse-index b
      seq 1 20 > b/file-2
      git add b/file-2
      git status

  - don't use `sparse-checkout` at all:

      git init
      for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
      git add -A && git commit -m'Some content'
      seq 1 20 > b/file-2
      git add -N b/file-2
      git add -p b/file-2
      git status

  - don't use `--sparse-index` specifically:

      git init
      for dir in a b c; do mkdir $dir && seq 1 20 > $dir/file; done
      git add -A && git commit -m'Some content'
      git sparse-checkout set b
      seq 1 20 > b/file-2
      git add -N b/file-2
      git add -p b/file-2
      git status

Anything else you want to add:

  Seems very related to the use of sparse-index.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.43.0.windows.1
cpu: x86_64
built from commit: 4b968f3ea3b32a7bc50846bab49f3f381841d297
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044
compiler info: gnuc: 13.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]


--
Sean Allred




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux