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

add 'gohack promote' or 'gohack undo -get' #60

Open
josharian opened this issue Sep 30, 2019 · 2 comments
Open

add 'gohack promote' or 'gohack undo -get' #60

josharian opened this issue Sep 30, 2019 · 2 comments

Comments

@josharian
Copy link
Contributor

I find myself popping back and forth a lot between working on my current project and working on its dependencies.

The most painful part of this is currently when I've decided I am happy with a change in a dependency and want to use it immediately in my project. This requires:

  1. commit+push dependency (not always to master, sometimes to PR for review while I continue to use it, so as not to be bloocked)
  2. git rev-parse head of dependency to find version to use
  3. go get pkgpath@version in project to update to latest version
  4. comment out replace directive in project (or remove it; I comment out to make it easier to switch back into hack mode)

1 will always need to be done manually, but 2-4 could be automated. gohack currently only does 4.

How do you feel about adding 2 and 3 to gohack? Ideas: gohack promote or gohack undo -get or gohack undo -promote.

(I'm starting to lean towards building another tool that most closely matches my current workflow, in which I am actively working a lot on a dependency or two, but I'd like to first investigate whether I can achieve a happy union with gohack.)

@myitcv
Copy link
Collaborator

myitcv commented Oct 1, 2019

I'd certainly use this, so it would get my vote!

@josharian
Copy link
Contributor Author

I was about to start on this, but...

The docs for undo state:

The undo command can be used to revert to the non-gohacked
module versions. It only removes the relevant replace
statements from the go.mod file

This seems at least mildly opposed to the behavior I want.

So I think might I wait for a bit more input before starting. In particular, should this be an undo flag, a new command, or...?

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

2 participants