Skip to content

Conversation

@juliawu
Copy link
Contributor

@juliawu juliawu commented Feb 3, 2026

Tweaks the logic in our convenience scripts to find the names of git remotes more intelligently. More specifically:

update_prod_tag.sh

It's possible that there are multiple remotes that match datacommonsorg. For example, if folks follow the instructions in the README when setting up their forks to add dc as a remote manually, they will have both remotes dc and upstream for the datacommonsorg/website repo.

This PR adds head -n 1 to the script so that only one is selected. Otherwise, the script fails when trying to access dc upstream, which doesn't exist.

update_git_submodules.sh

Similarly, this script previously assumed the caller's remote fork was named origin. The name of the remote fork is now dynamically fetched by the script.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @juliawu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness and flexibility of two key shell scripts, update_prod_tag.sh and update_git_submodules.sh. The changes ensure these scripts can more intelligently identify and utilize git remotes, accommodating various user configurations and preventing potential failures when multiple remotes are present or when the default remote name differs from expectations.

Highlights

  • update_prod_tag.sh script improvement: Modified the script to correctly handle scenarios where multiple git remotes match "datacommonsorg" by selecting only the first one, preventing script failure.
  • update_git_submodules.sh script enhancement: Updated the script to dynamically detect the name of the user's forked remote repository, moving away from the previous assumption that it would always be named "origin".
Changelog
  • scripts/update_git_submodules.sh
    • Implemented dynamic detection of the fork remote name, prioritizing non-datacommonsorg remotes and falling back to 'origin' if no specific fork remote is found.
    • Replaced the hardcoded origin in git submodule foreach git pull origin master with the dynamically detected fork_remote_name.
    • Added an echo statement to output the detected fork remote name for clarity.
  • scripts/update_prod_tag.sh
    • Modified the upstream_remote detection logic to include head -n 1, ensuring that only a single remote is selected when multiple remotes contain "datacommonsorg" in their URL.
Activity
  • No human activity (comments, reviews, or progress updates) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@juliawu juliawu changed the title Update github scripts to find remo Update how git scripts find remotes Feb 3, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the logic for finding git remotes in two scripts, making them more robust by handling cases where multiple remotes might match the search criteria. The changes are logical and well-commented. I've provided a few suggestions to further improve the consistency and simplify the command pipelines.

juliawu and others added 2 commits February 2, 2026 16:37
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@juliawu juliawu requested review from a team and dwnoble and removed request for a team February 3, 2026 00:39
# Usage: ./scripts/update_git_submodules.sh from root directory

git submodule foreach git pull origin master
# Detect the name of your forked repo (i.e. not the main repo 'datacommonsorg')
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want this to run on the main datacommonsorg repo? For me, origin points to [email protected]:datacommonsorg/website.git and the script appears to be running properly

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