Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 513 by Leading comments droppped when using --descriptor_set_out

The protoc compiler will write a FileDescriptorProto protocol buffer describing its input files when given the --descriptor_set_out flag. If --include_source_info is also given, then comments (and other information) for each element will also be included.

However, any comments at the beginning of the file that are NOT attached to an element will be dropped. I am working on a documentation generator for Protocol Buffers, using the existing plugin infrastructure, and in many cases the leading comments in the file act as an introduction. Therefore, it's important to me that these comments show up in the FileDescriptorProto provided by the compiler.

To reproduce the issue, I'll use descriptor.proto. Running the following command puts 'descriptor.pb' in /tmp (assuming descriptor.proto is in the current directory):

protoc --include_source_info --descriptor_set_out=/tmp/descriptor.pb descriptor.proto

descriptor.proto begins with these lines (v2.5.0):

// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.

And that text is missing from descriptor.pb

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to