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

Rename Command to SingleCommand in proto. #1385

Conversation

Yury-Fridlyand
Copy link
Collaborator

Issue #, if available:
N/A

Description of changes:
Without that rename we can't add command command to proto. Surprise!

Unfortunately, linters cause much more changes rather than simple rename.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

* Rename `Command` to `SingleCommand` in proto.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Add missing renames.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Yury-Fridlyand
Copy link
Collaborator Author

@barshaul, Should I add this to change log? It brings no changes for the user.

@barshaul
Copy link
Collaborator

barshaul commented May 7, 2024

Instead of this massive change, rename command to Cmd in protobuf. It's only used internally either way, and you can add a comment // commend .

@Yury-Fridlyand
Copy link
Collaborator Author

Amount of changes will be the same, unfortunately. Protobuf complains vs having the same name in a enum and in a class.

protobuf/redis_request.proto:178:5: "Command" is already defined in "redis_request".
protobuf/redis_request.proto:178:5: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "Command" must be unique within "redis_request", not just within "RequestType".

@barshaul
Copy link
Collaborator

barshaul commented May 8, 2024

Amount of changes will be the same, unfortunately. Protobuf complains vs having the same name in a enum and in a class.

protobuf/redis_request.proto:178:5: "Command" is already defined in "redis_request".
protobuf/redis_request.proto:178:5: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "Command" must be unique within "redis_request", not just within "RequestType".

as I said - rename the COMMAND command name to Cmd in protobuf, don't call it Command.

enum RequestType {
    ...
    CMD = 137; // COMMAND
}

@barshaul barshaul closed this May 8, 2024
@Yury-Fridlyand Yury-Fridlyand deleted the core/integ_yuryf_rename_in_proto_2 branch May 8, 2024 14:57
@Yury-Fridlyand
Copy link
Collaborator Author

Got it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protobuf Protobuf, proto and protoc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants