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
1 change: 1 addition & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -euo pipefail

repo_root="$(git rev-parse --show-toplevel)"
export TORRUST_GIT_HOOKS_LOG_DIR="${TORRUST_GIT_HOOKS_LOG_DIR:-${repo_root}/.tmp}"

# Use human-friendly text format when stdout is a terminal; JSON for non-interactive / agent runs.
if [[ -t 1 ]]; then
Expand Down
1 change: 1 addition & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -euo pipefail

repo_root="$(git rev-parse --show-toplevel)"
export TORRUST_GIT_HOOKS_LOG_DIR="${TORRUST_GIT_HOOKS_LOG_DIR:-${repo_root}/.tmp}"

# Use human-friendly text format when stdout is a terminal; JSON for non-interactive / agent runs.
if [[ -t 1 ]]; then
Expand Down
23 changes: 17 additions & 6 deletions .github/skills/dev/maintenance/update-dependencies/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,20 @@ TIMESTAMP=$(date +%Y%m%d)
git checkout develop && git pull --ff-only
git checkout -b "${TIMESTAMP}-update-dependencies"

# Ensure the workspace-local ignored log directory exists.
mkdir -p .tmp

# Update dependencies
cargo update 2>&1 | tee /tmp/cargo-update.txt
cargo update 2>&1 | tee .tmp/cargo-update.txt
Comment thread
josecelano marked this conversation as resolved.

# If Cargo.lock has no changes, nothing to do — stop here.

# Verify
./contrib/dev-tools/git/hooks/pre-commit.sh --format=json

# Commit and push
# Commit and push (using the captured `cargo update` output as the commit body)
git add Cargo.lock
git commit -S -m "chore: update dependencies" -m "$(cat /tmp/cargo-update.txt)"
git commit -S -m "chore: update dependencies" -m "$(cat .tmp/cargo-update.txt)"
git push {your-fork-remote} "${TIMESTAMP}-update-dependencies"
```

Expand All @@ -65,6 +68,8 @@ TIMESTAMP=$(date +%Y%m%d)
git checkout develop
git pull --ff-only
git checkout -b "${TIMESTAMP}-update-dependencies"

mkdir -p .tmp
```

For breaking-change updates that require a tracked issue:
Expand All @@ -76,12 +81,13 @@ git checkout -b {issue-number}-update-dependencies
### Step 2: Run Cargo Update

```bash
cargo update 2>&1 | tee /tmp/cargo-update.txt
mkdir -p .tmp
cargo update 2>&1 | tee .tmp/cargo-update.txt
```

If `Cargo.lock` has no changes, there is nothing to update — exit early.

Review `/tmp/cargo-update.txt` to identify any major version bumps that may be breaking.
Review `.tmp/cargo-update.txt` to identify any major version bumps that may be breaking.

### Step 3: Handle Breaking Changes

Expand Down Expand Up @@ -114,9 +120,14 @@ Fix any failures before proceeding.

### Step 5: Commit and Push

Use the complete output captured from `cargo update` as the commit body. This preserves the
authoritative package-by-package update, addition, and removal list in Git history instead of
maintaining a manually abbreviated summary. Do not edit or summarize this output for the commit
body unless it contains information that must not be committed.

```bash
git add Cargo.lock
git commit -S -m "chore: update dependencies" -m "$(cat /tmp/cargo-update.txt)"
git commit -S -m "chore: update dependencies" -m "$(cat .tmp/cargo-update.txt)"
git push {your-fork-remote} "${TIMESTAMP}-update-dependencies"
```

Expand Down
Loading
Loading