The Git instructions for creating stable releases ([project name]/git-instructions) currently reads:

git checkout  7.x-1.x
git tag 7.x-1.0
git push -u origin 7.x-1.0

It does not mention that you have to git push --tags.


Tor Arne Thune’s picture


helmo’s picture

Assigned: Unassigned » eliza411

Well, in the Git version I'm using you don't have to.

$ git tag foo
$ git push -u origin foo
Total 0 (delta 0), reused 0 (delta 0)
To ssh://
 * [new tag]         foo -> foo

On the one hand 'git push --tags' is a bit simpler, but could have the side effect of pushing other tags that were not meant to be pushed.

@eliza411: what's your take on this?

eliza411’s picture

Category: bug » task

The command is directing people to push one tag by its name, and I don't think we want to encourage people to push all of their topic branch tags in the way that's being suggested.

There is (and has been) a problem with these instructions, though. They contain a static tag name with no clear indication that it needs to be adjusted for the individual case.

This instruction:
git tag 7.x-1.0
git push -u origin 7.x-1.0
might be more clear if it said:
git tag [name of your tag]
git push origin [name of your tag]

If there's a version of Git or a set of circumstances where pushing a specific tag by its name fails, I'd want to investigate that.

Does the change above adequately address the concern of the original issue?

Tor Arne Thune’s picture

I'll check .bash_history to see if I did anything wrong.

EDIT: Aha, I pushed the branch instead of the tag. My bad.

Tor Arne Thune’s picture

Title: Git instructions for creating stable releases should mention git push --tags » Git instructions for creating stable releases should be more generic

Sorry for the noise on this.

In regard to the suggested change in #3 I think this would help to avoid any misunderstandings. I don't know why I read it as git push -u origin 7.x-1.x, but maybe someone else will do the same, so +1 on the proposed change.

I think some of the confusion was also caused by the -u option to push the tag, as I remember reading the man page for git push before doing anything and thinking "ah, this option is only valid for branches":

-u, --set-upstream
For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch.<name>.merge in git-config(1).

Will this option do anything for pushed tags?

helmo’s picture

As I read it the "-u" option has no benefit when pushing tags.
The funny detail is that the code of this module does NOT contain the "-u". So this seems like a discrepancy between the code and the instructions in the site database. @eliza411 could you verify that?

For reference, the issue about using a static tag name in the example: #1149870: d.o instructions are for 7.x branch regardless of currently selected

webchick’s picture

My concern with the proposal in #3 is that our tag/branch naming conventions are very specific and I worry about people (especially those new to not catching this without a lot of frustrating "Why doesn't my '7-x-1.0' tag let me create a release?!" Having a specific example there to copy/paste/modify is really helpful.

Definitely drop -u though.

eliza411’s picture

Status: Needs review » Needs work

-u removed. I'll look for other ways to add clarity to the tag for release step.

eliza411’s picture

Status: Needs work » Fixed

Marking fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.