Skip to content
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

x/tools/go/vcs: vcs.Cmd.TagSync will fail if the repository's default branch is not 'master' [Go 1.9] #22556

Closed
vipally opened this issue Nov 3, 2017 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@vipally
Copy link

vipally commented Nov 3, 2017

  1. I use this command to clone the default branch of repository:
    git clone --depth 1 https://github.com/vipally/binary test_downloads\github.com\vipally\binary

  2. And this repository's default branch is not 'master' but 'develop'
    git status
    On branch develop
    Your branch is up-to-date with 'origin/develop'.
    nothing to commit, working tree clean

  3. After that I wanna use this code to keep working directory up-to-date with remote
    vcs.Cmd.TagSync(path, "")

    But unfortunately it will fail with report:
    error: pathspec 'master' did not match any file(s) known to git.

    Because it use such command to sync remote:
    git checkout master

    But current woring branch is not 'master' but 'develop'.

    This command is proper usage:
    git checkout

    You can see the test case here(TestDownloadAndSyncRepo):
    https://github.com/vipally/tools/blob/master/go/vcs/vcs_test.go#L158

    and fix code here:
    https://github.com/vipally/tools/blob/master/go/vcs/vcs.go#L115

    If confirm it as a bug, I will create a pullrequest to fix this issue.

@gopherbot gopherbot added this to the Unreleased milestone Nov 3, 2017
@empijei
Copy link
Contributor

empijei commented Nov 6, 2017

I think this is cause by this https://github.com/golang/tools/blob/master/go/vcs/vcs.go#L292 that uses default command if present and a tag was not specified.

The default command https://github.com/golang/tools/blob/master/go/vcs/vcs.go#L116 uses master without invoking TagLookupCmd.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 12, 2019
@dmitshur
Copy link
Contributor

Thanks for the report. This package has been deprecated in #57051 and won't receive further development, so closing this as not planned.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 26, 2023
@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants