Skip to content

Commit

Permalink
Merge pull request #2584 from aftix/push-sxxkkryuxqsx
Browse files Browse the repository at this point in the history
jj_completer: Updated to jj v0.23.0
  • Loading branch information
rsteube authored Nov 8, 2024
2 parents 25119d7 + 17130bd commit 202a3ed
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 218 deletions.
22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/bookmark_help.go

This file was deleted.

2 changes: 2 additions & 0 deletions completers/jj_completer/cmd/bookmark_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func init() {
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().StringSlice("remote", []string{}, "Show all tracking and non-tracking remote bookmarks belonging to this remote")
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")

Expand All @@ -27,6 +28,7 @@ func init() {
bookmarkCmd.AddCommand(bookmark_listCmd)

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

Expand Down
22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/config_help.go

This file was deleted.

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

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

var config_unsetCmd = &cobra.Command{
Use: "unset [OPTIONS] <--user|--repo> <NAME>",
Short: "Update config file to unset the given option",
Aliases: []string{},
Run: func(cmd *cobra.Command, args []string) {},
}

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

config_unsetCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
config_unsetCmd.Flags().Bool("repo", false, "Target the repo-level config")
config_unsetCmd.Flags().Bool("user", false, "Target the user-level config")
configCmd.AddCommand(config_unsetCmd)

carapace.Gen(config_unsetCmd).PositionalCompletion(
jj.ActionConfigs(true).MultiParts("."),
)
}
2 changes: 2 additions & 0 deletions completers/jj_completer/cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ func init() {
diffCmd.Flags().String("from", "", "Show changes from this revision")
diffCmd.Flags().Bool("git", false, "Show a Git-format diff")
diffCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
diffCmd.Flags().BoolP("ignore-all-space", "w", false, "Ignore whitespace when comparing lines")
diffCmd.Flags().BoolP("ignore-space-change", "b", false, " Ignore changes in amount of whitespace when comparing lines")
diffCmd.Flags().Bool("name-only", false, "For each path, show only its path")
diffCmd.Flags().StringP("revision", "r", "", "Show changes in this revision, compared to its parent(s)")
diffCmd.Flags().Bool("stat", false, "Show a histogram of the changes")
Expand Down
29 changes: 29 additions & 0 deletions completers/jj_completer/cmd/file_annotate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cmd

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

var file_annotateCmd = &cobra.Command{
Use: "annotate [OPTIONS] <PATHS>...",
Short: "Show the source change for each line of the target file",
Run: func(cmd *cobra.Command, args []string) {},
}

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

file_annotateCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
file_annotateCmd.Flags().StringP("revision", "r", "@", "Revision to start at")
fileCmd.AddCommand(file_annotateCmd)

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

carapace.Gen(file_annotateCmd).PositionalAnyCompletion(
carapace.ActionFiles().FilterArgs(),
)
}
22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/file_help.go

This file was deleted.

1 change: 1 addition & 0 deletions completers/jj_completer/cmd/git_clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func init() {
carapace.Gen(git_cloneCmd).Standalone()

git_cloneCmd.Flags().Bool("colocate", false, "Whether or not to colocate the Jujutsu repo with the git repo")
git_cloneCmd.Flags().Int("depth", 0, "Create a shallow clone of the given depth")
git_cloneCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
git_cloneCmd.Flags().String("remote", "origin", "Name of the newly created remote")
gitCmd.AddCommand(git_cloneCmd)
Expand Down
22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/git_help.go

This file was deleted.

22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/git_remote_help.go

This file was deleted.

8 changes: 8 additions & 0 deletions completers/jj_completer/cmd/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ var helpCmd = &cobra.Command{
func init() {
carapace.Gen(helpCmd).Standalone()

helpCmd.Flags().Bool("help", false, "Print help (see more with '--help')")
helpCmd.Flags().StringArrayP("keyword", "k", []string{}, "Show help for keywords instead of commands")
rootCmd.AddCommand(helpCmd)

helpCmd.MarkFlagsMutuallyExclusive("help", "keyword")

carapace.Gen(helpCmd).FlagCompletion(carapace.ActionMap{
"keyword": carapace.ActionValues("revsets", "tutorial"),
})

carapace.Gen(helpCmd).PositionalAnyCompletion(
carapace.ActionCommands(rootCmd),
)
Expand Down
22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/operation_help.go

This file was deleted.

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

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

var simplifyParentsCmd = &cobra.Command{
Use: "simplify-parents <--source <SOURCE>|--revisions <REVISIONS>>",
Short: "Simplify parent edges for the specified revision(s)",
Run: func(cmd *cobra.Command, args []string) {},
}

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

simplifyParentsCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
simplifyParentsCmd.Flags().StringArrayP("revisions", "r", []string{}, "Simplify specified revision(s) (can be repeated)")
simplifyParentsCmd.Flags().StringArrayP("source", "s", []string{}, "Simplify specified revision(s) together with their trees of descendants (can be repeated)")
rootCmd.AddCommand(simplifyParentsCmd)

carapace.Gen(simplifyParentsCmd).FlagCompletion(carapace.ActionMap{
"revisions": jj.ActionRevs(jj.RevOption{}.Default()).FilterArgs(),
"source": jj.ActionRevs(jj.RevOption{}.Default()).FilterArgs(),
})
}
22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/sparse_help.go

This file was deleted.

4 changes: 2 additions & 2 deletions completers/jj_completer/cmd/squash.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ var squashCmd = &cobra.Command{
func init() {
carapace.Gen(squashCmd).Standalone()

squashCmd.Flags().String("from", "@", "Revision to squash from")
squashCmd.Flags().StringP("from", "f", "@", "Revision to squash from")
squashCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
squashCmd.Flags().BoolP("interactive", "i", false, "Interactively choose which parts to squash")
squashCmd.Flags().String("into", "@", "Revision to squash into")
squashCmd.Flags().StringP("into", "t", "@", "Revision to squash into")
squashCmd.Flags().BoolP("keep-emptied", "k", false, "The source revision will not be abandoned")
squashCmd.Flags().StringSliceP("message", "m", []string{}, "The description to use for squashed revision (don't open editor)")
squashCmd.Flags().StringP("revision", "r", "@", "Revision to squash into its parent")
Expand Down
18 changes: 0 additions & 18 deletions completers/jj_completer/cmd/tag_help.go

This file was deleted.

22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/util_help.go

This file was deleted.

22 changes: 0 additions & 22 deletions completers/jj_completer/cmd/workspace_help.go

This file was deleted.

2 changes: 2 additions & 0 deletions pkg/actions/tools/jj/rev.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,7 @@ func ActionRevSetFunctions() carapace.Action {
"committer_date", "Commits with committer dates matching the specified date pattern",
"tracked_remote_bookmarks", "All targets of tracked remote bookmarks",
"untracked_remote_bookmarks", "All targets of untracked remote bookmarks",
"coalesce", "Get first non-none revset from a list of revsets",
"at_operation", "Query revisions based on historical state",
).Tag("revset functions")
}

0 comments on commit 202a3ed

Please sign in to comment.