public void CreateGitTag()

in scbuild/scbuild.cs [808:849]


    public void CreateGitTag( string tagName )
    {
        // Our code still used 'label' in many places, as that is the tag concept in Source Depot
        if( !m_option_release || m_option_no_tag )
        {
            return;
        }

        if( m_option_ignore_sync )
        {
            Print( "Label creation disabled while any -i option is used\n" );
            return;
        }

        string [] res;
        res = RunCmd( "", "git tag -a -m \"Creation of "+ tagName + ".cab\" " + tagName );

        if( res.Length != 0 )
        {
            Fatal("Unexpected output from tag command");
        }

        res = RunCmd("", "git tag -l " + tagName);
        if( res.Length != 1 || !Regex.IsMatch( res[0], tagName) )
        {
            Fatal("Could not verify that tag was properly created");
        }

        bool pushOk = false;
        res = RunCmd( "", "git push origin " + tagName );
        foreach( string line in res )
        {
            if( Regex.IsMatch( line, "new tag.*" + tagName ))
            {
                pushOk = true;
            }
        }
        if( !pushOk )
        {
            Fatal( "Could not verify that tag was pushed to remote" );
        }
    }