From: Omar Polo Subject: Re: mkstemp: Permission denied To: Johannes Thyssen Tishman Cc: gameoftrees@openbsd.org Date: Sat, 03 Jun 2023 00:17:10 +0200 On 2023/06/02 17:44:58 +0200, Johannes Thyssen Tishman wrote: > On Fri, Jun 02, 2023 at 03:20:18PM +0200, Omar Polo wrote: > > Hello, > > > > On 2023/06/02 12:54:27 +0200, Johannes Thyssen Tishman wrote: > > > Hi again, > > > > > > In my previous email[0] I described a how I found a way to keep the > > > worktree and the cloned repo on the same directory: > > > > > > $ mkdir test && cd test > > > $ got clone ssh://user@example.com/test .got > > > $ got checkout -E .got . > > > > > > However when doing this, I'm getting the following error on 'got add > > > file': > > > > > > got: mkstemps: /path/to/worktree/.got/file-index-OJVI2Q: Permission > > > denied > > > > yep, it's not the intended way to use the tool. ".got" in a worktree > > is used to store other metadata, not the repository itself. You might > > be lucky using another directory, e.g. ".repo", but I would suggest > > keeping your stuff elsewhere. I have a ~/git/ directory for that, but > > other places are fine. When I started using got I used to create > > foo/foo.repo with the bare repository and checkout the worktrees as > > foo/main, foo/branch-x, etc. > > Ah interesting. Would you mind telling me more about your workflow? You > keep your repos under ~/git and where do you keep your worktrees? Well, I'm usually quite disorganized, but I keep my repositories in ~/git (e.g. ~/git/got.git or ~/git/src.git for the OpenBSD src.git repository) and checkout out (one or more) worktrees in ~/w/; ~/w/got for example. Except that some stuff (e.g. emacs) is in checked out in ~/build/ for not particular reason. not particularly organized as you can see :-) I think others have similar setup, minor verbiage and paths, and with less disorganization. When I started using got I tried a different workflow that didn't stick with me, for no particular reason. I used ~/w/foo with foo/repo.git being the bare repo and ~/w/foo/main being the 'main' branch checked out, and so on. But that's just me. Use whatever setup works best for you; but I'd advise for using separate paths for the repository and the work trees. They're not useful for all projects, but being able to check out multiple worktrees -- even from the same branch -- is handy once you start to do it. Cheers, Omar Polo