Skip to content

Commit

Permalink
Merge pull request #2544 from aftix/jj_v0.22.0
Browse files Browse the repository at this point in the history
Jj v0.22.0
  • Loading branch information
rsteube authored Oct 10, 2024
2 parents c351fbb + abf03ef commit 593ec72
Show file tree
Hide file tree
Showing 40 changed files with 394 additions and 335 deletions.
1 change: 1 addition & 0 deletions completers/jj_completer/cmd/abandon.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func init() {
carapace.Gen(abandonCmd).Standalone()

abandonCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
abandonCmd.Flags().Bool("restore-descendants", false, "Preserve the content (not the diff) when rebasing descendants")
abandonCmd.Flags().BoolP("summary", "s", false, "Do not print every abandoned commit on a separate line")
rootCmd.AddCommand(abandonCmd)

Expand Down
20 changes: 20 additions & 0 deletions completers/jj_completer/cmd/bookmark.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var bookmarkCmd = &cobra.Command{
Use: "bookmark",
Short: "Manage bookmarks",
Aliases: []string{"branch"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmarkCmd).Standalone()

bookmarkCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
rootCmd.AddCommand(bookmarkCmd)
}
30 changes: 30 additions & 0 deletions completers/jj_completer/cmd/bookmark_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_createCmd = &cobra.Command{
Use: "create [OPTIONS] <NAMES>...",
Short: "Create a new bookmark",
Aliases: []string{"c"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_createCmd).Standalone()

bookmark_createCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmark_createCmd.Flags().StringP("revision", "r", "", "The bookmark's target revision")
bookmarkCmd.AddCommand(bookmark_createCmd)

carapace.Gen(bookmark_createCmd).FlagCompletion(carapace.ActionMap{
"revision": jj.ActionRevs(jj.RevOption{}.Default()),
})

carapace.Gen(bookmark_createCmd).PositionalAnyCompletion(
jj.ActionLocalBookmarks().FilterArgs(),
)
}
25 changes: 25 additions & 0 deletions completers/jj_completer/cmd/bookmark_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_deleteCmd = &cobra.Command{
Use: "delete [OPTIONS] [NAMES]...",
Short: "Delete an existing bookmark and propagate the deletion to remotes on the next push",
Aliases: []string{"d"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_deleteCmd).Standalone()

bookmark_deleteCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmarkCmd.AddCommand(bookmark_deleteCmd)

carapace.Gen(bookmark_deleteCmd).PositionalAnyCompletion(
jj.ActionLocalBookmarks().FilterArgs(),
)
}
25 changes: 25 additions & 0 deletions completers/jj_completer/cmd/bookmark_forget.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_forgetCmd = &cobra.Command{
Use: "forget [OPTIONS] [NAMES]...",
Short: "Forget everything about a bookmark, including its local and remote targets",
Aliases: []string{"f"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_forgetCmd).Standalone()

bookmark_forgetCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmarkCmd.AddCommand(bookmark_forgetCmd)

carapace.Gen(bookmark_forgetCmd).PositionalAnyCompletion(
jj.ActionLocalBookmarks().FilterArgs(),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import (
"github.com/spf13/cobra"
)

var branch_helpCmd = &cobra.Command{
var bookmark_helpCmd = &cobra.Command{
Use: "help",
Short: "Print this message or the help of the given subcommand(s)",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(branch_helpCmd).Standalone()
carapace.Gen(bookmark_helpCmd).Standalone()

branchCmd.AddCommand(branch_helpCmd)
bookmarkCmd.AddCommand(bookmark_helpCmd)

carapace.Gen(branch_helpCmd).PositionalAnyCompletion(
carapace.ActionCommands(branchCmd),
carapace.Gen(bookmark_helpCmd).PositionalAnyCompletion(
carapace.ActionCommands(bookmarkCmd),
)
}
36 changes: 36 additions & 0 deletions completers/jj_completer/cmd/bookmark_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_listCmd = &cobra.Command{
Use: "list [OPTIONS] [NAMES]...",
Short: "List bookmarks and their targets",
Aliases: []string{"l"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_listCmd).Standalone()

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")
bookmark_listCmd.Flags().BoolP("conflicted", "c", false, "Show only conflicted bookmarks")
bookmark_listCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmark_listCmd.Flags().StringSliceP("revisions", "r", []string{}, "Show bookmarks whose local targets are in the given revisions")
bookmark_listCmd.Flags().StringP("template", "T", "", "Render each bookmark using the given template")

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

bookmarkCmd.AddCommand(bookmark_listCmd)

carapace.Gen(bookmark_listCmd).FlagCompletion(carapace.ActionMap{
"revisions": jj.ActionRevSets(jj.RevOption{}.Default()).UniqueList(","),
})

carapace.Gen(bookmark_listCmd).PositionalAnyCompletion(
jj.ActionLocalBookmarks().FilterArgs(),
)
}
33 changes: 33 additions & 0 deletions completers/jj_completer/cmd/bookmark_move.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_moveCmd = &cobra.Command{
Use: "move [OPTIONS] <--from <REVISIONS>|NAME>",
Short: "Move existing bookmarks to target revision",
Aliases: []string{"s"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_moveCmd).Standalone()

bookmark_moveCmd.Flags().BoolP("allow-backwards", "B", false, "Allow moving the bookmark backwards or sideways")
bookmark_moveCmd.Flags().String("from", "@", "Move part of this change into the destination")
bookmark_moveCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmark_moveCmd.Flags().String("to", "@", "Move part of the source into this change")
bookmarkCmd.AddCommand(bookmark_moveCmd)

carapace.Gen(bookmark_moveCmd).FlagCompletion(carapace.ActionMap{
"from": jj.ActionRevs(jj.RevOption{}.Default()),
"to": jj.ActionRevs(jj.RevOption{}.Default()),
})

carapace.Gen(bookmark_moveCmd).PositionalAnyCompletion(
jj.ActionLocalBookmarks().FilterArgs(),
)
}
31 changes: 31 additions & 0 deletions completers/jj_completer/cmd/bookmark_set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_setCmd = &cobra.Command{
Use: "set [OPTIONS] <NAMES>...",
Short: "Update a given bookmark to point to a certain commit",
Aliases: []string{"s"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_setCmd).Standalone()

bookmark_setCmd.Flags().BoolP("allow-backwards", "B", false, "Allow moving the bookmark backwards or sideways")
bookmark_setCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmark_setCmd.Flags().StringP("revision", "r", "", "The bookmark's target revision")
bookmarkCmd.AddCommand(bookmark_setCmd)

carapace.Gen(bookmark_setCmd).FlagCompletion(carapace.ActionMap{
"revision": jj.ActionRevs(jj.RevOption{}.Default()),
})

carapace.Gen(bookmark_setCmd).PositionalAnyCompletion(
jj.ActionLocalBookmarks().FilterArgs(),
)
}
24 changes: 24 additions & 0 deletions completers/jj_completer/cmd/bookmark_track.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_trackCmd = &cobra.Command{
Use: "track [OPTIONS] <NAMES>...",
Short: "Start tracking given remote bookmarks",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_trackCmd).Standalone()

bookmark_trackCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmarkCmd.AddCommand(bookmark_trackCmd)

carapace.Gen(bookmark_trackCmd).PositionalAnyCompletion(
jj.ActionRemoteBookmarks("").FilterArgs(),
)
}
24 changes: 24 additions & 0 deletions completers/jj_completer/cmd/bookmark_untrack.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

var bookmark_untrackCmd = &cobra.Command{
Use: "untrack",
Short: "Stop tracking given remote bookmarks",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bookmark_untrackCmd).Standalone()

bookmark_untrackCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
bookmarkCmd.AddCommand(bookmark_untrackCmd)

carapace.Gen(bookmark_untrackCmd).PositionalAnyCompletion(
jj.ActionRemoteBookmarks("").FilterArgs(), // TODO tracked bookmarks
)
}
19 changes: 0 additions & 19 deletions completers/jj_completer/cmd/branch.go

This file was deleted.

30 changes: 0 additions & 30 deletions completers/jj_completer/cmd/branch_create.go

This file was deleted.

25 changes: 0 additions & 25 deletions completers/jj_completer/cmd/branch_delete.go

This file was deleted.

25 changes: 0 additions & 25 deletions completers/jj_completer/cmd/branch_forget.go

This file was deleted.

Loading

0 comments on commit 593ec72

Please sign in to comment.