Open Bug 1930670 Opened 27 days ago Updated 25 days ago

`Uncommited changes present` error upon `git commit` causes `moz-phab submit` to fail

Categories

(Firefox Build System :: Bootstrap Configuration, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: mkennedy, Unassigned)

Details

System: Ubuntu 22.04.5 LTS (64 Bit)
Git version: 2.34.1
Watchman version: 4.9.0
Python version: 3.10.15

It appears that when watchman is installed, the bootstrap.py --vcs=git command installs a watchman git hook so that git commiting ends up changing unrelated files and causes a Uncommitted changes present error when attempting to submit the patch.

Steps to reproduce

  1. Ensure watchman is installed. I had an older version 4.9.0 from some older project a while ago, but I'm not sure if this issue is present when a newer version is installed.
  2. Ensure you have all dependencies and run curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O to download the bootstrap file as per instructions on the Linux setup instructions on the Firefox Contributors’ Quick Reference guide.
  3. Run bootstrap.py --vcs=git
  4. Make a small change to codebase. I just added a space to a random file (toolkit/docs/javascript-logging.md)
  5. git commit the change
  6. Submit the patch using .moz-phab submit

Actual Behavior
Console logs Uncommitted changes present. Please stash them or commit before submitting error.

Expected behavior
I'm allowed to submit the patch.

A few notes:

  • I was able to see that git commit was changing unrelated files by doing a git diff HEAD~1, which showed my changes, but also contained updates to files that I didn't make--assuming these unrelated changes were caused by the watchman git hook.
  • This issue seems pretty rare since it only seems to happen when watchman is installed on an Ubuntu/linux distro.
  • Removing the pre-installed watchman git hook by setting git config core.fsmonitor=true seems to have fixed the issue.

But still wanted to at least file this issue so that others may be aware.

I've asked Connor to take a look at this, since it seems to be more in his wheelhouse than mine.

Severity: -- → S3
Flags: needinfo?(sheehan)
Priority: -- → P3

(In reply to Mark Kennedy [:mark] from comment #1)

  • Removing the pre-installed watchman git hook by setting git config core.fsmonitor=true seems to have fixed the issue.

This would have been my suggestion as well. I wonder if we should just recommend the builtin Git fsmonitor and remove the Watchman hook.

Flags: needinfo?(sheehan)
You need to log in before you can comment on or make changes to this bug.