Skip to content

Buf sync: support module identity overrides#2356

Merged
unmultimedio merged 12 commits intomainfrom
jfigueroa/sync-support-module-identity-overrides
Aug 9, 2023
Merged

Buf sync: support module identity overrides#2356
unmultimedio merged 12 commits intomainfrom
jfigueroa/sync-support-module-identity-overrides

Conversation

@unmultimedio
Copy link
Member

@unmultimedio unmultimedio commented Aug 9, 2023

Accept an optional module identity override for the module flag. This is useful when syncing a repository, to set a target module identity, regardless of what HEAD content has.

This will be useful for dog fooding the sync command on our own repos, or other community repositories with valid Buf modules, in case we don't want or can't write to the git history, but still want to sync all activity across all branches.

Before:

buf alpha repo sync \
  # This would read the module name in the HEAD commit,
  # and only sync commits back in time that matched that name.
  --module my/proto/dir

Now:

buf alpha repo sync \
  # This will read the module name in the HEAD commit,
  # and only sync commits back in time that matched that name.
  --module my/proto/dir
  # This will use "buf.build/acme/foo" as the module target
  # identity for all branches, regardless of the module name
  # they have in the git commits, or even if they are unnamed.
  --module other/proto/dir:buf.build/acme/foo

@unmultimedio unmultimedio requested review from bufdev and doriable August 9, 2023 01:01
@unmultimedio unmultimedio self-assigned this Aug 9, 2023
Copy link
Member

@doriable doriable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this back so fast! 🙏🏼

@unmultimedio unmultimedio merged commit af32dec into main Aug 9, 2023
@unmultimedio unmultimedio deleted the jfigueroa/sync-support-module-identity-overrides branch August 9, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants