Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

git-pair should work in any directory when used globally #16

Open
nertzy opened this issue Oct 17, 2013 · 4 comments
Open

git-pair should work in any directory when used globally #16

nertzy opened this issue Oct 17, 2013 · 4 comments

Comments

@nertzy
Copy link

nertzy commented Oct 17, 2013

I always put global: true in my .pairs file, and I usually either keep it in my home directory, or symlink one from a project I most often work on to the home directory.

But even when I have ~/.pairs with global mode on, I get this...

$ git pair gh
fatal: Not a git repository (or any of the parent directories): .git

We should just set the global git user.

@tjarratt
Copy link
Contributor

tjarratt commented Dec 1, 2015

I'm not sure how this would work realistically. To the best of my knowledge, git does not invoke any plugins unless you are currently in a git repo.

@nertzy have you had any clever ideas for how to resolve this in the past two years? Could we close this issue?

@nertzy
Copy link
Author

nertzy commented Dec 1, 2015

I gave it a shot but I need to spend a little longer on it to get it right.

The core issue is that we check if we are in a git directory, and if not, we exit 1
(see https://github.com/pivotal/git_scripts/blob/81f510dd32cd3de8a1b720d5067c7d427289755e/lib/pivotal_git_scripts/git_pair.rb#L23)

But if we're using --global, it would be better to detect that we are not in a git directory and skip any local behavior instead.

@tjarratt
Copy link
Contributor

tjarratt commented Dec 2, 2015

Oh, I'm glad to learn that I'm totally wrong. Would be interested in getting that PR merged, this is useful behavior indeed!

@igbanam
Copy link

igbanam commented Sep 27, 2017

Did this gain any traction?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants