git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-push [--all] and tags
@ 2007-10-06 16:05 martin f krafft
  2007-10-07  1:02 ` Sam Vilain
  0 siblings, 1 reply; 5+ messages in thread
From: martin f krafft @ 2007-10-06 16:05 UTC (permalink / raw)
  To: git discussion list

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

Hello people,

`git-push --all --tags` does not work because git-push ends up
calling git-send-pack --all refs/tags/*, which the latter does not
deal with.

Looking at the code, it seems that previously, --all would push
everything, not just refs/heads/*. What's the reason that this was
changed? Why aren't tags considered part of --all?

If I wanted to fix this, so that --all pushes heads and --all --tags
pushes heads and tags, I could do so in two ways:

  1. instead of --all, pass refs/heads/* to git-send-pack
  2. add --tags to git-send-pack

which of these two would you prefer and why?

Thanks,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"imagine if every thursday your shoes exploded if you
 tied them the usual way. this happens to us all the time
 with computers, and nobody thinks of complaining."
                                                        -- jeff raskin
 
spamtraps: madduck.bogus@madduck.net

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: git-push [--all] and tags
  2007-10-06 16:05 git-push [--all] and tags martin f krafft
@ 2007-10-07  1:02 ` Sam Vilain
  2007-10-07  1:26   ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Vilain @ 2007-10-07  1:02 UTC (permalink / raw)
  To: martin f krafft; +Cc: git discussion list

martin f krafft wrote:
> Hello people,
>
> `git-push --all --tags` does not work because git-push ends up
> calling git-send-pack --all refs/tags/*, which the latter does not
> deal with.
>
> Looking at the code, it seems that previously, --all would push
> everything, not just refs/heads/*. What's the reason that this was
> changed? Why aren't tags considered part of --all?
>
> If I wanted to fix this, so that --all pushes heads and --all --tags
> pushes heads and tags, I could do so in two ways:
>
>   1. instead of --all, pass refs/heads/* to git-send-pack
>   2. add --tags to git-send-pack
>
> which of these two would you prefer and why?
>   

Think is, pushing tags is considered to be something that needs to be
done very explicitly; the convention, after all, is that published tags
are forever.  Whereas branches change all the time.  So, pushing tags
should require an extra flag.

Sam.

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

* Re: git-push [--all] and tags
  2007-10-07  1:02 ` Sam Vilain
@ 2007-10-07  1:26   ` Linus Torvalds
  2007-10-07  9:36     ` martin f krafft
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2007-10-07  1:26 UTC (permalink / raw)
  To: Sam Vilain; +Cc: martin f krafft, git discussion list



On Sun, 7 Oct 2007, Sam Vilain wrote:
>
> Think is, pushing tags is considered to be something that needs to be
> done very explicitly; the convention, after all, is that published tags
> are forever.  Whereas branches change all the time.  So, pushing tags
> should require an extra flag.

Well, I agrewe with Martin, and I think you missed his point.

Sure, pushing tags should require you to say so explicitly, but right now 
you cannot (for example) push *both* the common branches *and* tags 
easily.

You can do

	git push

to push common branches, and you can do

	git push --tags

to push tags, but there's no way to say "push both the common branches 
_and_ all tags".

(And the same is true of "--all" and "--tags").

So I do think Martin is right. I think we should:

 - make sure that "--all --tags" DTRT, namely send all branches and all 
   tags. Right now they are actually very similar things (one works on 
   "refs/heads", while the other works on "refs/tags"), but they are 
   implemented using *totally* different logic, and they don't work 
   together.

 - I think it would be a good idea to implement a "--shared" flag, which 
   is the current default behavior when there are no command line flags, 
   and there are no listed branches to push in the config file. That would 
   allow doing "git push --shared --tags" to update shared branches _and_ 
   tags, but it would probably *also* make it easier to explain the 
   default behaviour of "git push", by making the behavior more explicit.

   (IOW, you can introduce the notion of "--shared updates all branches 
   that exists both locally and remotely under the same names" separately 
   early on as a command line option, and then later just explain that if 
   there is nothing else telling git what to push, it will default to 
   that shared branch behavior)

Hmm? I do agree with "git push" as it now stands has a lot of warts, 
although I don't really agree with the people who want to change the 
default behavior.

			Linus

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

* Re: git-push [--all] and tags
  2007-10-07  1:26   ` Linus Torvalds
@ 2007-10-07  9:36     ` martin f krafft
  2007-10-07 16:39       ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: martin f krafft @ 2007-10-07  9:36 UTC (permalink / raw)
  To: git discussion list; +Cc: Linus Torvalds, Sam Vilain

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

also sprach Linus Torvalds <torvalds@linux-foundation.org> [2007.10.07.0226 +0100]:
> Well, I agrewe with Martin, and I think you missed his point.

(he did)

> Hmm? I do agree with "git push" as it now stands has a lot of warts, 
> although I don't really agree with the people who want to change the 
> default behavior.

So am I right if I say that all the logic should really be happening
in send-pack and that push is really just an interface when it comes
to selecting the refs to push, so it should basically feed through
the options and refs, meaning that send-pack should get --tags and
--shared as well?

Or should push enumerate all refs needed and pass them directly to
send-pack, effectively making send-pack's --all option obsolete?

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"time flies like an arrow. fruit flies like a banana."
                                                       -- groucho marx
(panda eats shoots and leaves)
 
spamtraps: madduck.bogus@madduck.net

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: git-push [--all] and tags
  2007-10-07  9:36     ` martin f krafft
@ 2007-10-07 16:39       ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2007-10-07 16:39 UTC (permalink / raw)
  To: martin f krafft; +Cc: git discussion list, Sam Vilain



On Sun, 7 Oct 2007, martin f krafft wrote:
> 
> So am I right if I say that all the logic should really be happening
> in send-pack and that push is really just an interface when it comes
> to selecting the refs to push, so it should basically feed through
> the options and refs, meaning that send-pack should get --tags and
> --shared as well?

I really don't have any strong personal opinions. I don't think anybody is 
ever supposed to use send-pack directly, so I don't think it really much 
matters whether send-pack is taught to do all the helper options too, or 
whether it should just get the list of refs..

But yes, I suspect it would be cleanest to just remove the "expand --tags" 
logic from builtin-push, and make the actual sending side do that.

> Or should push enumerate all refs needed and pass them directly to
> send-pack, effectively making send-pack's --all option obsolete?

I don't think this works very well - builtin-push doesn't even know what 
the remote branches _are_, so it cannot list "these branches are shared". 
So we'd always have to have that shared behaviour embedded in send-pack 
anyway, so I think the most logical thing is to also do the logic for 
--all and --tags there.

IOW, builtin-push would just be a wrapper around send-pack, doing the 
"for each remote" thing, but just passing down all/tags/shared.

		Linus

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

end of thread, other threads:[~2007-10-07 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-06 16:05 git-push [--all] and tags martin f krafft
2007-10-07  1:02 ` Sam Vilain
2007-10-07  1:26   ` Linus Torvalds
2007-10-07  9:36     ` martin f krafft
2007-10-07 16:39       ` Linus Torvalds

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).