Skip to content

rewrite tag-release.sh for git #4

@nvcleemp

Description

@nvcleemp

Currently this script works for subversion. It should be rewritten for git.

It should verify that the tag doesn't already exist. Some sample code that could be helpful is this:

#!/bin/bash

set -e #fail on error

tag_already_exists() {
    echo Verifying tag does not exist: "$1"
    if git show-ref --tags --quiet --verify -- "refs/tags/$1"
    then
        echo Git tag "$1" already exists locally....
        return 0
    else
        echo Git tag "$1" does not yet exist....
        return 1
    fi
}

if ! tag_already_exists $2
then
    echo OK
else
    echo Error
fi

or

git ls-remote --tags 2>/dev/null | grep "refs/tags/2013-05-28$"

It should also verify that the current repository is not behind or diverged from the origin. If this is the case, than a pull should be done first. If the current repository is behind, than this is not a problem. Some useful information might be here: http://stackoverflow.com/questions/3258243/git-check-if-pull-needed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions