Comments (8)
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.
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.
You can set the GOHACK environment variable to the name of any directory. Does that fulfill your requirements here?
from gohack.
Yes, I think GOHACK=$(pwd) gohack ...
will work.
from gohack.
but see also issue #35.
from gohack.
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.
I believe this can now be closed by #45, as setting a relative directory in the GOHACK env var is now supported.
from gohack.
Agreed. @b0o @mortyccp please shout if you disagree and we can re-open.
from gohack.
Related Issues (20)
- getting permission denied error HOT 3
- implement undo -rm
- gohack get -vcs failed with incompatible pathspec HOT 1
- gohack does not allow relative directories in GOHACK env var. HOT 2
- Ran gohack get github.com/user/somerepo and it is missing the .git directory HOT 1
- bitbucket.org issues
- cannot undo if directory has been removed
- README: perhaps briefly explain how to work with a fork, including pushing a change to the fork?
- Use existing dependency code source from the GOPATH HOT 4
- Idea: flag for "fork" remote HOT 2
- proposal: add command to determine if commit is ancestor of module version
- add 'gohack promote' or 'gohack undo -get' HOT 2
- add 'gohack list' or shell completion support HOT 4
- accept package path in 'gohack get' HOT 2
- gohack redo
- gohack undo leaves trailing newlines HOT 3
- cannot get module info HOT 4
- Imply module name from $PWD HOT 5
- support linked file in gohack directory HOT 1
- supporting workspaces? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gohack.