Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions dist/commitlore.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 38 additions & 6 deletions dist/hooks/commit-msg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/hooks/commit-msg.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions installer/canonical-artifact.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"tsconfig.json",
"src"
],
"sha256": "c2a9710550e0fa33bfb97945d73d6743a9d42234d6b38c56da9d3644bd1aa5b8"
"sha256": "8a3c589cf02a26d841a91d6ea9669492466753c9673e8e61c058bb3248e4c875"
},
"artifact": {
"sha256": "b9e7110c64788123ec3b20ad93cd6fb97af35c7523c4c1275060e193a1849e45",
"sha256": "c8475b5c41228ac4f7cfdeea090b19541338ca944111dc9d9918b516e09a93ec",
"files": [
{
"path": "dist/cli.d.ts",
Expand Down Expand Up @@ -598,7 +598,7 @@
},
{
"path": "dist/commitlore.mjs",
"sha256": "47fff7597a38bb2188943debd59bf90bdc8e80060a7d4acd21590b2a64b6a236"
"sha256": "f3af51a7479467128c562874012fd3183f7393f6cd8aed045896e737f8239646"
},
{
"path": "dist/core/agent-configs.d.ts",
Expand Down Expand Up @@ -1074,11 +1074,11 @@
},
{
"path": "dist/hooks/commit-msg.js",
"sha256": "ad314ead4a0242a10fb052e018b2755cb5f61bae7b2e9aa2c677a138b4ce3d9b"
"sha256": "b2260805e270db23bb0f7c886e41bcb5862ff0f44fea61f7d049a9d37dbcb36b"
},
{
"path": "dist/hooks/commit-msg.js.map",
"sha256": "c6a71203f9f80305d9b42f576eee18e2d7c4bc65b7ae4585e540295148612f29"
"sha256": "1a341e4f3d17e02498c662be004b4215c16ccd13a7aad574d800c466d2be4f36"
},
{
"path": "dist/hooks/post-commit.d.ts",
Expand Down
44 changes: 38 additions & 6 deletions src/hooks/commit-msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,44 @@ const stubText = (unresolved: readonly string[]): string =>
' exec "$recorded_node" "$recorded" validate --message-file "$1"',
' ;;',
' *)',
' # Resolved and refused without looking at the leaf, which is',
' # what the ending below is careful to claim and no more.',
' # Both sides are already resolved, so these are the physical',
' # paths the comparison actually used rather than what was',
' # recorded -- which is the whole point, since an upgrade is the',
' # difference between the two (#746).',
' # An upgrade and a repointed `commitlore.bin` both land here,',
' # and exactly one of them can be told apart by shape.',
' #',
' # `hooks install` writes `bin` as the literal string',
' # `<data-root>/current/dist/commitlore.mjs` and `root` as the',
' # physical `v<x>` it resolved to at the time. An upgrade moves',
' # the installer-owned `current` symlink to a sibling `v<y>`:',
' # the recorded string does not change, and the new target is a',
' # sibling of the recorded root. #71 is the opposite shape --',
' # the string itself is replaced with an arbitrary `.js`, and a',
' # `.git/config` editor cannot write the installer-owned',
' # symlink or place a directory beside its versioned trees.',
' #',
' # So the trust root is rebound to what `current` resolves to',
' # now, and the same containment check is applied again. Two',
' # weaker rules were rejected: "share a common ancestor" admits',
' # `/` and therefore everything, and "follow `current` wherever',
' # bin points" is satisfied by a planted',
' # `/tmp/current/dist/commitlore.mjs`.',
' commitlore_rebound=',
' case "$recorded_slashed" in',
' */current/dist/commitlore.mjs)',
' commitlore_link=${recorded_slashed%/dist/commitlore.mjs}',
' if [ -L "$commitlore_link" ]; then',
' commitlore_now=$(cd "$recorded_dir/.." 2>/dev/null && pwd -P) || commitlore_now=',
' commitlore_rp=$(cd "$root_dir/.." 2>/dev/null && pwd -P) || commitlore_rp=',
' commitlore_np=$(cd "$commitlore_now/.." 2>/dev/null && pwd -P) || commitlore_np=',
' if [ -n "$commitlore_now" ] && [ -n "$commitlore_rp" ] && [ "$commitlore_rp" = "$commitlore_np" ]; then',
' case "$recorded_dir" in',
' "$commitlore_now"|"$commitlore_now"/*) commitlore_rebound=1 ;;',
' esac',
' fi',
' fi',
' ;;',
' esac',
' if [ -n "$commitlore_rebound" ]; then',
' exec "$recorded_node" "$recorded" validate --message-file "$1"',
' fi',
' commitlore_outside=$recorded_dir',
' commitlore_trusted=$root_dir',
' ;;',
Expand Down
Loading
Loading