summaryrefslogtreecommitdiff
path: root/src/cmd/internal/diff
Commit message (Collapse)AuthorAgeFilesLines
* internal/diff: add, replacing cmd/internal/diffRuss Cox2022-03-181-78/+0
| | | | | | | | | | | | | | | | | | | | | | This is an in-process (non-exec'ing) replacement for cmd/internal/diff. It uses an O(n log n) algorithm instead of the O(n²) algorithm in standard diff binaries. It does not produce the absolute shortest diffs, but the results are often more meaningful than the standard diff, because it doesn't try to align random blank lines or other noise. Adding so that tests inside std (especially go/printer) can print diffs. Replacing cmd/internal/diff because we don't need two. Change-Id: I9155dd925e4a813f5bfa84a8ad3dec8ffdbf8550 Reviewed-on: https://go-review.googlesource.com/c/go/+/384255 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com> Trust: Peter Weinberger <pjw@google.com>
* cmd/internal/diff: skip over Cygwin warning in diff outputRuss Cox2021-02-191-0/+20
| | | | | | | | | This happens on Windows. Don't let it stop us. Change-Id: Ie2115d5825e1c2217f237ed373adb35594a5aaff Reviewed-on: https://go-review.googlesource.com/c/go/+/293850 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* all: introduce and use internal/execabsRoland Shoemaker2021-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Introduces a wrapper around os/exec, internal/execabs, for use in all commands. This wrapper prevents exec.LookPath and exec.Command from running executables in the current directory. All imports of os/exec in non-test files in cmd/ are replaced with imports of internal/execabs. This issue was reported by RyotaK. Fixes CVE-2021-3115 Fixes #43783 Change-Id: I0423451a6e27ec1e1d6f3fe929ab1ef69145c08f Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955304 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Katie Hockman <katiehockman@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/284783 Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Trust: Roland Shoemaker <roland@golang.org>
* cmd/fix, cmd/go, cmd/gofmt: refactor common code into new internal diff packageMikhail Fesenko2019-10-281-0/+58
Change-Id: Idac8473d1752059bf2f617fd7a781000ee2c3af4 GitHub-Last-Rev: 02a3aa1a3241d3ed4422518f1c954cd54bbe858e GitHub-Pull-Request: golang/go#35141 Reviewed-on: https://go-review.googlesource.com/c/go/+/203218 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>