Documentation does not mention of "commit" flag for generate.
And comment for the flag only mentions release:
|
func addFlagCommit(fs *flag.FlagSet, cfg *config.Config) { |
|
fs.BoolVar(&cfg.Commit, "commit", false, |
|
`If true, librarian will create a commit for the release but not create |
|
a pull request. This flag is ignored if push is set to true.`) |
|
} |
Whereas
push description includes both commit and push:
|
func addFlagPush(fs *flag.FlagSet, cfg *config.Config) { |
|
fs.BoolVar(&cfg.Push, "push", false, |
|
fmt.Sprintf(`If true, Librarian will create a commit and a pull request for the changes. |
|
A GitHub token with push access must be provided via the |
|
%s environment variable.`, config.LibrarianGithubToken)) |
|
} |
But code honors a commit flag and will not commit if not provided.
|
commitInfo := &commitInfo{ |
|
branch: r.branch, |
|
commit: r.commit, |
|
commitMessage: "feat: generate libraries", |
|
failedLibraries: failedLibraries, |
|
ghClient: r.ghClient, |
|
idToCommits: idToCommits, |
|
prType: generate, |
|
push: r.push, |
|
repo: r.repo, |
|
sourceRepo: r.sourceRepo, |
|
state: r.state, |
|
workRoot: r.workRoot, |
|
failedGenerations: failedGenerations, |
|
} |
|
|
|
return commitAndPush(ctx, commitInfo) |
|
func commitAndPush(ctx context.Context, info *commitInfo) error { |
|
if !info.push && !info.commit { |
|
slog.Info("Push flag and Commit flag are not specified, skipping committing") |
Documentation does not mention of "commit" flag for generate.
And comment for the flag only mentions release:
librarian/internal/librarian/flags.go
Lines 42 to 46 in 31a496d
Whereas
pushdescription includes both commit and push:librarian/internal/librarian/flags.go
Lines 88 to 93 in 31a496d
But code honors a
commitflag and will not commit if not provided.librarian/internal/librarian/generate.go
Lines 144 to 160 in 31a496d
librarian/internal/librarian/command.go
Lines 332 to 334 in 31a496d