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)

defect
Not set
normal

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
Blocks: 1497733
Keywords: conduit-triaged
See Also: → 1494968
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`.
Attached file Git worktree support
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.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: