)]}'
{
  "commit": "d27921f73b315dc1e01b92cc27370c29c3986f64",
  "tree": "8d245ab695e991337b7c11cdef23d280d10df466",
  "parents": [
    "5c654f6e66db881f17e202ec60cf7c997f7c0bad"
  ],
  "author": {
    "name": "Jon Friesen",
    "email": "jon@jonfriesen.ca",
    "time": "Thu Jun 05 13:15:56 2025 +0000"
  },
  "committer": {
    "name": "Josh Bleecher Snyder",
    "email": "josharian@gmail.com",
    "time": "Thu Jun 05 19:29:47 2025 -0700"
  },
  "message": "dockerimg: prioritize Dockerfile.sketch over Dockerfile\n\nImplement prioritization system for Dockerfile discovery that prefers\nDockerfile.sketch when available, falling back to standard Dockerfile\nbehavior when not present.\n\nProblem Analysis:\nThe existing code had a TODO comment requesting preference for\n\u0027Dockerfile.sketch\u0027 to allow users to tailor environments specifically\nfor Sketch usage. The current logic only handled single Dockerfile\nscenarios or fell back to generated dockerfiles, missing the\nopportunity to prioritize sketch-specific configurations.\n\nImplementation Changes:\n\n1. Prioritization Function:\n   - Added prioritizeDockerfiles() function with clear priority order\n   - Priority: Dockerfile.sketch \u003e Dockerfile \u003e other Dockerfile.*\n   - Case-insensitive matching for broader compatibility\n   - Returns first candidate when no priority matches\n\n2. Discovery Logic Update:\n   - Modified findOrBuildDockerImage() to use prioritization\n   - Removed single-dockerfile restriction for better flexibility\n   - Uses prioritizeDockerfiles() for any number of candidates\n   - Maintains existing behavior for generated dockerfile fallback\n\n3. User Experience Enhancement:\n   - Clear console output showing which dockerfile is being used\n   - Consistent behavior regardless of dockerfile count\n   - Preserves all existing functionality and error handling\n\nTechnical Details:\n- Maintains backward compatibility with existing Dockerfile usage\n- No changes to function signatures or public interfaces\n- Efficient O(n) prioritization with early returns\n- Proper filepath handling for cross-platform compatibility\n\nBenefits:\n- Users can create Dockerfile.sketch for sketch-specific environments\n- Automatic preference without requiring configuration changes\n- Maintains existing Dockerfile support as fallback\n- Clear, predictable behavior for dockerfile selection\n\nTesting:\n- Added comprehensive unit tests for prioritizeDockerfiles()\n- Integration tests verify findDirDockerfiles() compatibility\n- End-to-end tests confirm findRepoDockerfiles() behavior\n- All existing tests continue to pass without modification\n\nThis enhancement enables users to create sketch-optimized Docker\nenvironments while preserving full backward compatibility with\nexisting Dockerfile workflows.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: s1d7f47401929e175k\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "42d9e147db3eb48a77fa66734e5ff5bef5cc8905",
      "old_mode": 33188,
      "old_path": "dockerimg/dockerimg.go",
      "new_id": "8d656d87da428a4c48ae326da9c1323178f1d948",
      "new_mode": 33188,
      "new_path": "dockerimg/dockerimg.go"
    },
    {
      "type": "modify",
      "old_id": "b19b6d5fa351090c4d0abd0702e2941ba68fd245",
      "old_mode": 33188,
      "old_path": "dockerimg/dockerimg_test.go",
      "new_id": "c0dab1deaf6d1c66cf1cf9c07cc9b756e0a6f67f",
      "new_mode": 33188,
      "new_path": "dockerimg/dockerimg_test.go"
    }
  ]
}
