Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Joni Lameter <>
To: "" <>
Subject: [BUG REPORT] fsmonitor and core.untrackedCache combination causes inaccurate git status
Date: Thu, 9 May 2024 15:45:47 +0000	[thread overview]
Message-ID: <> (raw)

Subject: [BUG REPORT] fsmonitor and core.untrackedCache combination causes inaccurate git status

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

  ## Setup
  git clone
  cd git
  git config core.fsmonitor true
  git config core.untrackedCache true
  git config alias.fetch-bug '!git -C "$(pwd)" fetch'
  wt1=$(mktemp -d)
  git worktree add "$wt1" -b test
  cd "$wt1"

  ## Worktree steps
  git fsmonitor--daemon stop
  git fetch-bug
  touch foo.txt
  git status
  touch bar.txt
  git status

# What did you expect to happen? (Expected behavior)

  Expected bar.txt file to appear as an untracked file

# What happened instead? (Actual behavior)

  bar.txt did not appear as an untracked file or in the status output
  at all

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

  git status did not accurately reflect the state of the worktree

# Anything else you want to add:

  The worktree seems to remain in a bug prone state even after
  core.untrackedCache has been disabled, adding these steps shows

      git config core.untrackedCache false
      # repeat "Worktree steps" (changing file names)
      git config --unset core.untrackedCache
      # repeat "Worktree steps" (changing file names)

  When a worktree is added and core.untrackedCache was not set to true
  it does not reproduce the error:

      git config --unset core.untrackedCache
      wt2=$(mktemp -d)
      git worktree add "$wt2" -b test-2
      cd "$wt2"
      # repeat "Worktree steps"

[System Info]
  git version:
  git version
  cpu: x86_64
  built from commit: 2f819d1670fff9a1818f63b6722e9959405378e3
  sizeof-long: 4
  sizeof-size_t: 8
  shell-path: /bin/sh
  feature: fsmonitor--daemon
  uname: Windows 10.0 22631 
  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]

                 reply	other threads:[~2024-05-09 16:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).