Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Joni Lameter <jlameter@epic.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
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: <DM6PR17MB215602138249E744ECFE4185A6E62@DM6PR17MB2156.namprd17.prod.outlook.com> (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 https://github.com/git/git.git
  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
  this:

      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 2.42.0.windows.2
  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]
  post-checkout
  post-commit
  post-merge
  pre-push

                 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=DM6PR17MB215602138249E744ECFE4185A6E62@DM6PR17MB2156.namprd17.prod.outlook.com \
    --to=jlameter@epic.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).