Comprehensive search in QMK source in all branches, incl. forks and forks of forks

The divergence of QMK software development can be confusing, but there is a systematic way to find which branch a particular feature or folder is in (instead of manually switch to each branch and manually look for the information).

Example: Q3 Pro source code

Find the Q3 Pro’s source is located, from scratch:

# About 300 MB. 582426 'objects'.
git clone https://github.com/Keychron/qmk_firmware.git  _qmk_firmware_KeychronFork_temp

# -i   : Case insensitive. Alternative: --regexp-ignore-case
# -S   : 'Pickaxe'
# --all: In all branches
#
cd $HOME/_qmk_firmware_KeychronFork_temp
git log -i -S"Q3 Pro" --all  --  keyboards

A result is:

commit 4ae5990fcc0fabdbbb82e2e1c1375c861963c4d5
Author: lokher <lokher@gmail.com>
Date:   Wed Jan 10 16:22:49 2024 +0800

    Added wireless support; Added Lemokey L3; Added Keychron V1 Max

Then:

git name-rev 4ae5990fcc0fabdbbb82e2e1c1375c861963c4d5

Result:

4ae5990fcc0fabdbbb82e2e1c1375c861963c4d5 wireless_playground~11

Thus, in “wireless_playground”.

Check it be going to the Keychron’s fork on the GitHub website, select “wireless_playground” (in the dropdown, first select “View all branches” (as it isn’t immediately visible)), and navigate to the keyboards/Keychron folder. The folder for Q3 Pro is present. The last modification is listed as 2024-01-10 (matching our search result). In this particular case, all files for it were probably added all at once (either sort of the initial commit or it was copied from some other branch/fork).

Conclusion: It this case, we seem to have found it, though it seems the Git commit message was poor (not representative).

Though this assumes the Git repository is already known, in this case Keychron’s fork of QMK.

Note that it searches in commit messages, so if those are not comprehensive or absent, nothing will be found. But it is also possible to search in the actual source code—see below.

Refinement

If the repository already exists, but is out of date (for example, source may have added in the meantime, e.g., source code for newer keyboard models in Keychron’s case):

cd $HOME/_qmk_firmware_KeychronFork_temp
git fetch # This will not make changes to the local 
          # repository, only download the information
git pull # The actual update

# -i   : Case insensitive. Alternative: --regexp-ignore-case
# -S   : 'Pickaxe'
# --all: In all branches
#
cd $HOME/_qmk_firmware_KeychronFork_temp
git log -i -S"Q3 Pro" --all  --  keyboards

All Keychron and Vial forks

Keychron forks

Vial forks

  • vial-qmk, the official Vial repository. It is a fork of QMK and has diverged to an unknown degree.
  • adophoxia’s fork. It is often referred to. But it isn’t updated for all the newer Keychron keyboard models

Leave a Reply

Your email address will not be published. Required fields are marked *

*