Skip to content

doc(librarian): document current behavior when using local repo with push flag#2885

Merged
zhumin8 merged 3 commits intomainfrom
doc-bh
Nov 13, 2025
Merged

doc(librarian): document current behavior when using local repo with push flag#2885
zhumin8 merged 3 commits intomainfrom
doc-bh

Conversation

@zhumin8
Copy link
Copy Markdown
Contributor

@zhumin8 zhumin8 commented Nov 12, 2025

Documents current behavior that when using local repo, Librarian will branch-off the checked-out branch for commits, but will attempt to create PR against main branch if push flag is set.

Add clarification to branch flag description that it is ignored with local repo.

Fixes #2877

@zhumin8 zhumin8 requested a review from a team as a code owner November 12, 2025 20:00
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @zhumin8, 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 focuses on improving the clarity of Librarian's documentation regarding its interaction with local Git repositories. The updates provide essential information on how Librarian handles branching and pull request creation when the --push flag is used in a local repository context, addressing a potential area of confusion for users.

Highlights

  • Documentation Clarification: Added detailed notes to the Librarian documentation explaining its behavior when operating with local repositories, especially concerning branch creation and pull request generation.
  • Local Repository Workflow: The documentation now explicitly states that when using a local repository, Librarian will create a new branch from the currently checked-out branch for commits. If the --push flag is also specified, it will attempt to create a pull request against the main branch.
  • Flag Specifics: Updated the descriptions for the --repo flag and general help sections to include this crucial information, ensuring users understand the interaction between local repos and the push mechanism.
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.

Copy link
Copy Markdown
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 does a good job of documenting the behavior of Librarian when using a local repository with the --push flag. However, the explanatory note has been added in several places, leading to duplication in the generated documentation. To improve maintainability and keep the documentation DRY (Don't Repeat Yourself), it would be best to have this note in a single, logical location. The help text for the --repo flag in internal/librarian/flags.go is the ideal place, as you've already done. I've suggested removing the redundant additions from internal/librarian/help.go. After that, running go generate ./... will clean up the generated cmd/librarian/doc.go file.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.34%. Comparing base (028095d) to head (a070111).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2885      +/-   ##
==========================================
+ Coverage   83.13%   83.34%   +0.20%     
==========================================
  Files         131      132       +1     
  Lines       10853    11083     +230     
==========================================
+ Hits         9023     9237     +214     
- Misses       1421     1438      +17     
+ Partials      409      408       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhumin8 zhumin8 requested a review from ldetmer November 13, 2025 15:30
@zhumin8 zhumin8 merged commit b20d5aa into main Nov 13, 2025
10 checks passed
@zhumin8 zhumin8 deleted the doc-bh branch November 13, 2025 21:56
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.

librarian: document operating on a local clone of repo creates pr against main

2 participants