Skip to content

Commit 3f6dafa

Browse files
committed
Use git archive instead of git clone
Including a git directory in the dist tarball is a convenient trick for easing comparison between the archive and the release tag, but it is not necessary and may be confusing.
1 parent 635a3c6 commit 3f6dafa

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

Makefile

+5-15
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ vsn_rel = $(shell git describe --tags --always --first-parent \
2323
| tail -c +2 \
2424
2>/dev/null)
2525

26-
# Is this a tagged release?
26+
# What is the release tag?
2727
vsn_tag = $(shell git describe --tags --always --first-parent \
2828
| grep -Eo -- '^v[0-9]+\.[0-9]\.[0-9]+(-rc.[0-9]+)?$$' \
29-
| tail -c +2 \
3029
2>/dev/null)
3130

3231
annotator_vsn = $(vsn_rel)
@@ -64,19 +63,10 @@ else
6463
.PHONY: dist
6564
dist:
6665
@rm -rf apache-annotator-$(annotator_vsn)-incubating
67-
@git clone \
68-
--config advice.detachedHead=false \
69-
--config versionsort.suffix=-rc \
70-
--depth 1 \
71-
--no-tags \
72-
--quiet \
73-
file://"$(shell git rev-parse --show-toplevel)" \
74-
apache-annotator-$(annotator_vsn)-incubating
75-
@git --git-dir apache-annotator-$(annotator_vsn)-incubating/.git config \
76-
remote.origin.url https://github.com/apache/incubator-annotator.git
77-
@tar czf \
78-
apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz \
79-
apache-annotator-$(annotator_vsn)-incubating
66+
@git archive \
67+
--output apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz \
68+
--prefix apache-annotator-$(annotator_vsn)-incubating/ \
69+
$(vsn_tag)
8070
@echo "Done: apache-annotator-$(annotator_vsn)$(vsn_pre)-incubating.tar.gz"
8171

8272
endif

0 commit comments

Comments
 (0)