Skip to content

Commit d5757db

Browse files
authored
Merge pull request #3060 from carapace-sh/jj-updates-v0.35.0
jj: updates from v0.35.0
2 parents 0cdc700 + 60b43cc commit d5757db

20 files changed

+168
-12
lines changed

completers/common/jj_completer/cmd/bisect_run.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ var bisect_runCmd = &cobra.Command{
1515

1616
func init() {
1717
carapace.Gen(bisect_runCmd).Standalone()
18+
bisect_runCmd.Flags().SetInterspersed(false)
1819

19-
bisect_runCmd.Flags().String("command", "", "Command to run to determine whether the bug is present")
2020
bisect_runCmd.Flags().Bool("find-good", false, "Whether to find the first good revision instead")
2121
bisect_runCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2222
bisect_runCmd.Flags().StringSliceP("range", "r", nil, "Range of revisions to bisect")
23-
bisect_runCmd.MarkFlagRequired("command")
2423
bisect_runCmd.MarkFlagRequired("range")
2524
bisectCmd.AddCommand(bisect_runCmd)
2625

2726
carapace.Gen(bisect_runCmd).FlagCompletion(carapace.ActionMap{
28-
"command": bridge.ActionCarapaceBin().Split(),
29-
"range": jj.ActionRevSets(jj.RevOption{}.Default()),
27+
"range": jj.ActionRevSets(jj.RevOption{}.Default()),
3028
})
29+
30+
carapace.Gen(bisect_runCmd).PositionalAnyCompletion(
31+
bridge.ActionCarapaceBin(),
32+
)
3133
}

completers/common/jj_completer/cmd/config_edit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ func init() {
1818
config_editCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
1919
config_editCmd.Flags().Bool("repo", false, "Target the repo-level config")
2020
config_editCmd.Flags().Bool("user", false, "Target the user-level config")
21+
config_editCmd.Flags().Bool("workspace", false, "Target the workspace-level config")
2122
configCmd.AddCommand(config_editCmd)
2223
}

completers/common/jj_completer/cmd/config_list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func init() {
2222
config_listCmd.Flags().Bool("repo", false, "Target the repo-level config")
2323
config_listCmd.Flags().StringP("template", "T", "", "Render each variable using the given template")
2424
config_listCmd.Flags().Bool("user", false, "Target the user-level config")
25+
config_listCmd.Flags().Bool("workspace", false, "Target the workspace-level config")
2526
configCmd.AddCommand(config_listCmd)
2627

2728
carapace.Gen(config_listCmd).PositionalCompletion(

completers/common/jj_completer/cmd/config_path.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ func init() {
1818
config_pathCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
1919
config_pathCmd.Flags().Bool("repo", false, "Target the repo-level config")
2020
config_pathCmd.Flags().Bool("user", false, "Target the user-level config")
21+
config_pathCmd.Flags().Bool("workspace", false, "Target the workspace-level config")
2122
configCmd.AddCommand(config_pathCmd)
2223
}

completers/common/jj_completer/cmd/config_set.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func init() {
1919
config_setCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2020
config_setCmd.Flags().Bool("repo", false, "Target the repo-level config")
2121
config_setCmd.Flags().Bool("user", false, "Target the user-level config")
22+
config_setCmd.Flags().Bool("workspace", false, "Target the workspace-level config")
2223
configCmd.AddCommand(config_setCmd)
2324

2425
carapace.Gen(config_setCmd).PositionalCompletion(

completers/common/jj_completer/cmd/config_unset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func init() {
1919
config_unsetCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2020
config_unsetCmd.Flags().Bool("repo", false, "Target the repo-level config")
2121
config_unsetCmd.Flags().Bool("user", false, "Target the user-level config")
22+
config_unsetCmd.Flags().Bool("workspace", false, "Target the workspace-level config")
2223
configCmd.AddCommand(config_unsetCmd)
2324

2425
carapace.Gen(config_unsetCmd).PositionalCompletion(

completers/common/jj_completer/cmd/evolog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func init() {
2525
evologCmd.Flags().Bool("ignore-space-change", false, "Ignore changes in amount of whitespace when comparing lines")
2626
evologCmd.Flags().StringP("limit", "n", "", "Limit number of revisions to show")
2727
evologCmd.Flags().Bool("name-only", false, "For each path, show only its path")
28-
evologCmd.Flags().Bool("no-graph", false, "Don't show the graph, show a flat list of revisions")
28+
evologCmd.Flags().BoolP("no-graph", "G", false, "Don't show the graph, show a flat list of revisions")
2929
evologCmd.Flags().BoolP("patch", "p", false, "Show patch compared to the previous version of this change")
3030
evologCmd.Flags().Bool("reversed", false, "Show revisions in the opposite order (older revisions first)")
3131
evologCmd.Flags().StringSlice("revision", nil, "Follow changes from these revisions")

completers/common/jj_completer/cmd/git_clone.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,30 @@ var git_cloneCmd = &cobra.Command{
1616
func init() {
1717
carapace.Gen(git_cloneCmd).Standalone()
1818

19-
git_cloneCmd.Flags().Bool("colocate", false, "Whether or not to colocate the Jujutsu repo with the git repo")
19+
git_cloneCmd.Flags().StringSlice("bookmark", nil, "Name of the branch to fetch and use as the parent of the working-copy change")
20+
git_cloneCmd.Flags().StringSliceP("branch", "b", nil, "Name of the branch to fetch and use as the parent of the working-copy change")
21+
git_cloneCmd.Flags().Bool("colocate", false, "Colocate the Jujutsu repo with the git repo")
2022
git_cloneCmd.Flags().String("depth", "", "Create a shallow clone of the given depth")
2123
git_cloneCmd.Flags().String("fetch-tags", "", "Configure when to fetch tags")
2224
git_cloneCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2325
git_cloneCmd.Flags().Bool("no-colocate", false, "Disable colocation of the Jujutsu repo with the git repo")
2426
git_cloneCmd.Flags().String("remote", "", "Name of the newly created remote")
27+
git_cloneCmd.Flag("bookmark").Hidden = true
2528
gitCmd.AddCommand(git_cloneCmd)
2629

2730
carapace.Gen(git_cloneCmd).FlagCompletion(carapace.ActionMap{
31+
"bookmark": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
32+
if len(c.Args) == 0 {
33+
return carapace.ActionValues()
34+
}
35+
return git.ActionLsRemoteRefs(git.LsRemoteRefOption{Url: c.Args[0], Branches: true})
36+
}),
37+
"branch": carapace.ActionCallback(func(c carapace.Context) carapace.Action {
38+
if len(c.Args) == 0 {
39+
return carapace.ActionValues()
40+
}
41+
return git.ActionLsRemoteRefs(git.LsRemoteRefOption{Url: c.Args[0], Branches: true})
42+
}),
2843
"fetch-tags": carapace.ActionValues("all", "included", "none").StyleF(style.ForKeyword),
2944
})
3045

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var git_colocationCmd = &cobra.Command{
9+
Use: "colocation",
10+
Short: "Manage Jujutsu repository colocation with Git",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(git_colocationCmd).Standalone()
16+
17+
git_colocationCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
18+
gitCmd.AddCommand(git_colocationCmd)
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var git_colocation_disableCmd = &cobra.Command{
9+
Use: "disable",
10+
Short: "Convert into a non-colocated Jujutsu/Git repository",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(git_colocation_disableCmd).Standalone()
16+
17+
git_colocation_disableCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
18+
git_colocationCmd.AddCommand(git_colocation_disableCmd)
19+
}

0 commit comments

Comments
 (0)