-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add root node in file tree #4346
base: master
Are you sure you want to change the base?
Conversation
Can confirm this is working well for me (have no opinions about implementation :)) It solves part of my problem, but I'll put more details about that in the discussion. |
b5db34b
to
36e48b0
Compare
I'm reasonably happy with the implementation now, and I cleaned up the commit history to make it reviewable. The distinction between GetPath and GetInternalPath might be a bit brittle and error-prone (easy to use the wrong one), but it's well-documented and the most reasonable solution I could think of. Let me know if you have any better ideas. I wouldn't want to go about adapting all the tests (lots of them) before we have agreement about how the root item should look. Right now it's |
Name was very confusing and misleading.
In preparation of making it private to the package.
This is in preparation for changing the meaning of path in the next commit.
As discussed let's go with '/' for the root |
36e48b0
to
99e56d8
Compare
Ok, force-pushed with that change if you want to try it more. Still no progress on adapting the tests, will do that on the weekend, probably. |
Thanks, will do |
Funnily enough I just hit an index.lock error when staging all files via the root file. It appears this is not in fact equivalent to pressing 'a', and I wonder if we should just use an explicit |
I do think the index.lock error is unrelated. I also get this (very occasionally) when hitting space on non-root items. The difference between space on the root item and |
Oh okay, good to know. Happy to consider it a coincidence. |
If files at the root level of the repository have changed, there was no way to see the combined diff of all of them. Fix this by inserting a
<root>
item in this case. This is useful in repositories such as git.git, which have all their.c
files at root level (gasp).If only files inside some folder have changed, the root item gets compressed away automatically, so nothing changes for that case (which I guess should be more common for most people).
This is a very rough draft. I'm not sure the implementation is the best one, and many tests fail. Just checking if we like the behavior before I go about adapting them all.
Addresses #4331.
go generate ./...
)