Closed
Bug 1497708
Opened 7 years ago
Closed 7 years ago
moz-phab doesn't play well with git worktrees
Categories
(Conduit :: moz-phab, defect)
Conduit
moz-phab
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bholley, Unassigned)
References
Details
(Keywords: conduit-triaged)
Attachments
(1 file)
In git, you can create multiple working directories for the same underlying repository with `git worktree add`. This is useful to work on multiple projects simultaneously without invalidating builds when context switching.
moz-phab doesn't seem to handle this. Running it in a git worktree, I get:
> bholley@slice /files/mozilla/mc/q (stop_reinitializing_textures) $ moz-phab submit
> Not a repository (or any of the parent directories): .hg / .git
Updated•7 years ago
|
Blocks: 1497733
Keywords: conduit-triaged
Comment 1•7 years ago
|
||
After a talk on IRC.
This happens when worktree is created outside of git workdir.
`git worktree add ../foo`
`Git.__init__` will be more complicated.
We will need to check if `.git` exists (file or dir), and find the "dot path" using `git rev-parse --git-common-dir`.
Comment 2•7 years ago
|
||
moz-phab tries to recognize if it's called from a git repository by
looking for a `.git` directory in current path. If a user created a
worktree outside of a git repository (by running `git worktree add ../some-worktree`),
moz-phab can't find the main `.git` dir.
This patch makes it recognize the workdir's `.git` file and runs
`git rev-parse --git-common-dir` to find the real `.git ` directory.
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•7 years ago
|
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•