-
Notifications
You must be signed in to change notification settings - Fork 641
Use relative path also with absolute filename #868
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
Conversation
I have noticed that with gutentags [1] absolute paths would be used when only the current file gets updated via `--append /absolute/path/to/file`, even though `--tag-relative=yes` is used. I cannot see why an absolute path should be forced in that case, but have not checked if that behavior differs from the original ctags - however, it appears to date back to 2001 [2]. 1: https://github.com/ludovicchabant/vim-gutentags 2: https://github.com/universal-ctags/ctags/blob/568742a3708c2076e6d998246f8904629f89bbcb/read.c#L78
fe003ab to
791e1bb
Compare
|
The command being run is There seems to be a more in-depth issue here, because it's confusing that relative paths are being used from the beginning?! Lines 169 to 176 in 791e1bb
|
|
I introduced the code. |
|
@masatake |
|
I didn't inspect yet however, the line you spotted ( Lines 169 to 176 in 791e1bb
by me when I worked on improving input stream interface. |
|
@masatake |
|
@blueyed absolute paths are an important feature when your tag files are not stored in the project root (for instance, if you use commit hooks an store the tags file in |
|
@kopischke Apart from that, this PR/patch only affects |
|
@blueyed . |
|
@kopischke My setup: blueyed/dotfiles@c42e206 |
|
@blueyed exactly that is the issue with relative tag file paths in these setups: they are generated relative to the repo root, but Vim takes them as relative to the tag file location. |
|
@kopischke Anyway, I do not think this PR changes that behavior:
|
Look at " unless the files supplied on the command line are specified with
Because an absolute path is given. |
|
@masatake But I can see that this could break things for people. As for now, and with the legacy ctags, it needs to be fixed in the scripts (like in ludovicchabant/vim-gutentags#71). |
|
Though I did in some areas, breaking compatibility should be avoided. How about introducing @kopischke, do you have any comment about this approach? |
|
@blueyed, re-assign this to me if you are not in hurry. |
|
@kopischke |
|
@blueyed |
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless the path representation for input file(s). If "always" is given, relative paths are used always. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless the path representation for input file(s). If "always" is given, relative paths are used always. Signed-off-by: Masatake YAMATO <[email protected]>
|
See #893. |
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
Proposed in universal-ctags#868. "always" and "never" as an argument for --tag-relative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Even if "yes" is specified as an option argument for --tag-relative, absolute paths are used in tags output if an input is given as an absolute path. This behavior is expected in exuberant-ctags as written in its man-page. In addition to "yes" and "no", universal-ctags takes "never" and "always". If "never" is given, absolute paths are used in tags output regardless of the path representation for input file(s). If "always" is given, relative paths are used always. Some spelling misses are spotted by @blueyed. Signed-off-by: Masatake YAMATO <[email protected]>
I have noticed that with gutentags [1] absolute paths would be used when
only the current file gets updated via
--append /absolute/path/to/file.I cannot see why an absolute path should be used in that case, but have
not checked if that behavior differs from the original ctags, but it
appears to date back to 2001 [2].
This uses an absolute path only with
--tag-relative=no.1: https://github.com/ludovicchabant/vim-gutentags
2:
ctags/read.c
Line 78 in 568742a