跳至主要内容

Manage local gits with repo

Would like to use repo because of Uh… Vim 8.0

There are at least two copy of VIMs lives in my laptop. One was manually installed gvim 8.1, the other is bundled vim by msysgit.

As of vim 8.x there’s a new package management system released. One may manage all vim plugin package without any third part plugin manager. As described in this famous blog post.

git submodule add https://github.com/vim-airline/vim-airline.git pack/shapeshed/start/vim-airline # 
git add .gitmodules pack/shapeshed/start/vim-airline

Anyway, I have no confidence in the git submodule command. Also, the solution try to initial one git repo group for each dot vim. I don’t like to iterate over all dot vim directories one by one when doing plugin updates.

Alternative way is to make use of git-repo tool to handle all the git repositories (vim plugins) as a whole…

Repo init

Error executing repo init… Because of msys path and win32 native path conflict. As my python interpreter comes with emacs, which is compiled to work as native program. And its os.path.expanduser api will return windows native path.

$ repo init -m workspace/xml/manifest.xml
gpg: keyblock resource '/c/opt/root/C:\opt\root/.repoconfig/gnupg/pubring.kbx': No such file or directory
gpg: no writable keyring found: Not found
gpg: error reading '[stdin]': General error
gpg: import from '[stdin]' failed: General error
gpg: Total number processed: 0
fatal: registering repo maintainer keys failed

Repo manifest file and local manifest

Manifest file is the configuration(repository information database) for git-repo tool. It is in XML format, DTD can be found in its official document.

Refer to Learn about the repo tool , manifests and local manifests and 5 important tips ! by Red Devil

Also, the official git-repo document

The XML and DTD and nxml

Lesson learn from DTD to rng converting:

  1. The `<!DOCTYPE foobar [’ tag is for inline DTD, for external DTDs this tag along with its conterpart `]>’ should be removed for validity.
  2. XSD to RNG, RNC, DTD converting is almost impossible, as XSD is too strict comparing with other XML validating format.

Convert DTD to RNG with jing-trang

cd ~/workspace
mkdir xml
cat > repo-manifest.dtd
# comment out first and last line in repo-manifest.dtd
# to form a valid external dtd file

To-Be-Continued

The repo tool is not officially supported on windows. And I find the issue of my environment is also in esrlabs clone.

I don’t have too much time working on repo tool, leave it there.

Would like to see if depottools gclient can help.

 

评论

此博客中的热门博文

Eglot and before/after-save-hook and use-package

In Emacs, when you try to automate some actions during every save action, you will surely get to the before-save-hook and the after-save-hook. Simply adding something like gofmt-before-save to before-save-hook will save you tons of time to do the go-fmt. And then, I meet eglot, and gopls will also save me tons of time doing googling and api documentation navigation. But eglot-ensure is not very friendly to the good old ways of how after-save-hooks were designed to work. It makes the before/after-save-hook a buffer local variable and it does not inherit the variable's global value. So, to make before/after-save-hook work again, experts start to adding hooks to major mode specific hooks like this: emacs.md - Go (opensource.google) """ ;; Optional: install eglot-format-buffer as a save hook. ;; The depth of -10 places this before eglot's willSave notification, ;; so that that notification reports the actual contents that will be saved. (defu...

Use MobaDiff with git difftool

Recently there's an activity in IT that forces the deletion of all unauthorized softwares from all work machines. Unfortunately, kdiff3 is one in the list. As it is generally okay to use vimdiff as an alternative for kdiff3, A gui tool is better suited for desktop workflows. Known that MobaXterm is shipping a gui diff tool named MobaDiff. But it only appears in the windows right click context menu. Find the real application name takes me some time to search in the windows registry. "MobaRTE.exe", which is the one invoked by HKCR\*\shell\MobaDiff. And it was invoked with "-contextdiff" switch to show MobaDiff UI, while when the switch is "-contextedit" it shows MobaTextEditor. Too bad that the "-contextdiff" switch do not support pre-image post-image as other diff tool did, which effectively made it unable to be used as a command line diff utility. Also MobaTech did not mention anything in their document of this Mob...