my goal is to be able to interact with graphite st...
# how-do-i
j
my goal is to be able to interact with graphite stack from within a devcontainer. it largely works, the main issue is that I often run into tracking errors, I believe because there are unmounted files so my filesystem's graphite and the devcontainer's graphite get out of sync is there a list of directories that need to be mounted? or a best practice when doing something like this?
✅ 1
p
(If applicable) To help us more clearly understand what you're trying to do, please provide additional details about: - Screenshots / debug logs / list of commands you've tried to run so far - Your workflow - Current state
hey jonathan, are you mounting the files in a config file (
devcontainers.json
)
Copy code
{
  "postStartCommand": "ln -sf /tmp/graphite-config $HOME/.config/graphite",
  "mounts": [
    "source=${localEnv:HOME}/.config/graphite,target=/tmp/graphite-config,type=bind,consistency=cached"
  ]
}
j
yep, I am. thank you very much
p
cool, and you're persisting your
~/.config/graphite/user_config
across containers? what error are you seeing when they get out of sync?
j
I am not currently mounting anything, so anything that needs to be mounted would be very helpful to know the main issue that we've seen is that certain operations within the devcontainer will lead to graphite outside of the devcontainer losing tracking of branches
that said I also realized I was on an older version of graphite (1.7.x) so upgraded to the most recent
though looking at the contents of
~/.config/graphite
I'm wondering if this will fix the issue...basically, there are operations where if you do it in the devcontainer, it will be fine within the devcnotainer, but will need a
gt track
on my mac. I'm wondering if there is some graphite state saved somewhere that I need to make sure is consistent
p
so i would use a single workspace bind-mounted into the container so host and container see the same
.git
. Optionally also share
~/.config/graphite
into the container or use
GRAPHITE_AUTH_TOKEN
so auth isn’t duplicated so you may need to do an env override --- see Configure the CLI (env override section)
j
gotcha, thank you!
fwiw right now the container just mounts the workspace, so it should be seeing the same .git...it is a bit mysterious what is causing the weird lost tracking errors
p
yeah that is interesting. you may need to
gt track
again. let me know if after all these changes if you still have tracking errors
👍 1