whyrusleeping / gx

A package management tool
MIT License
1.88k stars 110 forks source link

[Documentation] Workflow for updating a dependency using git #174

Open schomatis opened 6 years ago

schomatis commented 6 years ago

I'm looking for documentation that would help me with the scenario described below which focuses on the workflow of using gx with git to keep track of changes.

I've installed go-ipfs and I want to work and update one of its dependencies go-ipfs-cmds using git, that is, being able to track down my work and push it to the corresponding repo. After downloading and installing all of go-ipfs dependencies (make install) I've proceeded to use the gx-go link tool to replace the plain go-ipfs-cmds gx version with the git version cloned from the repo (see https://github.com/whyrusleeping/gx/issues/161#issuecomment-374706397).

At this point the go-ipfs-cmds dependency is linked to the cloned git repo and all its dependencies (as reported by git) have been updated to use gx, e.g.,

-   "github.com/ipfs/go-ipfs-cmdkit"
+   "gx/ipfs/QmceUdzxkimdYsgtX733uNgzf1DLHyBKN6ehGSp85ayppM/go-ipfs-cmdkit"

This makes sense because I still want go-ipfs-cmds to use the same dependencies as go-ipfs (because I'm testing it through the use of go-ipfs).

I can now work on go-ipfs-cmds and make the necessary changes but when I want to commit those changes (and later push them) I'm going to need to undo the import path modifications, for that I'm guessing I need to use gx-go rw, gx-go rw --undo or gx-go uw (I haven't figured out which yet). After the commit if I want to keep working on the repo I'm going to have to rewrite the imports again (and restore them again to commit).

All this is a rather cumbersome series of steps and I think I might be missing something (a gx concept, a gx-go command) that would help me smooth this workflow but I haven't found much information in the gx/gx-go READMEs related to this.

whyrusleeping commented 6 years ago

gx-go uw is an alias for gx-go rw --undo, and is the opposite of gx-go rw.

After making your changes to the linked package, you'll need to do a gx-go uw before publishing.

All this is a rather cumbersome series of steps and I think I might be missing something.

For now, that's what we have. I'm very keen on getting input from users on what would make a better process, so let me know what you think we can do to improve things