From: Pete Harlan <pgit@pcharlan.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: Johan Herland <johan@herland.net>,
git@vger.kernel.org, SZEDER Gabor <szeder@ira.uka.de>
Subject: Re: Archiving tags/branches?
Date: Mon, 20 Oct 2008 21:08:31 -0700 [thread overview]
Message-ID: <48FD55BF.1020207@pcharlan.com> (raw)
In-Reply-To: <m3prlvibb7.fsf@localhost.localdomain>
Jakub Narebski wrote:
> Pete Harlan <pgit@pcharlan.com> writes:
>
>> Johan Herland wrote:
>
>>> BTW, the best way IMHO to archive old refs is to clone your repo
>>> (with all tags/branches) to a backup disk, and then regularly push
>>> (git push --all && git push --tags) your new tags/branches to this
>>> backup. You are now free to delete these tags/branches from your
>>> work repo (they will not be deleted from the backup unless you use
>>> "git push --mirror"). And if you ever need to retrieve an old
>>> tag/branch, it's just a matter of pulling it from the backup
>>> repo. Nice, clean, flexible, and requires no changes to git.
>> Thank you; that indeed seems to work and solves the problem of managing
>> refs/archived-tags manually.
>>
>> Using a secondary repo solely to overcome a flat tag/branch namespace
>> feels hackish. Perhaps git will benefit someday from work in this area,
>> but until I come up with a patch your suggestion should work fine. Just
>> knowing I didn't overlook an existing feature helps a lot.
>
> I don't quite understand what you mean by _flat_ namespace for tags
> and branches.
>
> First, it is not unusual to have hierarchical branch names, at least
> for short-term topic branches. For example in git.git history (and in
> "What's cooking..." announcements on git mailing list) you can find
> branch names such as rs/alloc-ref, nd/narrow, tr/workflow-doc.
> Additionally remote-tracking branch names have inherently hierarchical
> names: refs/remotes/<remote>/<remote branch>. While tag names usually
> are of the type x.y.z, it is not mandated by some technological
> limitation.
What I mean by "flat" is that "/" is just another character as far as
what git exposes to the user. Regardless of any semantics the user
chooses to assign to it, and regardless of what advantage git makes use
of "/" internally, unless I can do something like:
% git tag --ls
sometag
someothertag
releases/
% git tag --ls releases/
releases/2008/
releases/2007/
% git tag --ls releases/2008
releases/2008/r3.14
%
"/" is just like any another character in a tag or branch.
(The above notional --ls modifier is probably very easy to write, and if
I do so it may address all of my woes. Subversion's branching/tagging
can be organized pretty much exactly like this, and importing into git
such a repository is what initially led me to ask about organizing tags
and branches.)
What I'm usually likely to want from a "list tags" command is to see the
most recent few tags, not (say) all 226 tags in git.git. I'll probably
write a little alias that does that, but even then when looking at the
whole list it would be nice to have the option to navigate it
hierarchically. (Or in some other manner, and/or possibly with a
configurable directory separator.)
> Second, you can always put your archived refs in another namespace,
> beside 'heads', 'tags', and 'remotes'. I for example use
> refs/tags/Attic for lightweigth tags to some interesting abandoned
> experiments, but it could have been refs/deleted/tags, or
> refs/Attic/tags.
My original question was asking whether this sort of thing would work
(e.g., they would never be automatically pruned), and I'm happy to see
that the answer is yes. The main downside to it is that you can't
clone/pull/push changes to it using git.
Many thanks to you and everyone for their help. Git is so flexible that
it can be difficult when starting out to know whether you're missing a
way of attacking a problem.
--Pete
> Last, please remember that there exists something like packed refs
> format (see git-pack-refs(1)... oops, it dies not describe
> .git/packed-refs format, unfortunately).
next prev parent reply other threads:[~2008-10-21 4:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-18 1:43 Archiving tags/branches? Pete Harlan
2008-10-18 2:50 ` David Symonds
2008-10-20 6:14 ` Pete Harlan
2008-10-18 10:23 ` SZEDER Gábor
2008-10-18 11:15 ` Johan Herland
2008-10-18 13:02 ` SZEDER Gábor
2008-10-18 13:32 ` Johan Herland
2008-10-20 6:36 ` Pete Harlan
2008-10-20 7:53 ` Johan Herland
2008-10-21 2:53 ` Pete Harlan
2008-10-20 14:35 ` Jakub Narebski
2008-10-21 4:08 ` Pete Harlan [this message]
2008-10-21 8:15 ` Jakub Narebski
2008-10-21 9:33 ` Pete Harlan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48FD55BF.1020207@pcharlan.com \
--to=pgit@pcharlan.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=johan@herland.net \
--cc=szeder@ira.uka.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).