Tl;dr - We are switching chromium/src to use git submodules and this change will impact developer workflows. Always run gclient sync after checking out a new commit (e.g. after git pull) or you will need to explicitly add files that you intend to change.
We are adding git submodules to chromium/src. With that, git submodule diffs will show up in repos that have git dependencies. Not running gclient sync after git pull or git checkout, may result in outdated git submodule checkouts and git showing unstaged submodule commits.
What does this mean for me?
Always run gclient sync after updating your chromium checkout (e.g. git pull, git checkout), and you shouldn't see any changes in your developer workflow. Rely on git status to see if there are any unstaged submodule changes, especially if you rely on git add [*|.|-A|-u]. If you rely on git commit -a, check the "Changes to be committed" section that shows up in the edit commit message.
If you accidentally stage or commit a git submodule, read our git submodule documentation which will guide you how to undo it.
What if I accidentally staged git submodule (not yet committed)?
If you accidentally stage a git submodule, you can unstage it by running git restore --staged <path to submodule>.
What if I accidentally committed a git submodule?
We will need to create either a commit that sets it back to old value, or amend the commit that added it. You can try to run gclient sync to bring the commit back to what is expected. If that doesn't work, you can use gclient setdep -r <path>@{old hash}, run gclient gitmodules to sync all submodules commits back to what is in DEPS, or check detailed instructions in Managing dependencies.
How do I update Chromium dependencies?
If you have a Skia autoroller set, we got you covered - no action is needed. For manual rolls, please follow our official documentation for managing dependencies.
Note that we continue to store git dependencies in DEPS files, and we expect it to be in sync with git submodules until we can safely remove the git DEPS entries. This will be enforced with presubmit checks.
When will this change take effect?
We will be adding git submodules to chromium/src within a week. For all projects that currently use git submodules, this change takes effect immediately.
Why are we doing this?
As outlined in this doc, we want to bring Chromium development workflow closer to conventional git use and this means using git submodules.
Can I opt out?
Unfortunately, you cannot opt-out. Submodules will be part of the chromium/src repo.
If you wish, you can instruct git to assume individual git submodules are unchanged by running: git update-index --assume-unchanged <path to submodule>. To undo, run git update-index --no-assume-unchanged <path to submodule>.
How can I provide feedback?
Please file bugs for any issues you find. These are big changes and we encourage you to reach out when you encounter any problems or confusion. Even if you assume some new behavior is expected / associated with git submodules it is still good to reach out so we and the git team can be aware of workflows that may be improved.
Useful links
--
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOijJGEjZJYGfaOm3h-%2BvyJVM4e5RxC5DT8mmk-YkCT3mnA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CACWgwAZxJEgpH_4%3DsBO_QxC%2B2RL22qFw9_OJZYbRQyB2W-rpaw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOiinmYu3iocqM_ymyp8SZgYmM%2By%3Dk3ebTAcQVUZ-2SxXJA%40mail.gmail.com.
I am seeing the same.essentially, after invoking `gclient sync` and `git status` i see:
modified: chrome/chrome_cleaner/internal (new commits)
modified: chrome/installer/mac/third_party/xz/xz (new commits)
modified: components/omnibox/browser/autocomplete_grouper_sections.cc
... some 30 more ...
modified: third_party/material_design_icons/src (new commits)
modified: third_party/nacl_sdk_binaries (new commits)`git reset --hard` won't revert this, `git commit -A` will put this in a commit, and my tree comes up dirty.is there a way we can reset all these submodules to "clean" state?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAYr5oMA07uduqoze04PEeX8qen%3D3Zt-U0-zsaWSHyh2fmqtsg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CA%2B1sxgZHdf_wDBPA-JW-j_1tFMBjOxa0f1x8RBuHgGhKiDt5mw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/bf34d83c-4efa-4b76-94a2-a596d81ad49cn%40chromium.org.
+1 for the dirty submodule issue. To add more details, here is what "git status" shows for chromium/src when I have a branch in the submodule "third_party/catapult":$ git status
HEAD detached at 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: third_party/catapult (new commits)
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAYr5oMRmjUxM1pESckOdxEXm%2BKH320bp5LH_CZJ6yMENGy_Vg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAOMQ%2Bw9ONKT-47tss9s4iA0BVHFBpQS556fVNHtqBGUM6pXJYA%40mail.gmail.com.
It feels like it should be easier to revert accidental changes in submodules, whether staged or already committed. I think this is a common mistake; I'm not sure if this is true of other people, but I previously had the habit of using `git commit -a` a lot, because it was simple and easy.
For testing purposes, I intentionally committed a change including a submodule diff:```
$ git diff HEAD^..HEAD
diff --git a/third_party/swiftshader b/third_party/swiftshader
index 97bdc453fbede..87018302eca37 160000
--- a/third_party/swiftshader
+++ b/third_party/swiftshader
@@ -1 +1 @@
-Subproject commit 97bdc453fbedee92ed0fc7687544098efc821622
+Subproject commit 87018302eca37f1e4775af2f2c248359db6622b7
```
If I want to revert this later, per "What if I accidentally committed a git submodule?", it seems like this ought to work:```
gclient setdep -r third_party/swiftshader@97bdc453fbedee92ed0fc7687544098efc821622
gclient gitmodules
```But this doesn't work: `gclient setup` gives the error message "KeyError: 'Could not find any dependency called third_party/swiftshader.'".
What *does* seem to work is:
```
cd third_party/swiftshader
git reset --hard 97bdc453fbedee92ed0fc7687544098efc821622
cd ../..
git add third_party/swiftshader
git commit --amend
```But this doesn't seem to be mentioned anywhere.
One other surprising thing. I currently have 30d5b1ee39d0143e20ca71ac9d0cf77f9816e149 checked out. This is a random commit from yesterday, with no local changes. However, if I run `gclient gitmodules`, it is *not* a no-op. After running it, `git diff` shows this:
```diff --git a/components/test/data/autofill/heuristics-json/internal b/components/test/data/autofill/heuristics-json/internal
deleted file mode 160000
index fc9323141d970..0000000000000
--- a/components/test/data/autofill/heuristics-json/internal
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit fc9323141d970c474cb466c32c9be6cfcf20e549
```
Which makes no sense to me either. Maybe I don't understand what `gclient gitmodules` is supposed to do, but I would have expected it to be a no-op if I'm running it against a commit from chromium/src/main.
DanielOn Thu, 24 Aug 2023 at 16:25, Chris Harrelson <chri...@chromium.org> wrote:Data point: multiple people from my team have had their checkouts hosed/broken by this update.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOij18qEvYjE9YqZpQ%2BTqnKSQ7vhQX6eiBy3w8qAWgEP3_g%40mail.gmail.com.
--
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOii%3DK12mgodxO9%2BkqbDuOCxEa%2BeX%2Bd5pSC0A4%2BzwuKT%2B0w%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAJiyOij0Sx9_2v%2BVyi3fkYakrD-8o-%2BJaK3r6AdhEvJL4k7HsQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAJiyOijhvLWjyzxx477y641f_mD4ntfqzwZB7k_rKdF1gA3CaA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEoffTA-Nqq1ku-FB_9R0dEbWp1gy%2BO8CAYMD1EwdnTy57SfcQ%40mail.gmail.com.
'src/clank': 'https://chrome-internal.googlesource.com/clank/internal/apps.git@unmanaged',
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEV-rjcnSG4hFPN8-0oA9maejhM2aOxfGkoe6VrD5akZTh9nTQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOigGJ8Uj%2BUt4JgHQrCEefE-EzHvNEgEFmF11QYgkDTVSkw%40mail.gmail.com.
The fsmonitor bug is a pretty severe performance hit for those impacted, and a fix doesn't appear imminent. Is there a possibility that we can rollback submodules support until that issue is fixed?
* fsmonitor, still being investigated (git mailing list thread: https://lore.kernel.org/git/20230829005606.136615-1-jonat...@google.com/). Tracking in: https://crbug.com/1475405
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOii%3DK12mgodxO9%2BkqbDuOCxEa%2BeX%2Bd5pSC0A4%2BzwuKT%2B0w%40mail.gmail.com.
----Josip Sokcevic
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAJiyOij0Sx9_2v%2BVyi3fkYakrD-8o-%2BJaK3r6AdhEvJL4k7HsQ%40mail.gmail.com.
--Bruce Dawson, he/him
----Josip Sokcevic
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAJiyOijhvLWjyzxx477y641f_mD4ntfqzwZB7k_rKdF1gA3CaA%40mail.gmail.com.
--
--
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+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEoffTA-Nqq1ku-FB_9R0dEbWp1gy%2BO8CAYMD1EwdnTy57SfcQ%40mail.gmail.com.
--
--
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+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEV-rjcnSG4hFPN8-0oA9maejhM2aOxfGkoe6VrD5akZTh9nTQ%40mail.gmail.com.
----Josip Sokcevic
--
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+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/0a38d673-2742-4307-9f45-51e69433e374n%40chromium.org.
Re: skipping submodules in "git commit -a", "git status", etc.> I'm exploring ways we can automate this in gclient. I think two competing ideas are a global switch via .gclient property or gclient command, and another one is to ignore all custom_deps. Given we don't have any telemetry, I think I'll share an anonymous survey so we can decide by a popular vote.Should we consider doing this for *all* submodules? That would match the legacy gclient DEPS behavior of not showing submodules/DEPS in various git operations, right?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOihEKkuy0gdR7X8MZcb%3D-HAe5%3DZr3ev5AC6tT62nVxAwhg%40mail.gmail.com.
The doc here suggests adding a hook to run `gclient sync` on every checkout. This means switching branches switched from instant to ~60 seconds. Anything that makes me to run `gcient sync` more often than I currently have to is going to be a bad time. Currently I run it once, after I pull from origin/main and that's all,F
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAozHLmMpsNKDgoW_HB-oaAMTV558LKn3goQZzcK6oaRJn5pow%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGE5NHupPp-2Cr%2BUiq5DrGZGmjQMkVC%2B7CKv-q7kcQJB%2BzOoA%40mail.gmail.com.
If you change branches but DEPS is the same version, you still don't need to gclient sync; nothing has changed from before the submodules switch.However, in the past, you might have been able to get away with skipping `gclient sync` more, since `git commit -a` now picks up changes in submodules.
If you change branches but DEPS is the same version, you still don't need to gclient sync; nothing has changed from before the submodules switch.However, in the past, you might have been able to get away with skipping `gclient sync` more, since `git commit -a` now picks up changes in submodules.
On Wed, 6 Sept 2023 at 02:27, Daniel Cheng <dch...@chromium.org> wrote:If you change branches but DEPS is the same version, you still don't need to gclient sync; nothing has changed from before the submodules switch.However, in the past, you might have been able to get away with skipping `gclient sync` more, since `git commit -a` now picks up changes in submodules.The presence of "diffs" breaks some tools. E.g. `git rebase-update` which does a pull and tries to rebase all your branches gets upset by these diffs. So in terms of what files are checked out, nothing has changed. In terms of workflows involving git, things are broken.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAozHLm%3DngkF-JAasafrPWC2rtLFa3xGEF%2BbCN1_qRqaMDqMPA%40mail.gmail.com.
I assume there are some typos below? `gclient` instead of `g4 client` and such? :)Josip can say whether he'd expect rebase-update to be broken or not, but note that rebase-update is a script in depot_tools, not a built-in git command. So it may need to be updated for submodules.-- DirkOn Thu, Sep 7, 2023 at 4:10 PM Fergal Daly <fer...@google.com> wrote:On Wed, 6 Sept 2023 at 02:27, Daniel Cheng <dch...@chromium.org> wrote:If you change branches but DEPS is the same version, you still don't need to gclient sync; nothing has changed from before the submodules switch.However, in the past, you might have been able to get away with skipping `gclient sync` more, since `git commit -a` now picks up changes in submodules.The presence of "diffs" breaks some tools. E.g. `git rebase-update` which does a pull and tries to rebase all your branches gets upset by these diffs. So in terms of what files are checked out, nothing has changed. In terms of workflows involving git, things are broken.Yesterday I got into a situation where even running `g4 client sync --force` was not fixing things. I ended up deleting `.git/index` and doing a reset. I don't recall doing anything unusual or interesting to get into that situation.Is there a git command to quickly set all the submodles to their expected state (without the rest of g4 client sync?). I've seengit submodule update -fbut when I run that I get a flood of errors (about missing credentials for internal repos),
Oh, I missed a question, answer below ...On Thu, Sep 7, 2023 at 6:28 PM Dirk Pranke <dpr...@google.com> wrote:I assume there are some typos below? `gclient` instead of `g4 client` and such? :)Josip can say whether he'd expect rebase-update to be broken or not, but note that rebase-update is a script in depot_tools, not a built-in git command. So it may need to be updated for submodules.-- DirkOn Thu, Sep 7, 2023 at 4:10 PM Fergal Daly <fer...@google.com> wrote:On Wed, 6 Sept 2023 at 02:27, Daniel Cheng <dch...@chromium.org> wrote:If you change branches but DEPS is the same version, you still don't need to gclient sync; nothing has changed from before the submodules switch.However, in the past, you might have been able to get away with skipping `gclient sync` more, since `git commit -a` now picks up changes in submodules.The presence of "diffs" breaks some tools. E.g. `git rebase-update` which does a pull and tries to rebase all your branches gets upset by these diffs. So in terms of what files are checked out, nothing has changed. In terms of workflows involving git, things are broken.Yesterday I got into a situation where even running `g4 client sync --force` was not fixing things. I ended up deleting `.git/index` and doing a reset. I don't recall doing anything unusual or interesting to get into that situation.Is there a git command to quickly set all the submodles to their expected state (without the rest of g4 client sync?). I've seengit submodule update -fbut when I run that I get a flood of errors (about missing credentials for internal repos),I have no idea what `git submodule update -f` does :). Running submodule commands directly is black magic to me :).
Did you try the things suggested in the page Josip linked to? Just to be clear, in general, `gclient sync` is the normal way to make sure your submodules are in the right state, and you shouldn't need to be running `submodule` commands directly.
On Fri, 8 Sept 2023 at 10:41, Dirk Pranke <dpr...@google.com> wrote:Oh, I missed a question, answer below ...On Thu, Sep 7, 2023 at 6:28 PM Dirk Pranke <dpr...@google.com> wrote:I assume there are some typos below? `gclient` instead of `g4 client` and such? :)Josip can say whether he'd expect rebase-update to be broken or not, but note that rebase-update is a script in depot_tools, not a built-in git command. So it may need to be updated for submodules.-- DirkOn Thu, Sep 7, 2023 at 4:10 PM Fergal Daly <fer...@google.com> wrote:On Wed, 6 Sept 2023 at 02:27, Daniel Cheng <dch...@chromium.org> wrote:If you change branches but DEPS is the same version, you still don't need to gclient sync; nothing has changed from before the submodules switch.However, in the past, you might have been able to get away with skipping `gclient sync` more, since `git commit -a` now picks up changes in submodules.The presence of "diffs" breaks some tools. E.g. `git rebase-update` which does a pull and tries to rebase all your branches gets upset by these diffs. So in terms of what files are checked out, nothing has changed. In terms of workflows involving git, things are broken.Yesterday I got into a situation where even running `g4 client sync --force` was not fixing things. I ended up deleting `.git/index` and doing a reset. I don't recall doing anything unusual or interesting to get into that situation.Is there a git command to quickly set all the submodles to their expected state (without the rest of g4 client sync?). I've seengit submodule update -fbut when I run that I get a flood of errors (about missing credentials for internal repos),I have no idea what `git submodule update -f` does :). Running submodule commands directly is black magic to me :).It was suggested earlier in the thread. I also don't know.
Did you try the things suggested in the page Josip linked to? Just to be clear, in general, `gclient sync` is the normal way to make sure your submodules are in the right state, and you shouldn't need to be running `submodule` commands directly.I'm not sure what on that page I should have done. I don't do any work in submodules and I was just trying to get my client to have no diffs vs origin/main. I expected `gclient sync --force` to get me into a good state but it didn't. If I get into this state again, I will try to preserve things,F
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAozHLkW8MevAH%3DMnEzgMNeXUack3KYPREr9b6_U2mH4RGLoxA%40mail.gmail.com.
Hi everyone,As of 15 minute ago, chromium/src contains git submodules. The change is available on the main branch: https://crrev.com/ef72622958e9358800d88739155030deaab314f3. The first release branch that will contain git submodules will be M118.As requested in the original email, please do provide feedback by filing bugs under the Infra>SDK component.
--Josip Sokcevic
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOijJGEjZJYGfaOm3h-%2BvyJVM4e5RxC5DT8mmk-YkCT3mnA%40mail.gmail.com.
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAJiyOii%3DK12mgodxO9%2BkqbDuOCxEa%2BeX%2Bd5pSC0A4%2BzwuKT%2B0w%40mail.gmail.com.
How do I modify roll CLs before they land now? As far as I can tell, https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/dependencies.md doesn't answer this.I want to patch in https://chromium-review.googlesource.com/c/chromium/src/+/4860859/3 , modify it, and then upload the changes. What I did:1. git cl patch -b mybranch https://chromium-review.googlesource.com/c/chromium/src/+/48608592. `gclient sync`3. Make changes4. Commit changes5. `git cl upload`In 2, gclient updated the local dep based on the change in the DEPS file I patched in. In step 4, I originally didn't add the change to the gitlink, but then 5 gave me** Presubmit ERRORS: 1 **
DEPS file indicates git submodule migration is in progress,
but the commit objects do not match DEPS entries.dependencies.md "Manual roll / low level roll" kind of suggests that it's desired to commit the gitlink change. So I added that too and uploaded it (https://chromium-review.googlesource.com/c/chromium/src/+/4860859/5) and things seem to work (from a submodules PoV at least), but now the change has a gitlink change in it, while it didn't have that when I originally patched in the unmodified roll.
Is it expected that there's no change to gitlink in the autorolled CL, but that one appears when I patch in, edit, and re-upload?