Skip to content

Commit 3c184b9

Browse files
committed
jj: updates from v0.34.0
1 parent 4c06a8a commit 3c184b9

25 files changed

+167
-47
lines changed

completers/common/jj_completer/cmd/absorb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func init() {
1818
absorbCmd.Flags().StringP("from", "f", "@", "Source revision to absorb from")
1919
absorbCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2020
absorbCmd.Flags().StringSliceP("into", "t", []string{"mutable()"}, "Destination revisions to absorb into")
21-
absorbCmd.Flags().StringSlice("to", []string{"mutable()"}, "Alias for --into")
21+
absorbCmd.Flags().StringSlice("to", []string{"mutable()"}, "Destination revisions to absorb into")
2222
rootCmd.AddCommand(absorbCmd)
2323

2424
absorbCmd.MarkFlagsMutuallyExclusive("into", "to")
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 bisectCmd = &cobra.Command{
9+
Use: "bisect",
10+
Short: "Find a bad revision by bisection",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(bisectCmd).Standalone()
16+
17+
bisectCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
18+
rootCmd.AddCommand(bisectCmd)
19+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
6+
"github.com/carapace-sh/carapace-bridge/pkg/actions/bridge"
7+
"github.com/spf13/cobra"
8+
)
9+
10+
var bisect_runCmd = &cobra.Command{
11+
Use: "run",
12+
Short: "Run a given command to find the first bad revision",
13+
Run: func(cmd *cobra.Command, args []string) {},
14+
}
15+
16+
func init() {
17+
carapace.Gen(bisect_runCmd).Standalone()
18+
19+
bisect_runCmd.Flags().String("command", "", "Command to run to determine whether the bug is present")
20+
bisect_runCmd.Flags().Bool("find-good", false, "Whether to find the first good revision instead")
21+
bisect_runCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
22+
bisect_runCmd.Flags().StringSliceP("range", "r", nil, "Range of revisions to bisect")
23+
bisect_runCmd.MarkFlagRequired("command")
24+
bisect_runCmd.MarkFlagRequired("range")
25+
bisectCmd.AddCommand(bisect_runCmd)
26+
27+
carapace.Gen(bisect_runCmd).FlagCompletion(carapace.ActionMap{
28+
"command": bridge.ActionCarapaceBin().Split(),
29+
"range": jj.ActionRevSets(jj.RevOption{}.Default()),
30+
})
31+
}

completers/common/jj_completer/cmd/bookmark.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import (
66
)
77

88
var bookmarkCmd = &cobra.Command{
9-
Use: "bookmark",
10-
Short: "Manage bookmarks",
11-
Aliases: []string{"branch", "b"},
12-
Run: func(cmd *cobra.Command, args []string) {},
9+
Use: "bookmark",
10+
Short: "Manage bookmarks [default alias: b]",
11+
Run: func(cmd *cobra.Command, args []string) {},
1312
}
1413

1514
func init() {

completers/common/jj_completer/cmd/bookmark_create.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ func init() {
1818

1919
bookmark_createCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2020
bookmark_createCmd.Flags().StringP("revision", "r", "", "The bookmark's target revision")
21+
bookmark_createCmd.Flags().String("to", "", "The bookmark's target revision")
2122
bookmarkCmd.AddCommand(bookmark_createCmd)
2223

2324
carapace.Gen(bookmark_createCmd).FlagCompletion(carapace.ActionMap{
2425
"revision": jj.ActionRevs(jj.RevOption{}.Default()),
26+
"to": jj.ActionRevs(jj.RevOption{}.Default()),
2527
})
2628

2729
carapace.Gen(bookmark_createCmd).PositionalAnyCompletion(

completers/common/jj_completer/cmd/bookmark_list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var bookmark_listCmd = &cobra.Command{
1616
func init() {
1717
carapace.Gen(bookmark_listCmd).Standalone()
1818

19+
bookmark_listCmd.Flags().Bool("all", false, "Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks")
1920
bookmark_listCmd.Flags().BoolP("all-remotes", "a", false, "Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks")
2021
bookmark_listCmd.Flags().BoolP("conflicted", "c", false, "Show conflicted bookmarks only")
2122
bookmark_listCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
@@ -24,6 +25,7 @@ func init() {
2425
bookmark_listCmd.Flags().StringSlice("sort", nil, "Sort bookmarks based on the given key (or multiple keys)")
2526
bookmark_listCmd.Flags().StringP("template", "T", "", "Render each bookmark using the given template")
2627
bookmark_listCmd.Flags().BoolP("tracked", "t", false, "Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default")
28+
bookmark_listCmd.Flag("all").Hidden = true
2729
bookmarkCmd.AddCommand(bookmark_listCmd)
2830

2931
bookmark_listCmd.MarkFlagsMutuallyExclusive("all-remotes", "conflicted")

completers/common/jj_completer/cmd/bookmark_set.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ func init() {
1919
bookmark_setCmd.Flags().BoolP("allow-backwards", "B", false, "Allow moving the bookmark backwards or sideways")
2020
bookmark_setCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2121
bookmark_setCmd.Flags().StringP("revision", "r", "", "The bookmark's target revision")
22+
bookmark_setCmd.Flags().String("to", "", "The bookmark's target revision")
2223
bookmarkCmd.AddCommand(bookmark_setCmd)
2324

2425
carapace.Gen(bookmark_setCmd).FlagCompletion(carapace.ActionMap{
2526
"revision": jj.ActionRevs(jj.RevOption{}.Default()),
27+
"to": jj.ActionRevs(jj.RevOption{}.Default()),
2628
})
2729

2830
carapace.Gen(bookmark_setCmd).PositionalAnyCompletion(

completers/common/jj_completer/cmd/commit.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,17 @@ import (
77
)
88

99
var commitCmd = &cobra.Command{
10-
Use: "commit [OPTIONS] [PATHS]...",
11-
Short: "Update the description and create a new change on top",
12-
Aliases: []string{"ci"},
13-
Run: func(cmd *cobra.Command, args []string) {},
10+
Use: "commit",
11+
Short: "Update the description and create a new change on top [default alias: ci]",
12+
Run: func(cmd *cobra.Command, args []string) {},
1413
}
1514

1615
func init() {
1716
carapace.Gen(commitCmd).Standalone()
1817

19-
commitCmd.Flags().String("author", "", "Set author to the provided string")
2018
commitCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2119
commitCmd.Flags().BoolP("interactive", "i", false, "Interactively choose which changes to include in the first commit")
2220
commitCmd.Flags().StringSliceP("message", "m", nil, "The change description to use (don't open editor)")
23-
commitCmd.Flags().Bool("reset-author", false, "Reset the author to the configured user")
2421
commitCmd.Flags().String("tool", "", "Specify diff editor to be used (implies --interactive)")
2522
rootCmd.AddCommand(commitCmd)
2623

completers/common/jj_completer/cmd/describe.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@ var describeCmd = &cobra.Command{
1616
func init() {
1717
carapace.Gen(describeCmd).Standalone()
1818

19-
describeCmd.Flags().String("author", "", "Set author to the provided string")
2019
describeCmd.Flags().Bool("edit", false, "Open an editor")
2120
describeCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
2221
describeCmd.Flags().StringSliceP("message", "m", nil, "The change description to use (don't open editor)")
23-
describeCmd.Flags().Bool("no-edit", false, "Don't open an editor")
24-
describeCmd.Flags().Bool("reset-author", false, "Reset the author name, email, and timestamp")
2522
describeCmd.Flags().Bool("stdin", false, "Read the change description from stdin")
26-
27-
describeCmd.MarkFlagsMutuallyExclusive("edit", "no-edit")
2823
rootCmd.AddCommand(describeCmd)
2924

3025
carapace.Gen(describeCmd).PositionalCompletion(

completers/common/jj_completer/cmd/diff.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ func init() {
2424
diffCmd.Flags().BoolP("ignore-all-space", "w", false, "Ignore whitespace when comparing lines")
2525
diffCmd.Flags().BoolP("ignore-space-change", "b", false, "Ignore changes in amount of whitespace when comparing lines")
2626
diffCmd.Flags().Bool("name-only", false, "For each path, show only its path")
27+
diffCmd.Flags().StringSlice("revision", nil, "Show changes in these revisions")
2728
diffCmd.Flags().StringSliceP("revisions", "r", nil, "Show changes in these revisions")
2829
diffCmd.Flags().Bool("stat", false, "Show a histogram of the changes")
2930
diffCmd.Flags().BoolP("summary", "s", false, "For each path, show only whether it was modified, added, or deleted")
3031
diffCmd.Flags().StringP("template", "T", "", "Render each file diff entry using the given template")
3132
diffCmd.Flags().StringP("to", "t", "", "Show changes to this revision")
3233
diffCmd.Flags().String("tool", "", "Generate diff by external command")
3334
diffCmd.Flags().Bool("types", false, "For each path, show only its type before and after")
35+
diffCmd.Flag("revision").Hidden = true
3436
rootCmd.AddCommand(diffCmd)
3537

3638
diffCmd.MarkFlagsMutuallyExclusive("name-only", "summary")
3739

3840
carapace.Gen(diffCmd).FlagCompletion(carapace.ActionMap{
3941
"from": jj.ActionRevs(jj.RevOption{}.Default()),
42+
"revision": jj.ActionRevs(jj.RevOption{}.Default()),
4043
"revisions": jj.ActionRevs(jj.RevOption{}.Default()),
4144
"to": jj.ActionRevs(jj.RevOption{}.Default()),
4245
"tool": bridge.ActionCarapaceBin().Split(),

0 commit comments

Comments
 (0)