Skip to content

Rename --git-branch to --git-revision - #4048

Draft
gauron99 wants to merge 1 commit into
knative:mainfrom
gauron99:git-revision-flag
Draft

Rename --git-branch to --git-revision#4048
gauron99 wants to merge 1 commit into
knative:mainfrom
gauron99:git-revision-flag

Conversation

@gauron99

@gauron99 gauron99 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Changes

  • 🧹 func deploy --remote --git-url builds a repository at a branch, a tag or a commit, which git's fetch takes alike, so the flag naming it is now --git-revision (FUNC_GIT_REVISION), matching the build.git.revision key of func.yaml. func config git set follows for the name. The MCP deploy and config_git_set tools follow: gitBranch and git_branch become gitRevision and git_revision.
  • 🧹 config git set gets a TODO at the flag: its value is the branch whose pushes Pipelines-as-Code builds, a trigger filter matched against pushed refs, not a revision. It shares build.git.revision with deploy only because both persist to the same key; it should become a key of its own, and the PAC deploy step should stamp the revision it built from the push event.

Behaviour is otherwise unchanged.

/kind cleanup

Relates to #3203

Release Note

action required: the `--git-branch` flag of `func deploy` and `func config git set` is renamed `--git-revision` (`FUNC_GIT_REVISION`), and `git_branch`/`gitBranch` of the MCP tools become `git_revision`/`gitRevision`. For `func deploy` the value may be a branch, a tag or a commit.

Docs


@knative-prow

knative-prow Bot commented Sep 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added approved 🤖 PR has been approved by an approver from all required OWNERS files. size/L 🤖 PR changes 100-499 lines, ignoring generated files. labels Sep 8, 2026
@gauron99
gauron99 force-pushed the git-revision-flag branch 3 times, most recently from 4b99ccc to e09a50b Compare September 8, 2026 09:37
@gauron99 gauron99 changed the title feat: name the git revision to deploy with --git-revision Deprecate --git-branch in favour of --git-revision Sep 8, 2026
@gauron99
gauron99 marked this pull request as draft September 8, 2026 11:06
@knative-prow knative-prow Bot added the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label Sep 8, 2026
@gauron99 gauron99 changed the title Deprecate --git-branch in favour of --git-revision Deprecate deploy's --git-branch in favour of --git-revision Sep 8, 2026
A remote build from a repository can start from a branch, a tag or a
commit, which git's fetch takes alike, so deploy's flag for it is
--git-revision (FUNC_GIT_REVISION), matching the build.git.revision key
of func.yaml. config git set follows for the name, with a TODO: its
value is the branch Pipelines-as-Code reacts to, not a revision, and
should become a key of its own. The MCP tools follow: gitBranch and
git_branch are gitRevision and git_revision.
@gauron99 gauron99 changed the title Deprecate deploy's --git-branch in favour of --git-revision Rename --git-branch to --git-revision Sep 8, 2026
@gauron99

gauron99 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@lkingland lkingland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good!

I might consider going even more fundamental: --revision (and later --source)

After all, there's no gurantee git will be the defacto choice forever, and we could in theory back --source with something other than a VCS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants