Skip to content

Commit 292a10f

Browse files
committed
tag-git: access the bare git.git repository via --git-dir
The `-C` method still works, but will (hopefully) soon be disabled by default, by flipping the default of the `safe.bareDirectory` config setting. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 8974cb1 commit 292a10f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

update-scripts/tag-git.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ die "Need the current branch in '$build_extra_dir' to be '$release_branch'"
3131
mkdir -p "$artifacts_dir" &&
3232
if test -n "$snapshot_version"
3333
then
34-
tag_name="$(git -C "$git_git_dir" describe --match 'v[0-9]*' --exclude='*-[0-9]*' "$git_rev")-$(date +%Y%m%d%H%M%S)" &&
34+
tag_name="$(git --git-dir "$git_git_dir" describe --match 'v[0-9]*' --exclude='*-[0-9]*' "$git_rev")-$(date +%Y%m%d%H%M%S)" &&
3535
tag_message="Snapshot build" &&
36-
release_note="Snapshot of $(git -C "$git_git_dir" show -s --pretty='tformat:%h (%s, %ad)' --date=short "$git_rev")" &&
36+
release_note="Snapshot of $(git --git-dir "$git_git_dir" show -s --pretty='tformat:%h (%s, %ad)' --date=short "$git_rev")" &&
3737
(cd "$build_extra_dir" && node ./add-release-note.js --commit feature "$release_note") &&
3838
display_version=${tag_name#v} &&
3939
ver=prerelease-${tag_name#v}
@@ -43,7 +43,7 @@ else
4343
die "Need 'w3m' to render release notes"
4444
fi
4545

46-
desc="$(git -C "$git_git_dir" describe --match 'v[0-9]*[0-9]' --exclude='*-[0-9]*' --first-parent "$git_rev")" &&
46+
desc="$(git --git-dir "$git_git_dir" describe --match 'v[0-9]*[0-9]' --exclude='*-[0-9]*' --first-parent "$git_rev")" &&
4747
base_tag=${desc%%-[1-9]*} &&
4848
case "$base_tag" in
4949
"$desc") die "Revision '$git_rev' already tagged as $base_tag";;
@@ -141,9 +141,9 @@ echo "$ver" >"$artifacts_dir"/ver &&
141141
echo "$display_version" >"$artifacts_dir"/display_version &&
142142
echo "$tag_name" >"$artifacts_dir"/next_version &&
143143
echo "$tag_message" >"$artifacts_dir"/tag-message &&
144-
git -C "$git_git_dir" rev-parse --verify "$git_rev"^0 >"$artifacts_dir"/git-commit-oid &&
144+
git --git-dir "$git_git_dir" rev-parse --verify "$git_rev"^0 >"$artifacts_dir"/git-commit-oid &&
145145

146-
git -C "$git_git_dir" tag $(test -z "$GPGKEY" || echo " -s") -m "$tag_message" "$tag_name" "$git_rev" &&
147-
git -C "$git_git_dir" bundle create "$artifacts_dir"/git.bundle origin/$release_branch.."$tag_name" &&
146+
git --git-dir "$git_git_dir" tag $(test -z "$GPGKEY" || echo " -s") -m "$tag_message" "$tag_name" "$git_rev" &&
147+
git --git-dir "$git_git_dir" bundle create "$artifacts_dir"/git.bundle origin/$release_branch.."$tag_name" &&
148148

149149
git -C "$build_extra_dir" bundle create "$artifacts_dir"/build-extra.bundle origin/$release_branch..$release_branch

0 commit comments

Comments
 (0)