git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Tags from each remote in a separate "name-space"?
@ 2019-02-28  5:54 Sergey Organov
  2019-02-28  8:11 ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Organov @ 2019-02-28  5:54 UTC (permalink / raw)
  To: git

Hello,

How do I configure git to handle tags from remotes in a manner similar
to branches?

Specifically, I want tag 'tag_name' from remote 'origin' to have local
name 'origin/tag_name', not 'tag_name', as it is by default. For a repo
with a lot of remotes[*] it would allow to keep track of what tag came from
where, as well as prevent name conflicts between tags from different
remotes (and/or local tags).

Fetch-only solution ('fetch', 'pull', and 'remote update' support only)
would do, though push support would be interesting to have as well, so
that, say

$ git push origin/tag_name

works as

$ git push origin origin/tag_name:refs/tags/tag_name

Am I dreaming, or is it already supported?

[*] I ran into it managing Linux kernel sources for different ARM
architectures. Mainstream Linux plus stable Linux plus 2 vendor-specific
remotes plus 3 our local remotes made a mess of various tags in the
repository.

-- Sergey

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

* Re: Tags from each remote in a separate "name-space"?
  2019-02-28  5:54 Tags from each remote in a separate "name-space"? Sergey Organov
@ 2019-02-28  8:11 ` Duy Nguyen
  2019-03-01 14:51   ` Sergey Organov
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2019-02-28  8:11 UTC (permalink / raw)
  To: Sergey Organov; +Cc: git

On Thu, Feb 28, 2019 at 08:54:23AM +0300, Sergey Organov wrote:
> Hello,
> 
> How do I configure git to handle tags from remotes in a manner similar
> to branches?
> 
> Specifically, I want tag 'tag_name' from remote 'origin' to have local
> name 'origin/tag_name', not 'tag_name', as it is by default. For a repo
> with a lot of remotes[*] it would allow to keep track of what tag came from
> where, as well as prevent name conflicts between tags from different
> remotes (and/or local tags).

On the fetch side, something like this in the config file (assuming
"origin" remote here) probably would do

[remote "origin"]
	fetch = +refs/tags/*:refs/tags/origin/*
	tagOpt = --no-tags

I'm not so sure about the push side.

PS. it would be nice if "git remote" has --no-shared-tags option or
something to do this, assuming that it works perfectly well.
--
Duy

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

* Re: Tags from each remote in a separate "name-space"?
  2019-02-28  8:11 ` Duy Nguyen
@ 2019-03-01 14:51   ` Sergey Organov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Organov @ 2019-03-01 14:51 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: git

Duy Nguyen <pclouds@gmail.com> writes:
> On Thu, Feb 28, 2019 at 08:54:23AM +0300, Sergey Organov wrote:
>> Hello,
>> 
>> How do I configure git to handle tags from remotes in a manner similar
>> to branches?
>> 
>> Specifically, I want tag 'tag_name' from remote 'origin' to have local
>> name 'origin/tag_name', not 'tag_name', as it is by default. For a repo
>> with a lot of remotes[*] it would allow to keep track of what tag came from
>> where, as well as prevent name conflicts between tags from different
>> remotes (and/or local tags).
>
> On the fetch side, something like this in the config file (assuming
> "origin" remote here) probably would do
>
> [remote "origin"]
> 	fetch = +refs/tags/*:refs/tags/origin/*
> 	tagOpt = --no-tags

Thanks for the clue, Duy!

Just adding

	fetch = +refs/tags/*:refs/tags/origin/*

for each existing remote configuration seems to do the trick indeed.

Now I wonder if it would make sense to implement something like

  $ git remote add --separate-tags ...

to be able to auto-configure this.

-- 
Sergey

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

end of thread, other threads:[~2019-03-01 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28  5:54 Tags from each remote in a separate "name-space"? Sergey Organov
2019-02-28  8:11 ` Duy Nguyen
2019-03-01 14:51   ` Sergey Organov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).