threads / rfc / 16388

[RFC] On how to manage tags fetched from remote?

Subject: [RFC] On how to manage tags fetched from remote?

## tl;dr

4 messages between Nov 19, 2008 and Nov 19, 2008.

replies: 3people: 3as markdown or json

rae l· Nov 19, 2008, 02:27 UTC · lore
The application field:
I use one git working tree to track many remote git repository:
 $ git remote -v
 227-archives	ssh://192.168.3.227/vmos/linux-with-dm-patches.git
 block	git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
 btrfs	git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
 cryptodev	git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
 djbw-md	git://git.kernel.org/pub/scm/linux/kernel/git/djbw/md.git
 dk-block	git://git.kernel.dk/linux-2.6-block
 fastboot	git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
 gfs2-2.6-nmw	git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw.git
 linux-2.6-stable	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6-stable.git
 linux-2.6-target	git://git.kernel.org/pub/scm/linux/kernel/git/tomo/linux-2.6-target.git
 linux-iscsi	git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
 linux-mm-trees	git://git.kernel.org/pub/scm/linux/kernel/git/smurf/linux-trees.git
 linux-nfs-server	git://git.linux-nfs.org/projects/bfields/linux.git
 lio-core-2.6	git://git.kernel.org/pub/scm/linux/kernel/git/nab/lio-core-2.6.git
 ocfs2	git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git
 origin	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
 rostedt-rt	git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-rt.git
 staging	git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
 tj-misc	git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git
 tytso-ext4	git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
 utrace	git://git.kernel.org/pub/scm/linux/kernel/git/frob/utrace.git
 v16.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.16.y.git
 v21.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.21.y.git
 v22.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.22.y.git
 v23.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.23.y.git
 v24.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.24.y.git
 v25.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.25.y.git
 v26.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.26.y.git
 v27.y	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.27.y.git
 xfs	git://oss.sgi.com:8090/xfs/xfs-2.6.git
Among them only 227-archives is where I will push to, others are all fetch only,
When I want to update, I just issue a "git remote -v update" command,

I'd like tags from origin, and from the stable kernel team, those tags are all named well, like v2.6.27, v2.6.27.1, v2.6.28-rc1, ...

But some tags from some other developeres are named bad, some tags named origin, or named block, which will be ambigous when I want to refer a local remote name.

Asking every developer to delete their ambigous tag name is very troublesome!

The problem is because tags have no namespace, not similar to remote branches have namespaces which I named for the remote. Like this command: "git branch -a":

  master
  my-test
  block/bfq
  block/blktrace
  block/cmdfilter
  block/dynpipe
  block/fcache
  block/for-linus
  djbw-md/for-neil
  ...

The local branch have no namespace, while remote branches all have their remote name first.

One solution to avoid the ambigous names is that give tags namespaces, too; But then a tag will not be a simple tag anymore;

Another approach is not fetching tags from remotes which have ambigous tag names; the current git implementation will need I run "git fetch -n <remote>" many times, I cannot use just one "git remote -v update";

To achieve one "git remote -v update", there are two approaches, too:
1. Bypassing any switches or other arguments after "git remote udpate"
directly to git fetch,
  then "git remote update -n" will call "git fetch -n";
  But this will disable all tags in all remotes;
2. Store a no-tags config item to the remote config, which like:
  [remote "linux-iscsi"]
	url = git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
	fetch = +refs/heads/*:refs/remotes/linux-iscsi/*
	fetch-tags = false
  when git fetch read the no-tags config, it will disable tags from this remote;
I think the last approach is the best, and most feasible;
However, please comment. Thanks.
-- 
Cheng Renquan, Shenzhen, China
Steven Wright  - "Cross country skiing is great if you live in a small country."
Junio C Hamano· Nov 19, 2008, 02:43 UTC · re: rae l · lore

Re: [RFC] On how to manage tags fetched from remote?

"rae l" <crquan@gmail.com> writes:
Show 8 quoted lines
> I use one git working tree to track many remote git repository:
> ...
> 2. Store a no-tags config item to the remote config, which like:
>   [remote "linux-iscsi"]
> 	url = git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
> 	fetch = +refs/heads/*:refs/remotes/linux-iscsi/*
> 	fetch-tags = false
>   when git fetch read the no-tags config, it will disable tags from this remote;

Slurping very many (possibly unrelated) projects into one repository is your choice (I wouldn't comment if it is a sane choice -- I do not have time to ponder the pros and cons. If it suits your needs, that's good enough) If you do not want tags from some repositories but do want from some others copied to that repository, per remote configuration feature is exactly how it was designed to be used.

rae l· Nov 19, 2008, 04:03 UTC · re: Junio C Hamano · lore

Re: [RFC] On how to manage tags fetched from remote?

On Wed, Nov 19, 2008 at 10:43 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Slurping very many (possibly unrelated) projects into one repository is

No. They are all kernel development related. You know the linux kernel has many subsystem, from http://git.kernel.org/, hundreds of repos, most are kernel development related. Every subsystem has a single maintainer git repository, with linus's git repos is the center, So if one want to track the kernel development, he needs to track many repo.

The kernel is in developing at a very high speed, so always complex and different than other projbects.

Show 5 quoted lines
> your choice (I wouldn't comment if it is a sane choice -- I do not have
> time to ponder the pros and cons.  If it suits your needs, that's good
> enough) If you do not want tags from some repositories but do want from
> some others copied to that repository, per remote configuration feature is
> exactly how it was designed to be used.
I think this is a good idea for me and I will implement it. Thanks for review.
-- 
Cheng Renquan, Shenzhen, China
Lily Tomlin  - "The trouble with the rat race is that even if you win,
you're still a rat."
Kalle Olavi Niemitalo· Nov 19, 2008, 07:50 UTC · re: rae l · lore

Re: [RFC] On how to manage tags fetched from remote?

"rae l" <crquan@gmail.com> writes:
Show 6 quoted lines
> 2. Store a no-tags config item to the remote config, which like:
>   [remote "linux-iscsi"]
> 	url = git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
> 	fetch = +refs/heads/*:refs/remotes/linux-iscsi/*
> 	fetch-tags = false
>   when git fetch read the no-tags config, it will disable tags from this remote;
A config option like that already exists.  I am using:
[remote "git.debian.org"]
	url = git://git.debian.org/git/collab-maint/elinks.git
	fetch = +refs/heads/*:refs/remotes/git.debian.org/*
	fetch = refs/tags/*:refs/tags/git.debian.org/*
	tagopt = --no-tags

So I have e.g. a ref called refs/tags/git.debian.org/orig-0.11.4 that points to a tag object that says "tag orig-0.11.4". I hope git fsck will never be changed to complain about that.

← back to recent threads