# Pushing a single tag (ref + object)?

4 messages from 2005-10-19 to 2005-10-19. Participants: Martin Langhoff, Linus Torvalds, Junio C Hamano.
Thread: https://gitlist.dev/t/2143

## Martin Langhoff, 2005-10-19 06:05

Subject: Pushing a single tag (ref + object)?
Message-ID: <46a038f90510182305j1fa2c4bh6d2b36c2fdd058ce@mail.gmail.com>
URL: https://gitlist.dev/e/46a038f90510182305j1fa2c4bh6d2b36c2fdd058ce%40mail.gmail.com
In-Reply-To: <46a038f90510131929m3dac4cc5y6071550e9e9c71ad@mail.gmail.com>

```
While we are using a repo which holds all our branches
(dev/test/prod), locally we have a group of developers that checkout
one repo-per-branch, working on it with a
cg-clone/cg-update/cg-commit/cg-push workcycle. So far it's working
great.

Now, I am at a loss on how to push a _tag_ object+ref to the repo,
without doing a git-push --all, which I naturally don't want to do. I
managed to push the object itself, doing

    git-push repository tagrefname

But that ddn't create the ref on the repo. So I had to do

    scp .git/refs/tags/refname repostory/refs/tags/

I'm feeling a tad lost here. Surely there's a way? Or should I be
crafting a patch against git-push-script? Problem is, git-push script
doesn't do any parsing of the params. Grmbl.


martin

```

## Linus Torvalds, 2005-10-19 14:13

Subject: Re: Pushing a single tag (ref + object)?
Message-ID: <Pine.LNX.4.64.0510190702360.3369@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0510190702360.3369%40g5.osdl.org
In-Reply-To: <46a038f90510182305j1fa2c4bh6d2b36c2fdd058ce@mail.gmail.com>

```


On Wed, 19 Oct 2005, Martin Langhoff wrote:
> 
> Now, I am at a loss on how to push a _tag_ object+ref to the repo,
> without doing a git-push --all, which I naturally don't want to do. I
> managed to push the object itself, doing
> 
>     git-push repository tagrefname

This really should work. 

Can you try with

	git-send-pack repository tagname

first? 

If that works for you (it really really should, since that's what I do all 
the time), then the problem is in "get_remote_refs_for_push"..

Oh. Looking at "git-push.sh", I think it is just really really buggy.

It does all this magic to set "x", but then it never uses it, and uses 
"$@" instead after all. Which it has shifted all away. 

How does that thing work at all? Me, I've always used the raw 
git-send-pack program, so I've never tested it, but obviously others are 
using it.

		Linus

```

## Junio C Hamano, 2005-10-19 16:58

Subject: Re: Pushing a single tag (ref + object)?
Message-ID: <7vvezt8mvv.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vvezt8mvv.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.64.0510190702360.3369@g5.osdl.org>

```
Linus Torvalds <torvalds@osdl.org> writes:

> It does all this magic to set "x", but then it never uses it, and uses 
> "$@" instead after all. Which it has shifted all away. 

Your /bin/sh scripting is rotting ;-) That is not a variable.
If you saw the script actually used the value 'x' then you have
spotted a bug.

That 'x' is not a magic but an old idiom to protect 'set' from
getting confused by "$1" that happens to begin with a '-'.
Setting random things is done by "set x random things"
immediately followed by shifting that x away.

```

## Linus Torvalds, 2005-10-19 20:23

Subject: Re: Pushing a single tag (ref + object)?
Message-ID: <Pine.LNX.4.64.0510191319320.3369@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0510191319320.3369%40g5.osdl.org
In-Reply-To: <7vvezt8mvv.fsf@assigned-by-dhcp.cox.net>

```


On Wed, 19 Oct 2005, Junio C Hamano wrote:
> 
> Your /bin/sh scripting is rotting ;-) That is not a variable.

Ahh. No. My /bin/sh scripting just has never been that good to begin with, 
since there's little reason to do so inside the kernel ;)

I literally didn't understand what "set" does. Thx. man-pages to the 
rescue.

		Linus

```
