Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## [Unreleased]

- Fix `buf plugin push --label` to allow pushing a plugin with a label.
- Add `--digest-changes-only` flag to `buf registry {module,plugin} commit list` to filter
out commits that have no digest changes.

## [v1.48.0] - 2024-12-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import (
)

const (
pageSizeFlagName = "page-size"
pageTokenFlagName = "page-token"
reverseFlagName = "reverse"
formatFlagName = "format"
pageSizeFlagName = "page-size"
pageTokenFlagName = "page-token"
reverseFlagName = "reverse"
formatFlagName = "format"
digestChangesOnlyFlagName = "digest-changes-only"

defaultPageSize = 10
)
Expand Down Expand Up @@ -67,10 +68,11 @@ If no reference is specified, it lists all commits in this module.
}

type flags struct {
Format string
PageSize uint32
PageToken string
Reverse bool
Format string
PageSize uint32
PageToken string
Reverse bool
DigestChangesOnly bool
}

func newFlags() *flags {
Expand Down Expand Up @@ -99,6 +101,12 @@ func (f *flags) Bind(flagSet *pflag.FlagSet) {
bufprint.FormatText.String(),
fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),
)
flagSet.BoolVar(
&f.DigestChangesOnly,
digestChangesOnlyFlagName,
false,
`Only commits that have changed digests. By default, all commits are listed`,
)
}

func run(
Expand Down Expand Up @@ -229,7 +237,8 @@ func run(
},
},
},
Order: labelHistoryOrder,
Order: labelHistoryOrder,
OnlyCommitsWithChangedDigests: flags.DigestChangesOnly,
},
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import (
)

const (
pageSizeFlagName = "page-size"
pageTokenFlagName = "page-token"
reverseFlagName = "reverse"
formatFlagName = "format"
pageSizeFlagName = "page-size"
pageTokenFlagName = "page-token"
reverseFlagName = "reverse"
formatFlagName = "format"
digestChangesOnlyFlagName = "digest-changes-only"

defaultPageSize = 10
)
Expand Down Expand Up @@ -67,28 +68,32 @@ If no reference is specified, it lists all commits in this plugin.
}

type flags struct {
Format string
PageSize uint32
PageToken string
Reverse bool
Format string
PageSize uint32
PageToken string
Reverse bool
DigestChangesOnly bool
}

func newFlags() *flags {
return &flags{}
}

func (f *flags) Bind(flagSet *pflag.FlagSet) {
flagSet.Uint32Var(&f.PageSize,
flagSet.Uint32Var(
&f.PageSize,
pageSizeFlagName,
defaultPageSize,
`The page size`,
)
flagSet.StringVar(&f.PageToken,
flagSet.StringVar(
&f.PageToken,
pageTokenFlagName,
"",
`The page token. If more results are available, a "next_page" key is present in the --format=json output`,
)
flagSet.BoolVar(&f.Reverse,
flagSet.BoolVar(
&f.Reverse,
reverseFlagName,
false,
`Reverse the results. By default, they are ordered with the newest first`,
Expand All @@ -99,6 +104,12 @@ func (f *flags) Bind(flagSet *pflag.FlagSet) {
bufprint.FormatText.String(),
fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),
)
flagSet.BoolVar(
&f.DigestChangesOnly,
digestChangesOnlyFlagName,
false,
`Only commits that have changed digests. By default, all commits are listed`,
)
}

func run(
Expand Down Expand Up @@ -230,7 +241,8 @@ func run(
},
},
},
Order: labelHistoryOrder,
Order: labelHistoryOrder,
OnlyCommitsWithChangedDigests: flags.DigestChangesOnly,
},
),
)
Expand Down
Loading