Ray's Knowledge Base
Unlock

Identify a project by git remote URL, with the root commit as fallback

DecisionVerified 2 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.

Context#

rkb must know which project a lesson belongs to when run from any clone.

Decision#

Identify a project by git remote URL, with the repo's root commit (git rev-list --max-parents=0 HEAD) as fallback, never by a folder path.

Why#

The user works on both a laptop and clusters, and the paths differ. The root commit and the remote survive new commits, branches, local edits and fresh clones.

Rejected options#

Folder paths.

Cost accepted#

Lessons must use relative paths or variables such as $SCRATCH and $PROJECT_ROOT, and per-system roots go in system.toml.

Also found by searching

  • identify a project by folder path or by git remote
  • root commit as project identity fallback
  • same repo on laptop and cluster matches different paths
  • git rev-list --max-parents=0 HEAD as project id