Running 'git status' shows modified files even when there are no changes from my side.

164 views
Skip to first unread message

Jay Kapadia

unread,
Dec 22, 2024, 6:11:22 PM12/22/24
to Chromium-dev
It's my first time contributing to chromium. And I am not very sound with git.

I want to make my changes to the codebase and that is why I am ensuring a clean checkout. I downloaded the code a few weeks ago. And now that I am ready to make changes I ran git fetch to get the latest commit history of the remote main branch. Then I ran git pull to fast-forward to the latest commit . Now , as I have not made any changes , I expect 'git status' to show that my branch is up to date with "origin/main" and nothing to commit but it shows modified files and untracked files.

this is what shows on running 'git status' : 

C:\chromium\src>git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   docs/website (new commits)
        modified:   third_party/angle (new commits)
        modified:   third_party/boringssl/src (new commits)
        modified:   third_party/catapult (new commits)
        modified:   third_party/chromium-variations (new commits)
        modified:   third_party/crossbench (new commits)
        modified:   third_party/dawn (new commits)
        modified:   third_party/depot_tools (new commits)
        modified:   third_party/devtools-frontend/src (new commits)
        modified:   third_party/libc++/src (new commits)
        modified:   third_party/libc++abi/src (new commits)
        modified:   third_party/libvpx/source/libvpx (new commits)
        modified:   third_party/llvm-libc/src (new commits)
        modified:   third_party/openscreen/src (new commits)
        modified:   third_party/pdfium (new commits)
        modified:   third_party/perfetto (new commits)
        modified:   third_party/skia (new commits)
        modified:   third_party/webgpu-cts/src (new commits)
        modified:   third_party/webrtc (new commits)
        modified:   third_party/xnnpack/src (new commits)
        modified:   v8 (new commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        tools/page_cycler/

no changes added to commit (use "git add" and/or "git commit -a")


I can't even discard the changes. For example, running 'git reset --hard origin/main' and 'git clean -fd' doesn't help.It still shows the changes.

Philip Rogers

unread,
Dec 23, 2024, 9:09:13 AM12/23/24
to Chromium-dev, Jay Kapadia
You need to run "gclient sync" (checking-out-and-building has more info about this) to update external dependencies. The repositories listed with changes (v8, skia, etc) are external which is why the local git commands aren't enough.

Jay Kapadia

unread,
Dec 23, 2024, 2:24:03 PM12/23/24
to Chromium-dev, Philip Rogers, Jay Kapadia
Thanks for answering !

I have come a little further. I used the "gclient sync" command , that should have solved the problem. But it threw an error which asked me to login using "" command and I thought that there's some issue as the first time I was not asked to login or anything. So , I decided to redownload the code using "fetch chromium" which threw the same error that asked me login. I logged in and ran "fetch chromium" again which threw a different error this time as follows:

C:\chromium_new>fetch --no-history chromium
Updating depot_tools...
Running: 'C:\Users\jayka\AppData\Local\.vpython-root\store\python_venv-4uhfsjhi5for37hmdjer3ht0k0\contents\Scripts\python3.exe' 'C:\src\depot_tools\gclient.py' root
Running: 'C:\Users\jayka\AppData\Local\.vpython-root\store\python_venv-4uhfsjhi5for37hmdjer3ht0k0\contents\Scripts\python3.exe' 'C:\src\depot_tools\gclient.py' config --spec 'solutions = [
  {
    "name": "src",
    "url": "https://chromium.googlesource.com/chromium/src.git",
    "managed": False,
    "custom_deps": {},
    "custom_vars": {},
  },
]
'
Running: 'C:\Users\jayka\AppData\Local\.vpython-root\store\python_venv-4uhfsjhi5for37hmdjer3ht0k0\contents\Scripts\python3.exe' 'C:\src\depot_tools\gclient.py' sync --no-history
Syncing projects: 100% ( 1/ 1) src
src (ERROR)
----------------------------------------
[0:00:00] Started.
[0:01:10]
[0:01:11] _____ Conflicting directory found in C:\chromium_new\src. Moving to C:\chromium_new\_bad_scm\srcjma9xhxo.
----------------------------------------


Warnings:
Conflicting directory C:\chromium_new\src moved to C:\chromium_new\_bad_scm\srcjma9xhxo.
Traceback (most recent call last):
  File "C:\src\depot_tools\gclient_scm.py", line 832, in update
    self.current_revision = self._Clone(revision, url, options)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gclient_scm.py", line 1372, in _Clone
    git_auth.ConfigureGlobal('/', url)
  File "C:\src\depot_tools\git_auth.py", line 301, in ConfigureGlobal
    ConfigChanger.new_for_remote(cwd, remote_url).apply_global(cwd)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\git_auth.py", line 122, in new_for_remote
    c.mode = cls._infer_mode(cwd, c._shortname + '-review.googlesource.com')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\git_auth.py", line 133, in _infer_mode
    if not gerrit_util.GitCredsAuthenticator.gerrit_account_exists(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gerrit_util.py", line 913, in gerrit_account_exists
    scm.GIT.SetConfig(cwd, 'depot-tools.hostHasAccount', host, append=True)
  File "C:\src\depot_tools\scm.py", line 834, in SetConfig
    GIT._get_config_state(cwd).SetConfig(key,
  File "C:\src\depot_tools\scm.py", line 369, in SetConfig
    self._impl.set_config(key, value, append=append, scope=scope)
  File "C:\src\depot_tools\scm.py", line 434, in set_config
    GIT.Capture(args, cwd=self.root)
  File "C:\src\depot_tools\scm.py", line 710, in Capture
    return git_common.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\git_common.py", line 865, in run
    return run_with_stderr(*cmd, **kwargs)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\git_common.py", line 944, in run_with_stderr
    raise ex
  File "C:\src\depot_tools\git_common.py", line 934, in run_with_stderr
    return _run_with_stderr(*cmd, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\git_common.py", line 971, in _run_with_stderr
    raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(), stdout,
subprocess2.CalledProcessError: Command 'C:\\Program Files\\Git\\cmd\\git.exe -c color.ui=never config --local depot-tools.hostHasAccount chromium-review.googlesource.com --add' returned non-zero exit status 128 in C:\chromium_new
fatal: --local can only be used inside a git repository


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jayka\AppData\Local\.vpython-root\store\cpython+77vkdc5f3t4dm3hikhtc9e5djk\contents\bin\Lib\shutil.py", line 853, in move
    os.rename(src, real_dst)
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\chromium_new\\src' -> 'C:\\chromium_new\\_bad_scm\\srcjma9xhxo\\src'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\src\depot_tools\metrics.py", line 302, in print_notice_and_exit
    yield
  File "C:\src\depot_tools\gclient.py", line 4660, in <module>
    sys.exit(main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gclient.py", line 4646, in main
    return dispatcher.execute(OptionParser(), argv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\subcommand.py", line 254, in execute
    return command(parser, args[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gclient.py", line 3999, in CMDsync
    ret = client.RunOnDeps('update', args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gclient.py", line 2439, in RunOnDeps
    work_queue.flush(revision_overrides,
  File "C:\src\depot_tools\gclient_utils.py", line 1028, in flush
    reraise(e[0], e[1], e[2])
  File "C:\src\depot_tools\gclient_utils.py", line 53, in reraise
    raise value
  File "C:\src\depot_tools\gclient_utils.py", line 1107, in run
    self.item.run(*self.args, **self.kwargs)
  File "C:\src\depot_tools\gclient.py", line 1251, in run
    self._got_revision = self._used_scm.RunCommand(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gclient_scm.py", line 137, in RunCommand
    return getattr(self, command)(options, args, file_list)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\src\depot_tools\gclient_scm.py", line 664, in wrapper
    return_val = f(*args)
                 ^^^^^^^^
  File "C:\src\depot_tools\gclient_scm.py", line 835, in update
    self._DeleteOrMove(options.force)
  File "C:\src\depot_tools\gclient_scm.py", line 209, in _DeleteOrMove
    shutil.move(self.checkout_path, dest_path)
  File "C:\Users\jayka\AppData\Local\.vpython-root\store\cpython+77vkdc5f3t4dm3hikhtc9e5djk\contents\bin\Lib\shutil.py", line 873, in move
    copy_function(src, real_dst)
  File "C:\Users\jayka\AppData\Local\.vpython-root\store\cpython+77vkdc5f3t4dm3hikhtc9e5djk\contents\bin\Lib\shutil.py", line 448, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Users\jayka\AppData\Local\.vpython-root\store\cpython+77vkdc5f3t4dm3hikhtc9e5djk\contents\bin\Lib\shutil.py", line 256, in copyfile
    with open(src, 'rb') as fsrc:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\chromium_new\\src'

Subprocess failed with return code 1.

Jay Kapadia

unread,
Dec 24, 2024, 2:27:32 PM12/24/24
to Chromium-dev, Jay Kapadia, Philip Rogers
Can you help me with this?

Allen Li

unread,
Jan 7, 2025, 5:04:02 PMJan 7
to jaykap...@gmail.com, Chromium-dev, Philip Rogers
For reference, this issue is being tracked in https://g-issues.chromium.org/issues/328682976

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/bd970170-4f22-4f06-b9ac-a5afde336a9dn%40chromium.org.

Allen Li

unread,
Jan 7, 2025, 6:14:13 PMJan 7
to jaykap...@gmail.com, Chromium-dev, Philip Rogers
Sorry, corrected URL: https://crbug.com/328682976
Reply all
Reply to author
Forward
0 new messages