Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buf sync: support module identity overrides #2356

Merged
merged 12 commits into from Aug 9, 2023

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 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
7 checks passed
@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.

None yet

2 participants