Skip to content

Commit d18aad2

Browse files
authored
fix: use path-specific commit message in sync script (#890)
1 parent f17aa1c commit d18aad2

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

MAINTAINING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ While maintaining releases for packages, starters and examples is done with Lern
2626
"sync:modules": "./scripts/sync-repo.sh 3.x git@git.drupal.org:project/ \"modules/*\"",
2727
```
2828
29-
2. Run `yarn sync:modules` to sync the latest commit on `main` with the git repo on drupal.org. All recent changes will be squashed into a commit using the latest commit message.
29+
2. Run `yarn sync:modules` to sync the latest commit on `main` with the git repo on drupal.org. All recent changes will be squashed into a commit using the most recent commit message that touched the synced path.
3030
3131
3. On Drupal.org’s GitLab, [tag a release](https://git.drupalcode.org/project/next/-/tags/new) following the [“Release tags naming conventions” docs](https://www.drupal.org/docs/develop/git/git-for-drupal-project-maintainers/release-naming-conventions#release-tags).
3232
@@ -131,7 +131,7 @@ The code in the examples repos do not strictly require a versioned release since
131131
yarn sync:examples
132132
```
133133
134-
All recent changes on `main` will be squashed into a commit on the target git repo using the latest commit message.
134+
All recent changes on `main` will be squashed into a commit on the target git repo using the most recent commit message that touched the synced path.
135135
136136
### Starters
137137
@@ -158,7 +158,7 @@ The code in the examples repos do not strictly require a versioned release since
158158
yarn sync:starters:release
159159
```
160160
161-
All recent changes on `main` will be squashed into a commit on the target git repo using the latest commit message.
161+
All recent changes on `main` will be squashed into a commit on the target git repo using the most recent commit message that touched the synced path.
162162
163163
4. **Create a GitHub release and tag**
164164

scripts/sync-repo.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ BRANCH=$(echo $BRANCHES | cut -d "," -f 1)
1515
TRACKING_BRANCH=$(echo $BRANCHES | cut -d "," -f 2)
1616

1717
BASE=$(pwd)
18-
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
18+
COMMIT_MESSAGE=$(git log -1 --pretty=%B -- $GLOB)
19+
if [ -z "$COMMIT_MESSAGE" ]; then
20+
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
21+
fi
1922

2023
for folder in $GLOB; do
2124
[ -d "$folder" ] || continue

0 commit comments

Comments
 (0)