Re: can I remove or move a tag in a remote repository?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Meyering wrote:

Perhaps I shouldn't push the cvs-head tag at all.

Possibly not, although it's nice to let others that use git to know where you've cut the release.

A few questions:
  - is there a way to say "push all tags matching /COREUTILS-*/"
      or to say "push all tags, except the ones on this list"?


Here's a snippet from the default update hook we use on all our repos. We explicitly deny any non-annotated tags from being pushed to the central server and let rogue devs know why the push failed by writing the error message to stderr so that it gets sent over the wire. I believe this is still the default update-hook shipped with git.
---%<---%<----%<---
ref_type=$(git cat-file -t "$3")

# Only allow annotated tags in a shared repo
# Remove this code to treat dumb tags the same as everything else
case "$1","$ref_type" in
refs/tags/*,commit)
    echo "*** Un-annotated tags are not allowed in this repo" >&2
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
    exit 1;;
---%<---%<---%<---

  - is there a way to remove the cvs-head tag from the remote directory?
      Note: I don't have shell access there.  I can request that someone
      with shell access do it, but shouldn't have to resort to that.
  - is there some way to make "git push" do what I want, and update the
      offending tag in the remote repo?


I'm not sure if execution reaches the update hook when you're uploading a tag that already exists. If it is, you could simply remove the offending tag in the update-hook and exit 0 to make it work properly. You can test this without shell-access on the remote system by setting up a repo on your local machine, making some dummy commit, cloning it and then hacking away on the hook while pushing to it from your local repo.

Other than that, push your tags manually by naming them explicitly on the push-line, like so:
$ git push $remote_repo $tag_name

This is what I do whenever we cut a release. With a one tag per release, it's not very troublesome at all, and the update-hook sends a nicely formatted message of the changes since the last release (last tag really, but it amounts to the same thing for us) to everyone involved.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]