Skip to content

config: Discover a shared .revupconfig for a repo-tool checkout#259

Open
matt-wagantall-skydio wants to merge 1 commit into
mainfrom
repo-tool-config
Open

config: Discover a shared .revupconfig for a repo-tool checkout#259
matt-wagantall-skydio wants to merge 1 commit into
mainfrom
repo-tool-config

Conversation

@matt-wagantall-skydio

Copy link
Copy Markdown

Read the current repo's .revupconfig as before, but when that repo is one
project of an Android "repo" checkout, fall back to a shared .revupconfig at
the root of the checkout (the directory containing .repo). This lets a group
of projects that all track the same branch share one config instead of
committing an identical one into each.

The checkout is detected from git's own metadata rather than by walking the
filesystem: a repo project's git directory lives under .repo, so we resolve
the git dir and look for a .repo path component. This avoids accidentally
picking up an unrelated project's config from a parent directory. A project's
own config still overrides the shared one.

Co-authored-by: Claude Opus 4.8 noreply@anthropic.com
Signed-off-by: Matt Wagantall matt.wagantall@skydio.com

Comment thread docs/config.md Outdated
Comment thread docs/config.md

If the current git repo is one project of an Android "repo" tool checkout,
revup also reads a shared ".revupconfig" from the root of that checkout (the
directory containing the .repo directory), so a single config can apply to

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would think we want to look inside the .repo directory? otherwise where would you commit the config to?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh actually .repo/manifests is the git project for the overall repo collection

@matt-wagantall-skydio matt-wagantall-skydio Jun 4, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not when we repo init with --local, as we do internally. It's just a plain directory created by repo init, not backed by a git project. My intention is to install the .revupconfig using a repo 'post-sync' hook, which can place it at the top of the tree.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm it would be more ideal to have this automatically work with any repo checkout and not require a separate step

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The post-sync hook setup step isn't required. The .revupconfig could be synced or symlinked to the root of the tree via the repo manifest itself if it was checked in.

In our case, however, I'm trying to avoid checking in a .revupconfig at all. The post-sync hook generates one at the end the end of a 'repo sync' based on the default branch in the manifest. That way we don't need to update the branch name twice (once in in the repo manifest and once in the .revupconfig) when it changes.

Comment thread revup/revup.py Outdated
Comment thread tests/test_config.py
Comment thread README.md
Comment thread docs/config.md Outdated
Comment thread revup/config.py Outdated
Comment thread revup/config.py Outdated
Comment thread revup/revup.py Outdated
Read the current repo's .revupconfig as before, but when that repo is one
project of a "repo" tool checkout, fall back to a shared .revupconfig at
the root of the checkout (the directory containing .repo). This lets a group
of projects that all track the same branch share one config instead of
committing an identical one into each.

The checkout is detected from git's own metadata rather than by walking the
filesystem: a repo project's git directory lives under .repo, so we resolve
the git dir and look for a .repo path component. This avoids accidentally
picking up an unrelated project's config from a parent directory. A project's
own config still overrides the shared one.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Matt Wagantall <matt.wagantall@skydio.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants