av icon indicating copy to clipboard operation
av copied to clipboard

Support additional trunk branches

Open draftcode opened this issue 1 year ago • 0 comments

Currently, we support only remote HEAD as trunk (This is what we call defaultBranch, which is refs/remotes/origin/HEAD. This is typically a symbolic link to refs/remotes/origin/master or main).

In addition to this, support other branches as trunk.


In our config (https://github.com/aviator-co/av/blob/ce51db8eed436bae722b63bd2616103c2a2f2c26/internal/config/config.go#L56), we can add AdditionalTrunkBranches []string. With this, users can add this config to .git/av/config.yaml

additionalTrunkBranches:
  - "dev"

With this config, when a user runs av stack branch new_feature dev, it should treat the dev branch as the trunk branch. We can check this by running av stack tree. It should show dev as the root of the tree.


There are two places that we detect whether a branch is a trunk branch.

  • https://github.com/aviator-co/av/blob/ce51db8eed436bae722b63bd2616103c2a2f2c26/cmd/av/stack_branch.go#L102
  • https://github.com/aviator-co/av/blob/ce51db8eed436bae722b63bd2616103c2a2f2c26/cmd/av/stack_sync.go#L161

These two should be modified to check the configs for the additional trunk branches.

draftcode avatar May 14 '24 23:05 draftcode