Skip to content

consider GIT_DIR/GIT when opening gitui #1223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dreuter opened this issue May 10, 2022 · 6 comments
Closed

consider GIT_DIR/GIT when opening gitui #1223

dreuter opened this issue May 10, 2022 · 6 comments

Comments

@dreuter
Copy link

dreuter commented May 10, 2022

Is your feature request related to a problem? Please describe.
I am using vcsh to manage my dotfiles. It is a wrapper around git, which allows me to have more than one git repository "checked out" in the home directory. I would love to use gitui to stage/commit/log... in the vcsh repositories.
But currently it tells me:

$ gitui
invalid path
please run gitui inside of a non-bare git repository

Whereas the normal git commands like i.e. git log work as usual.

Describe the solution you'd like
gitui should respect the GIT_DIR variable, such that one can use gitui even if they are not in a subfolder of the git repo if this variable is set.

Describe alternatives you've considered
One could checkout the repos like normal, edit/copy and commit in the normal repo, push and pull via vcsh.

Additional context
https://github.com/RichiH/vcsh
https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables

@mark2185
Copy link
Contributor

In the meantime, have you tried using launching gitui with the --directory flag?

OPTIONS:
    -d, --directory <directory>    Set the git directory

@dreuter
Copy link
Author

dreuter commented May 10, 2022

In the meantime, have you tried using launching gitui with the --directory flag?

OPTIONS:
    -d, --directory <directory>    Set the git directory

You are absolutely right, this is the correct workaround. gitui -d=${GIT_DIR} works like a charm :)
But I guess considering GIT_DIR would still be useful? And it should be relatively straight forward to implement then I guess.

@mark2185
Copy link
Contributor

But I guess considering GIT_DIR would still be useful? And it should be relatively straight forward to implement then I guess.

I wholeheartedly agree, I just wanted to ease your trouble until it's implemented properly :)

@dreuter
Copy link
Author

dreuter commented May 10, 2022

I just found 13afbf6 I guess it is just not released. Sorry for the noise...

@dreuter dreuter closed this as completed May 10, 2022
@glaeqen
Copy link

glaeqen commented Feb 9, 2023

On that note, vcsh run <repo> gitui can be also used (it just forwards environmental variables to gitui).

But in general this is not enough, because GIT_WORK_TREE for vcsh managed repos is in the home directory which causes gitui to explode when it tries to process all the untracked files. Is there some kind of workaround? If not, this could be solved by a flag to gitui that would make it ignore untracked files. Great project BTW, love it.

@extrawurst
Copy link
Collaborator

@glaeqen sounds like this is a whole different issue. can you open a new one and describe it so one can reproduce without prior knowledge?

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

No branches or pull requests

4 participants