Previous: , Up: Bootstrapping   [Contents][Index]


2.2.6 Missing commits and repositories

While bootstrapping it can happen that a commit or even a complete repository is missing. That can be scary but understanding what is going on and how to deal with it goes a long way.

So what does it look like when that happens? Here are two typical examples that you might see when running make bootstrap.

Some commit is missing:

--- [hl-todo] ---

Cloning into '/home/you/.emacs.d/lib/hl-todo'...
remote: Enumerating objects: 44, done.
remote: Counting objects: 100% (44/44), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 367 (delta 23), reused 36 (delta 15), pack-reused 323
Receiving objects: 100% (367/367), 71.98 KiB | 837.00 KiB/s, done.
Resolving deltas: 100% (158/158), done.
fatal: Could not parse object '02bda39bf2d2b77168255d9e49c78b95b0bd314a'.
futile: Checkout of '02bda39bf2d2b77168255d9e49c78b95b0bd314a' into submodule path 'lib/hl-todo' failed
HEAD is now at 3bba459 README.md: Cosmetics

Some repository is missing:

--- [paren-face] ---

Cloning into '/home/you/.emacs.d/lib/paren-face'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:tarsius/broken-url.git' into submodule path '/home/you/.emacs.d/lib/paren-face' failed
futile: Clone of any remote into submodule path 'lib/paren-face' failed

Both of these packages are not essential and I recommend that you delay figuring out what is going on exactly and that you instead proceed bootstrapping the rest of your configuration. Once you are done with that, then you have a personalized Emacs setup that allows you to efficiently investigate the above issues.

To skip a package you have to "deinit" the submodule and also remove the empty directory that represents the no longer initialized module:

$ git submodule deinit lib/paren-face/
Cleared directory 'lib/paren-face'
error: could not lock config file .git/modules/paren-face/config: No such file or directory
warning: Could not unset core.worktree setting in submodule 'lib/paren-face'
Submodule 'paren-face' (git@github.com:tarsius/broken-url.git) unregistered for path 'lib/paren-face'
$ rm -r lib/paren-face
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
        deleted:    lib/paren-face

no changes added to commit

Ignore the irrelevant warnings and that the package is now considered deleted.

Now make bootstrap has to resume where it left of, more or less. This make target is equal to these three commands:

$ git submodule init
$ lib/borg/borg.sh
$ make build

The first already succeeded at this point and the second failed somewhere along the way, so lets run that again. It will make some noise about the packages that is has already dealt with, but you can just ignore that. Then it should silently skip over the package that you have just disabled and proceed with the rest, proceeding towards the end of the alphabet.

So now that everything is peachy you can start Emacs and look into what went wrong. Here are some things that could have happened and how to deal with them.

The commit that you have referenced was removed from the upstream repository. Pick another commit instead and resume the bootstrap.

$ git submodule update --init lib/hl-todo
Submodule 'hl-todo' (git@github.com:tarsius/hl-todo.git) registered for path 'lib/hl-todo'
fatal: remote error: upload-pack: not our ref 02bda39bf2d2b77168255d9e49c78b95b0bd314a
Fetched in submodule path 'lib/hl-todo', but it did not contain 02bda39bf2d2b77168255d9e49c78b95b0bd314a. Direct fetching of that commit failed.
$ cd lib/hl-todo
$ git reset --hard
$ cd ../..
$ git add lib/hl-todo
$ git commit -m '"Update" hl-todo'

The repository was moved. Update the url and resume the bootstrap.

$ git config --file .gitmodules submodule.paren-face.url git@github.com:tarsius/paren-face.git
$ git submodule update --init lib/paren-face
Submodule 'paren-face' (git@github.com:tarsius/paren-face.git) registered for path 'lib/paren-face'
Cloning into '/home/you/.emacs.d/lib/paren-face'...
Submodule path 'lib/paren-face': checked out 'eb4a51b8ef455e0914108105e7c0008d675457cc'
$ git add .gitmodules
$ git commit -m "paren-face: Update url"

The repository was removed and no copy remains available anywhere. This is the worst case scenario and unlikely to become a reality. Remove the package for good.

$ git rm lib/goner
$ git commit -m "Remove goner"

Previous: , Up: Bootstrapping   [Contents][Index]