Skip to content

Commit 1964b55

Browse files
Damien Mehalaalex-courtis
authored andcommitted
fix(nvim-tree#1976): support non-standard $GIT_DIR (nvim-tree#2012)
* Improve $GIT_DIR handling - Retrieve $GIT_DIR using `git rev-parse --absolute-git-dir` - Move $GIT_DIR ignore in the project exploration part Resolves nvim-tree#1976 * Code review - move norm_path to utils.lua - fix comment nvim-tree#2012 * add comments for utils.norm_path * get_git_directory use norm_path from utils * watcher improvements --------- Co-authored-by: Alexander Courtis <[email protected]>
0 parents  commit 1964b55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+11584
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
end_of_line = lf
6+
7+
[*.lua]
8+
indent_style = space
9+
indent_size = 2
10+
11+
[nvim-tree-lua.txt]
12+
max_line_length = 78

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: kyazdani42

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Bug report
2+
description: Report a problem with nvim-tree
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Is this a question?
9+
* Please start a new [Q&A discussion](https://github.com/nvim-tree/nvim-tree.lua/discussions/new) instead of raising a bug.
10+
11+
Before reporting:
12+
* search [existing issues](https://github.com/nvim-tree/nvim-tree.lua/issues)
13+
* ensure that nvim-tree is updated to the latest version
14+
15+
If you are experiencing performance issues, please [enable profiling](https://github.com/nvim-tree/nvim-tree.lua#performance-issues) and attach the logs.
16+
- type: textarea
17+
attributes:
18+
label: "Description"
19+
description: "A short description of the problem you are reporting."
20+
validations:
21+
required: true
22+
- type: textarea
23+
attributes:
24+
label: "Neovim version"
25+
description: "Output of `nvim --version`. Please see nvim-tree.lua [minimum required version](https://github.com/nvim-tree/nvim-tree.lua#notice)."
26+
placeholder: |
27+
NVIM v0.6.1
28+
Build type&#58 Release
29+
LuaJIT 2.1.0-beta3
30+
render: text
31+
validations:
32+
required: true
33+
- type: input
34+
attributes:
35+
label: "Operating system and version"
36+
placeholder: "Linux 5.16.11-arch1-1, macOS 11.5, Windows 10"
37+
validations:
38+
required: true
39+
- type: input
40+
attributes:
41+
label: "nvim-tree version"
42+
description: "`cd <your-package-directory>/nvim-tree.lua ; git log --format='%h' -n 1`"
43+
placeholder: |
44+
nvim-tree branch, commit or tag number
45+
validations:
46+
required: true
47+
- type: textarea
48+
attributes:
49+
label: "Minimal config"
50+
description: "Minimal(!) configuration necessary to reproduce the issue.
51+
52+
See [wiki: Clean Room Replication](https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#clean-room-replication) for instructions.
53+
54+
Please paste the contents of your `/tmp/nvt-min.lua` here."
55+
render: lua
56+
validations:
57+
required: true
58+
- type: textarea
59+
attributes:
60+
label: "Steps to reproduce"
61+
description: "Steps to reproduce using the minimal config provided below."
62+
placeholder: |
63+
1. nvim -nu /tmp/nvt-min.lua
64+
2. :NvimTreeOpen
65+
3. ...
66+
validations:
67+
required: true
68+
- type: textarea
69+
attributes:
70+
label: "Expected behavior"
71+
description: "A description of the behavior you expected:"
72+
- type: textarea
73+
attributes:
74+
label: "Actual behavior"
75+
description: "Observed behavior (may optionally include images, videos or a screencast)."
76+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: feature request
6+
assignees: ''
7+
8+
---
9+
**Is this a question?**
10+
Please start a new [Q&A discussion](https://github.com/nvim-tree/nvim-tree.lua/discussions/new) instead of raising a feature request.
11+
12+
**Can this functionality be implemented utilising API?**
13+
nvim-tree exposes extensive API (see `:h nvim-tree-api`). Can it be used to achieve your goal? Is there a missing API that would make it possible?
14+
Given stable status of nvim-tree it's preferred to add new API than new functionality.
15+
16+
**Is your feature request related to a problem? Please describe.**
17+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
18+
19+
**Describe the solution you'd like**
20+
A clear and concise description of what you want to happen.
21+
22+
**Describe alternatives you've considered**
23+
A clear and concise description of any alternative solutions or features you've considered.
24+
25+
**Additional context**
26+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/nvt-min.lua

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
vim.cmd [[set runtimepath=$VIMRUNTIME]]
2+
vim.cmd [[set packpath=/tmp/nvt-min/site]]
3+
local package_root = "/tmp/nvt-min/site/pack"
4+
local install_path = package_root .. "/packer/start/packer.nvim"
5+
local function load_plugins()
6+
require("packer").startup {
7+
{
8+
"wbthomason/packer.nvim",
9+
"nvim-tree/nvim-tree.lua",
10+
"nvim-tree/nvim-web-devicons",
11+
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
12+
},
13+
config = {
14+
package_root = package_root,
15+
compile_path = install_path .. "/plugin/packer_compiled.lua",
16+
display = { non_interactive = true },
17+
},
18+
}
19+
end
20+
if vim.fn.isdirectory(install_path) == 0 then
21+
print "Installing nvim-tree and dependencies."
22+
vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
23+
end
24+
load_plugins()
25+
require("packer").sync()
26+
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
27+
vim.opt.termguicolors = true
28+
vim.opt.cursorline = true
29+
30+
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
31+
_G.setup = function()
32+
require("nvim-tree").setup {}
33+
end
34+

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
reviewers:
8+
- "gegoune"

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
luacheck:
13+
name: luacheck
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Prepare
19+
run: |
20+
sudo apt-get update
21+
sudo add-apt-repository universe
22+
sudo apt install luarocks -y
23+
sudo luarocks install luacheck
24+
- name: Run luacheck
25+
run: luacheck .
26+
stylua:
27+
name: stylua
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: JohnnyMorganz/stylua-action@v2
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
version: latest
35+
args: --color always --check lua/

.github/workflows/release-please.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
name: release-please
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: google-github-actions/release-please-action@v3
11+
id: release
12+
with:
13+
release-type: simple
14+
package-name: nvim-tree
15+
command: github-release
16+
- uses: actions/checkout@v3
17+
- name: tag major and minor versions
18+
if: ${{ steps.release.outputs.release_created }}
19+
run: |
20+
git config user.name github-actions[bot]
21+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
22+
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
23+
git tag -d v${{ steps.release.outputs.major }} || true
24+
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
25+
git push origin :v${{ steps.release.outputs.major }} || true
26+
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
27+
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
28+
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
29+
git push origin v${{ steps.release.outputs.major }}
30+
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Semantic Pull Request Subject
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- edited
8+
- synchronize
9+
jobs:
10+
semantic-pr-subject:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: amannn/[email protected]
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.hooks/pre-commit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
stylua . --check || exit 1
4+
luacheck . || exit 1

.luacheckrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- vim: ft=lua tw=80
2+
3+
-- Don't report unused self arguments of methods.
4+
self = false
5+
6+
ignore = {
7+
"631", -- max_line_length
8+
}
9+
10+
-- Global objects defined by the C code
11+
globals = {
12+
"vim",
13+
"TreeExplorer"
14+
}

.luarc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3+
"runtime.version" : "Lua 5.1",
4+
"diagnostics": {
5+
"globals": [
6+
"vim"
7+
]
8+
}
9+
}
10+

.stylua.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
column_width = 120
2+
line_endings = "Unix"
3+
indent_type = "Spaces"
4+
indent_width = 2
5+
quote_style = "AutoPreferDouble"
6+
call_parentheses = "None"

CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing to `nvim-tree.lua`
2+
3+
Thank you for contributing.
4+
5+
## Styling and formatting
6+
7+
Code is formatted using luacheck, and linted using stylua.
8+
You can install these with:
9+
10+
```bash
11+
luarocks install luacheck
12+
cargo install stylua
13+
```
14+
15+
You can setup the git hooks by running `scripts/setup-hooks.sh`.
16+
17+
## Adding new actions
18+
19+
To add a new action, add a file in `actions/name-of-the-action.lua`. You should export a `setup` function if some configuration is needed.
20+
Once you did, you should run the `scripts/update-help.sh`.
21+
22+
## Documentation
23+
24+
When adding new options, you should declare the defaults in the main `nvim-tree.lua` file.
25+
Once you did, you should run the `scripts/update-help.sh`.
26+
27+
Documentation for options should also be added, see how this is done after `nvim-tree.disable_netrw` in the `nvim-tree-lua.txt` file.
28+
29+
## Pull Request
30+
31+
Please reference any issues in the description e.g. "resolves #1234".
32+
33+
Please check "allow edits by maintainers" to allow nvim-tree developers to make small changes such as documentation tweaks.
34+
35+
A test case to reproduce the issue is required. A ["Clean Room" Replication](https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#clean-room-replication) is preferred.
36+

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
nvim-tree.lua is a file explorer / filesystem tree view plugin for neovim
2+
Copyright © 2019 Yazdani Kiyan
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.

0 commit comments

Comments
 (0)