8000 proposal: add command to determine if commit is ancestor of module version · Issue #59 · rogpeppe/gohack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

proposal: add command to determine if commit is ancestor of module version #59

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 cl 7FFF icking “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

Open
myitcv opened this issue Sep 5, 2019 · 0 comments

Comments

@myitcv
Copy link
Collaborator
myitcv commented Sep 5, 2019

I'm not entirely sure this belongs in gohack, but given the -vcs flag gohack makes answering it possible. So raising here for discussion at least.

I'm trying to answer the following question:

Given commit $commit, are we currently using a version of module $m that that has $commit as an ancestor?

The answer is in effect given by this sequence of commands:

GOHACK=$(mktemp -d) gohack get -vcs golang.org/x/tools
pushd $(go list -m -f {{.Replace.Dir}} golang.org/x/tools)
answer=$(git merge-base --is-ancestor $commit HEAD && echo "yes" || echo "no")
popd
gohack undo golang.org/x/tools

Does it make sense to provide a gohack command that answers this question?

cc @rogpeppe @mvdan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0