git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* most annoying thing in git-push
@ 2009-06-22 19:21 Alexey I. Froloff
  2009-06-23  5:21 ` ZoltánFüzesi
  2009-06-23  6:08 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Alexey I. Froloff @ 2009-06-22 19:21 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

From git-fetch(1), -n option description: "By default, tags that
point at objects that are downloaded from the remote repository
are fetched and stored locally."

Is is possible to add such functionality to git-push, so it will
push tags that point at objects that were uploaded to the remote
repository?

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: most annoying thing in git-push
  2009-06-22 19:21 most annoying thing in git-push Alexey I. Froloff
@ 2009-06-23  5:21 ` ZoltánFüzesi
  2009-06-23  6:08 ` Junio C Hamano
  1 sibling, 0 replies; 5+ messages in thread
From: ZoltánFüzesi @ 2009-06-23  5:21 UTC (permalink / raw)
  To: git


Alexey I. Froloff <raorn <at> altlinux.org> writes:
> 
> From git-fetch(1), -n option description: "By default, tags that
> point at objects that are downloaded from the remote repository
> are fetched and stored locally."
> 
> Is is possible to add such functionality to git-push, so it will
> push tags that point at objects that were uploaded to the remote
> repository?
> 

Hi,

git-fetch -n does the opposite: "This option disables this automatic tag 
following." I guess you wanted to write git-fetch -t.
git-push --tags will help you, but it's a 2 step push: one for the branches and 
one for the tags. I use .git/config to solve this:

[remote "origin"]
	url = ...
	fetch = +refs/heads/*:refs/remotes/origin/*
	push = +refs/heads/*
	push = +refs/tags/*

With these lines added git-push origin will upload all your branches and tags.
If you want to upload only some of them, you can enumerate them.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: most annoying thing in git-push
  2009-06-22 19:21 most annoying thing in git-push Alexey I. Froloff
  2009-06-23  5:21 ` ZoltánFüzesi
@ 2009-06-23  6:08 ` Junio C Hamano
  2009-06-23  8:12   ` Jakub Narebski
  2009-06-23 15:20   ` Alexey I. Froloff
  1 sibling, 2 replies; 5+ messages in thread
From: Junio C Hamano @ 2009-06-23  6:08 UTC (permalink / raw)
  To: Alexey I. Froloff; +Cc: git

"Alexey I. Froloff" <raorn@altlinux.org> writes:

> Is is possible to add such functionality to git-push, so it will
> push tags that point at objects that were uploaded to the remote
> repository?

I think it is doable, because the protocol is for the receiver to first
advertise all its existing refs, which means that the sender can learn
what is missing by first enumerating the tags it has, subtracting what the
receiver has, and then computing the ones that are missing from the
receiver and are reachable from the commits it is pushing, before the
sender has to respond which refs it wants to update with what object and
then send the packfile to transfer necessary objects.  You do not need to
change the protocol, nor what the receiving side does, to implement it.
You only need to update what the push side does.

It however is entirely a different matter if it is a sensible thing to do.

Often, a fetch is made from a public distribution point, which by
definition has only branches and tags that are meant for public
consumption.  It makes sense to auto-follow tags by default.

On the other hand, a push is almost always made from a private working
repository to a public distribution point, in order to update the latter
with only refs and objects meant for public consumption.  A developer
working in such a private working repository will use tags that are not
meant for public consumption while developing, and pushing all tags that
are reachable from the commits that are being pushed out to the public
distribution point is not necessarily desirable, as it will push out many
tags that are only private to the working repository.

It certainly is not a sensible default behaviour, even though it might be
handy as an option for special cases.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: most annoying thing in git-push
  2009-06-23  6:08 ` Junio C Hamano
@ 2009-06-23  8:12   ` Jakub Narebski
  2009-06-23 15:20   ` Alexey I. Froloff
  1 sibling, 0 replies; 5+ messages in thread
From: Jakub Narebski @ 2009-06-23  8:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alexey I. Froloff, git

Junio C Hamano <gitster@pobox.com> writes:
> "Alexey I. Froloff" <raorn@altlinux.org> writes:
> 
> > Is is possible to add such functionality to git-push, so it will
> > push tags that point at objects that were uploaded to the remote
> > repository?
[...]

> It however is entirely a different matter if it is a sensible thing to do.
> 
> Often, a fetch is made from a public distribution point, which by
> definition has only branches and tags that are meant for public
> consumption.  It makes sense to auto-follow tags by default.
> 
> On the other hand, a push is almost always made from a private working
> repository to a public distribution point, in order to update the latter
> with only refs and objects meant for public consumption.  A developer
> working in such a private working repository will use tags that are not
> meant for public consumption while developing, and pushing all tags that
> are reachable from the commits that are being pushed out to the public
> distribution point is not necessarily desirable, as it will push out many
> tags that are only private to the working repository.
> 
> It certainly is not a sensible default behaviour, even though it might be
> handy as an option for special cases.

Perhaps if "autofollowing" of tags was enabled only for 
annotated/signed tags?

-- 
Jakub Narebski
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: most annoying thing in git-push
  2009-06-23  6:08 ` Junio C Hamano
  2009-06-23  8:12   ` Jakub Narebski
@ 2009-06-23 15:20   ` Alexey I. Froloff
  1 sibling, 0 replies; 5+ messages in thread
From: Alexey I. Froloff @ 2009-06-23 15:20 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

On Mon, Jun 22, 2009 at 11:08:46PM -0700, Junio C Hamano wrote:
> It certainly is not a sensible default behaviour, even though it might be
> handy as an option for special cases.
I would be happy with --please-push-tags-too and push.follow-tags
options (or something similar).

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-23 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 19:21 most annoying thing in git-push Alexey I. Froloff
2009-06-23  5:21 ` ZoltánFüzesi
2009-06-23  6:08 ` Junio C Hamano
2009-06-23  8:12   ` Jakub Narebski
2009-06-23 15:20   ` Alexey I. Froloff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).