-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Annoted tags are needed for "git describe". Try to replicate the header of "osc vc" by using date.
- Loading branch information
Showing
1 changed file
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,9 @@ currentversion=$(sed -r -n "s/^version: *($format)\$/\1/ p" $config) | |
files=$(sed -r -n 's/^files: *(([-_./a-zA-Z0-9]+ *)+)/\1/ p' $config) | ||
changes=$(sed -r -n 's/^changesfile: *(([-_./a-zA-Z0-9]+ *)+)/\1/ p' $config) | ||
tagprefix=$(sed -r -n 's/^tagprefix: *(([-_./a-zA-Z0-9]+ *)+)/\1/ p' $config) | ||
changestemplate="/tmp/XXXX-suse-xsl-version" | ||
changes_header="-------------------------------------------------------------------" | ||
changes_user="[email protected]" | ||
|
||
if [[ $1 == '' ]]; then | ||
currentversion=$(sed -r -n 's/^version: *(.+)$/\1/ p' $config) | ||
|
@@ -68,9 +71,16 @@ else | |
fi | ||
echo -n "Open changes file for editing? [y]/n " | ||
read DECISION | ||
|
||
if [[ ! $DECISION == 'n' ]] && [[ ! $DECISION == 'no' ]]; then | ||
EDITOR=${EDITOR:-vi} | ||
$EDITOR $changes | ||
TMPFILE=$(mktemp $changestemplate) | ||
TMPFILE2=$(mktemp $changestemplate) | ||
echo -e $changes_header > $TMPFILE | ||
DATE=$(LANG=C TZ=UTC date '+%A %b %d %T %Z %Y' | awk '{$1=substr($1,1,3); print $0}') | ||
echo -e "$DATE - $changes_user\n\n" >> $TMPFILE | ||
${EDITOR:-vi} $TMPFILE | ||
cat $TMPFILE $changes > $TMPFILE2 && mv $TMPFILE2 $changes | ||
|
||
else | ||
echo "(kay) Using changes as-is." | ||
fi | ||
|
@@ -83,7 +93,10 @@ if [[ ! $DECISION == 'y' ]] && [[ ! $DECISION == 'yes' ]]; then | |
echo "Rerun this script with --finalize to finish." | ||
exit | ||
else | ||
git commit -m "Set version to $bumpedversion" $files $changes $config | ||
git tag "$tagprefix$bumpedversion" | ||
COMMITMESSAGE="Set version to $bumpedversion" | ||
sed -i '1d' $TMPFILE | ||
git commit -m "$COMMITMESSAGE" $files $changes $config | ||
git tag -a "$tagprefix$bumpedversion" -m "$COMMITMESSAGE" | ||
echo -e "(hey) Do not forget:\n git push && git push $(git remote | head -1) $tagprefix$bumpedversion" | ||
rm $TMPFILE 2>/dev/null || true | ||
fi |