Skip to content

Commit

Permalink
Explain single branch adoption use case in av stack adopt help (#416)(#…
Browse files Browse the repository at this point in the history
…415)

Fixes #414



Use a checkmark instead of an x to indicate that a branch is selected
Fixes #413



Closes #415
  • Loading branch information
draftcode authored Sep 5, 2024
1 parent 71cd2fc commit 3754f82
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmd/av/stack_adopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ var stackAdoptFlags struct {
var stackAdoptCmd = &cobra.Command{
Use: "adopt",
Short: "Adopt branches that are not managed by av",
Args: cobra.NoArgs,
Long: `Adopt branches that are not managed by av.
This command will show a list of branches that are not managed by av. You can choose which branches
should be adopted to av.
If you want to adopt the current branch, you can use the --parent flag to specify the parent branch.
For example, "av stack adopt --parent main" will adopt the current branch with the main branch as
the parent.`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
repo, err := getRepo()
if err != nil {
Expand Down Expand Up @@ -419,7 +427,7 @@ func (vm stackAdoptViewModel) renderBranch(branch plumbing.ReferenceName, isTrun
if adopted && !vm.chosenTargets[branch] {
sb.WriteString(branch.Short())
} else if vm.chosenTargets[branch] {
sb.WriteString("[x] " + branch.Short())
sb.WriteString("[] " + branch.Short())
} else {
sb.WriteString("[ ] " + branch.Short())
}
Expand Down

0 comments on commit 3754f82

Please sign in to comment.