Skip to content
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

tig does not show files inside subdir of worktree when $GIT_DIR is set #763

Closed
g-raud opened this issue Nov 19, 2017 · 2 comments
Closed

Comments

@g-raud
Copy link

g-raud commented Nov 19, 2017

Using tig 2.2 or 2.3.0 the CWD is ignored to qualify relative paths if GIT_DIR is set; all paths must be given relative to the GIT_WORK_TREE it seems. This is annoying, particularly with vcsh (that sets a GIT_DIR inside ~/.config with a GIT_WORK_TREE of ~/), and is not what git-log does. Example:

cd ~
vcsh init test
vcsh test add .config/tig/tigrc
vcsh test commit -m 'tigrc'
vcsh test tig -- .config/tig/tigrc # shows the commit
vcsh test log -- .config/tig/tigrc # does not show anything
cd .config/
vcsh test tig -- tig/tigrc # fails (No revisions match the given arguments.) 
vcsh test log -- tig/tigrc # shows the commit
vcsh test tig -- .config/tig/tigrc # shows the commit
vcsh test log -- .config/tig/tigrc # does not show anything
@jonas
Copy link
Owner

jonas commented Dec 11, 2017

Worktree support is lacking to the extend of even being broken.

I do not personally use worktrees so any contributions in the area would be much appreciated.

@jonas
Copy link
Owner

jonas commented May 19, 2018

When running tig as a git alias, git will chdir(GIT_WORK_TREE) and pass the subdirectory tig was invoked in as GIT_PREFIX. So the fix is to chdir(GIT_PREFIX).

@jonas jonas closed this as completed in c9e4ccd May 20, 2018
rolandwalker pushed a commit to rolandwalker/tig that referenced this issue May 21, 2018
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

2 participants