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

Allow dot-prefixed packages as valid import paths #572

Merged
merged 5 commits into from May 16, 2017

Conversation

Projects
None yet
3 participants
@sectioneight
Copy link
Contributor

sectioneight commented May 12, 2017

Fixes #564

@googlebot googlebot added the cla: yes label May 12, 2017

//
// Note that there are some pathological edge cases this doesn't cover,
// such as a user using Git for version control, but having a package
// named "svn" in a directory named ".svn".

This comment has been minimized.

@sectioneight

sectioneight May 12, 2017

Contributor

Not sure if we want to try and address this -- should we only skip these dirs if we're at the root of the project? Will that cause problems for submodules?

This comment has been minimized.

@sdboyer

sdboyer May 13, 2017

Member

I think we're OK ignoring it for now, though I appreciate you pointing it out. It's a very, very edge case, and trying to deal with it here would do some level-busting: a fix would equate "root of repo" with "root of project". That's something that's true 99% of the time, but isn't actually entailed by the design of the system - at least, not this far down.

@sdboyer
Copy link
Member

sdboyer left a comment

Just a naming nit, otherwise LGTM

@@ -28,6 +28,15 @@ type Package struct {
TestImports []string // Imports from all go test files (in go/build parlance: both TestImports and XTestImports)
}

// svnRoots is a set of directories we should not descend into in ListPackages when
// searching for Go packages
var svnRoots = map[string]struct{}{

This comment has been minimized.

@sdboyer

sdboyer May 13, 2017

Member

vcsRoots instead of svnRoots, no?

This comment has been minimized.

@sectioneight

sectioneight May 15, 2017

Contributor

lol not sure where i get svnRoots from, good catch

@@ -1304,6 +1292,18 @@ func TestListPackages(t *testing.T) {
Imports: []string{"sort"},
},
},
"dotgodir/.m1p": {

This comment has been minimized.

@sdboyer

sdboyer May 13, 2017

Member

I'm glad you caught these to move them, I entirely forgot they were there 😄

This comment has been minimized.

@sectioneight

sectioneight May 15, 2017

Contributor

NP :)

sectioneight added some commits May 12, 2017

Move .m1p tests to dotgodir
These are no longer "disallowed", so having them in that case block is
misleading.

@sectioneight sectioneight force-pushed the sectioneight:allow-dots branch from b4761b0 to 36b6d46 May 15, 2017

@sectioneight

This comment has been minimized.

Copy link
Contributor

sectioneight commented May 15, 2017

Hygiene question: I did a rebase rather than a merge of master before pushing my branch. Is there guidance on this project around squashing/rebasing/merging?

@sdboyer

This comment has been minimized.

Copy link
Member

sdboyer commented May 16, 2017

LGTM. In we go 😄

Is there guidance on this project around squashing/rebasing/merging?

We haven't really established any formally. Informally, here's what I operate by:

  1. We just do straight merges into master, at least for now. No squashing.
  2. If you feel your branch history to be just too unsightly, then squashing out some commits is appreciated.
  3. Rebasing is the preferred method to catch up against mainline when that's necessary.
  4. If mainline has changed significantly enough that rebasing is arduous, whereas merging is easier (because the merge algorithms are smarter), then use a merge instead - but write a commit message to explain the conflicts necessitating the merge.

@sdboyer sdboyer merged commit 06a4f0b into golang:master May 16, 2017

4 checks passed

cla/google All necessary CLAs are signed
codeclimate no new or fixed issues
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sectioneight sectioneight deleted the sectioneight:allow-dots branch May 16, 2017

@sectioneight

This comment has been minimized.

Copy link
Contributor

sectioneight commented May 16, 2017

Cool. I'll probably start self-squashing a la gerrit / phab / other tools I'm used to to keep lineage clean, and continue rebasing. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment