Git Product home page Git Product logo

Comments (8)

rogpeppe avatar rogpeppe commented on July 18, 2024

Thanks for raising this issue. Storing all gohacked modules locally to a project was actually the first approach I considered. I decided against it because I wanted it to be straightforward to turn changes to gohacked modules into PRs or to be able to easily save the code. With a local gohack directory, every time you ran gohack from a new project, you would need to set up a git remote to point to your fork of the repo, for example.

Instead, I considered that it was probably better to keep them in a well known place, not separately inside each project. That way any code you've written can easily be stashed and found again, and your remotes only need to be set up once.

When you gohack a module, gohack does give an error if that module has been edited since it was gohacked (and avoids checking out the current version in that case), so at least you know when you're not using the correct version.

You can set the $GOHACK environment variable if you want the files to go in a different place. One possible idea would be to specify that a non-absolute $GOHACK path would be interpreted relative to the current module's root directory. That would make it easy to achieve your suggestion.

Please try out gohack and provide feedback. There are lots of arbitrary decisions in its design which can only be validated by real work use.

from gohack.

mortyccp avatar mortyccp commented on July 18, 2024

It will be useful for situation using docker-compose for development.
Since we cannot mount volume outside of build context. A way to store gohacked modules locally will great.

from gohack.

rogpeppe avatar rogpeppe commented on July 18, 2024

You can set the GOHACK environment variable to the name of any directory. Does that fulfill your requirements here?

from gohack.

mortyccp avatar mortyccp commented on July 18, 2024

Yes, I think GOHACK=$(pwd) gohack ... will work.

from gohack.

rogpeppe avatar rogpeppe commented on July 18, 2024

but see also issue #35.

from gohack.

mortyccp avatar mortyccp commented on July 18, 2024

There problem I encounter using GOHACK=./hack gohack ... is that the replace path is missing the ./. I think implementing what you suggested about non-absolute path is valuable.

from gohack.

davidovich avatar davidovich commented on July 18, 2024

I believe this can now be closed by #45, as setting a relative directory in the GOHACK env var is now supported.

from gohack.

myitcv avatar myitcv commented on July 18, 2024

Agreed. @b0o @mortyccp please shout if you disagree and we can re-open.

from gohack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.