Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(143)

Issue 8633043: code review 8633043: cmd/go: quote empty command line arguments in debug output (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by volker.dobler
Modified:
11 years, 11 months ago
Reviewers:
CC:
golang-dev, bradfitz, minux1, r
Visibility:
Public.

Description

cmd/go: quote command line arguments in debug output Debug output from go test -x may contain empty arguments. This CL quotes arguments if needed. E.g. the output of go test -x is now .../6g -o ./_go_.6 -p testmain -complete -D "" -I . -I $WORK ./_testmain.go which is easier to grasp.

Patch Set 1 #

Patch Set 2 : diff -r b27b1ff18f39 https://code.google.com/p/go/ #

Patch Set 3 : diff -r b27b1ff18f39 https://code.google.com/p/go/ #

Patch Set 4 : diff -r b27b1ff18f39 https://code.google.com/p/go/ #

Total comments: 1

Patch Set 5 : diff -r b3017cc3e17b https://code.google.com/p/go/ #

Patch Set 6 : diff -r b3017cc3e17b https://code.google.com/p/go/ #

Total comments: 1

Patch Set 7 : diff -r 9bb42a7021c9 https://code.google.com/p/go/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -1 line) Patch
M src/cmd/go/build.go View 1 2 3 4 5 6 2 chunks +19 lines, -1 line 1 comment Download

Messages

Total messages: 18
volker.dobler
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
11 years, 11 months ago (2013-04-10 18:12:32 UTC) #1
bradfitz
I don't think quotedJoin here needs to be as performance-sensitive as strings.Join. I'd just make ...
11 years, 11 months ago (2013-04-10 18:28:41 UTC) #2
volker.dobler
PTAL. I admit it is not a solution to copy/paste in the shell, but I ...
11 years, 11 months ago (2013-04-10 19:01:24 UTC) #3
minux1
LGTM. I vote for get this in.
11 years, 11 months ago (2013-04-10 20:21:28 UTC) #4
bradfitz
LGTM but waiting for r or adg before submitting. On Wed, Apr 10, 2013 at ...
11 years, 11 months ago (2013-04-10 20:26:29 UTC) #5
r
https://codereview.appspot.com/8633043/diff/9001/src/cmd/go/build.go File src/cmd/go/build.go (right): https://codereview.appspot.com/8633043/diff/9001/src/cmd/go/build.go#newcode1320 src/cmd/go/build.go:1320: } i see the point, but it's a little ...
11 years, 11 months ago (2013-04-10 20:38:13 UTC) #6
r
Notice my versions also protect spaces.
11 years, 11 months ago (2013-04-10 20:39:57 UTC) #7
bradfitz
I'd prefer to avoid quoting things which don't need quoting. On Apr 10, 2013 1:39 ...
11 years, 11 months ago (2013-04-11 04:23:44 UTC) #8
r
Fine, but the CL as it stands doesn't quote things that *do* need quoting, it ...
11 years, 11 months ago (2013-04-11 04:37:36 UTC) #9
bradfitz
I will propose an alternative when I find a computer. On Apr 10, 2013 9:37 ...
11 years, 11 months ago (2013-04-11 04:38:34 UTC) #10
bradfitz
func main() { println(quotedJoin([]string{"foo", "-D", "", "with space", "with\"quote", "bare"})) } func quotedJoin(a []string) string ...
11 years, 11 months ago (2013-04-11 06:19:04 UTC) #11
volker.dobler
PTAL adopted the suggestion of Brad.
11 years, 11 months ago (2013-04-11 07:38:07 UTC) #12
bradfitz
LGTM Leaving for r to approve for go1.1 before submitting. On Thu, Apr 11, 2013 ...
11 years, 11 months ago (2013-04-11 21:52:00 UTC) #13
r
https://codereview.appspot.com/8633043/diff/24001/src/cmd/go/build.go File src/cmd/go/build.go (right): https://codereview.appspot.com/8633043/diff/24001/src/cmd/go/build.go#newcode1308 src/cmd/go/build.go:1308: // if needed. this comment is grammatically wrong and ...
11 years, 11 months ago (2013-04-11 22:10:56 UTC) #14
volker.dobler
PTAL Sorry for the nonsensical doc. I do not think shell quoting should be mentioned ...
11 years, 11 months ago (2013-04-11 23:12:55 UTC) #15
r
sorry about the long long tale here, but if we're going to do this, let's ...
11 years, 11 months ago (2013-04-11 23:26:23 UTC) #16
r
LGTM This does only a small part of the problem but getting it right is ...
11 years, 11 months ago (2013-04-12 20:59:27 UTC) #17
r
11 years, 11 months ago (2013-04-12 21:05:30 UTC) #18
*** Submitted as https://code.google.com/p/go/source/detail?r=eed0c8bb671f ***

cmd/go: quote command line arguments in debug output

Debug output from go test -x may contain empty arguments.
This CL quotes arguments if needed. E.g. the output of
go test -x is now
  .../6g -o ./_go_.6 -p testmain -complete -D "" -I . -I $WORK ./_testmain.go
which is easier to grasp.

R=golang-dev, bradfitz, minux.ma, r
CC=golang-dev
https://codereview.appspot.com/8633043

Committer: Rob Pike <r@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b