`Uncommited changes present` error upon `git commit` causes `moz-phab submit` to fail
Categories
(Firefox Build System :: Bootstrap Configuration, defect, P3)
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 commit
ing ends up changing unrelated files and causes a Uncommitted changes present
error when attempting to submit the patch.
Steps to reproduce
- 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. - 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. - Run
bootstrap.py --vcs=git
- Make a small change to codebase. I just added a space to a random file (toolkit/docs/javascript-logging.md)
git commit
the change- 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.
Reporter | ||
Comment 1•27 days ago
•
|
||
A few notes:
- I was able to see that
git commit
was changing unrelated files by doing agit 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.
Comment 2•26 days ago
|
||
I've asked Connor to take a look at this, since it seems to be more in his wheelhouse than mine.
Comment 3•25 days ago
|
||
(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.
Description
•