My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 1716: Can't view raw code from the diff view
2 people starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Dec 2012


Sign in to add a comment
 
Reported by kald...@gmail.com, Dec 11, 2012
Instead of having zip download links from the diff view, why not have 'view raw' links that just load the text file in the browser? Usually, I just want to copy a few lines of code from the diff and currently I have to:
1. Click download
2. Choose whether I want to save it or open it with a de-archiving utility
3. Find where it was saved/expanded to
4. Open the file in a text editor
5. Copy the code

It's usually faster for me to actually copy the code from the diff view with all the line numbers and just remove the line numbers by hand.

I've talked to at least 3 other developers who have the exact same complaint.

If you believe the download link is useful, perhaps both links could be provided. Personally though, I have no use for the download link (that's what git is for).
Dec 11, 2012
Project Member #1 edwin.ke...@gmail.com
It's a security feature that on download the content is zipped, see [1].

Gerrit administrators may configure safe mimetypes [2] to avoid zipping, e.g. a Gerrit admin could add the following to the gerrit.config file to make the download link show the raw content for .java files:
[mimetype "text/x-java-source"]
  safe = true

If you are using Firefox it's also a nice trick to keep the Ctrl key pressed while selecting text from the Side-By-Side diff as this enables column selection and you can copy lines without line numbers.

[1] https://groups.google.com/d/topic/repo-discuss/h7Bvgns5cyY/discussion
[2] https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#_a_id_mimetype_a_section_mimetype
Status: Invalid
Dec 12, 2012
#2 kald...@gmail.com
I suggested this mimetype change to my gerrit admin, but he said that marking the mimetype as safe would not fix the problem:

"That doesn't quite work the way you're thinking--it's for us to define mimetypes that Gerrit should show diffs of (rather than a zip download of the file). All text-based filetypes are already shown by the browser as diffs, but most binary filetypes aren't shown on diff."

So who is correct in this case?
Sign in to add a comment

Powered by Google Project Hosting