Posted on :: Tags: , , , , , ,

πŸ‡ Welcome to the November 7th issue of Xvc Devlog. In the previous devlog, we began to implement Git integration. How is it going, Mr. Tortoise?

🐒 It looks like we don’t have many architectural problems.

πŸ‡ You’re forgetting how Exec::cmd works, though. You have those kinds of problems.

🐒 Yeah, I’m figuring that out. Exec::shell requires a string to run on the shell, while Exec::cmd just needs a command name. You have to supply args with another function. I’m writing a closure now to handle this.


🐒 It started working, but it revealed a much bigger problem: .xvc/ is not added to .gitignore in xvc init.

πŸ‡ Wow, that’s a showstopper.

🐒 Yup. I think I should fix it as well.

πŸ‡ On closer glance, I think the problem is not xvc init not modifying .gitignore; it modifies it incorrectly. Maybe putting certain files on a whitelist is a better idea than trying to blacklist everything.

🐒 Yeah, we should define a set of Git-tracked files and directories, whitelist them, and let all other files be ignored.

πŸ‡ Go ahead, then.

🐒 I think I’ve fixed it. There were two problems: the initial gitignore content was wrong, and it was placed in the root of the repository instead of .xvc.

πŸ‡ Maybe putting it directly in the root is better than hiding it in .xvc. What do you think?

🐒 There seems to be an assumption in file track to have a .gitignore file somewhere. I think we should also handle changes in .gitignore files throughout the repository.

πŸ‡ Umm, yes. We should handle .gitignore files as well. But not all .gitignore files are changed by Xvc. How can we make sure they were modified by Xvc?

🐒 I think there are ways to do that, like tracking them somewhere. But I believe we shouldn’t try. We should just get a list of .gitignore files, git add them, and include them in the commit.

πŸ‡ Ok. Let’s write a test for this as well. No .gitignore should appear in git status -s.

🐒 I wrote the test. It fails now. Do you think we should check the output of Git status to determine which files to add?

πŸ‡ That may be a good idea. Git status should already know which files need to be added. We can use that information.

🐒 It looks like pathspec is enough to modify git add behavior. We should be able to write *.gitignore and let all gitignore files be added.

πŸ‡ Let’s try this manually.

🐒 Yep, it works. git add '*.gitignore' adds all .gitignore files in the subdirectories, too.

πŸ‡ Congrats. πŸ‘πŸ₯³


🐒 I’m writing the missing documentation for the crates. There are proc_macro not expanded errors all over the code.

πŸ‡ I think you should update rust-analyzer and everything. There must be a command for this.

🐒 I reinstalled RA with :LspInstall and restarted the LSP. It seems to work correctly now.