On 2014-08-22 09:45-0400 Hazen Babcock wrote:

> On 8/21/2014 8:48 PM, Alan W. Irwin wrote:
>> So we were all in agreement that storage (in a file) of the SHA1 id of
>> the HEAD commits from each branch to be deleted would be enough to
>> guarantee branch resurrection, but it turns out that is incorrect.
>> Further reading shows that git automatically garbage collects
>> (deletes) all "unreachable" commits after a suitable default period
>> (usually 90 days, I think).  So there are lots of warnings in the
>> results for google searching for the terms <git resurrect branch> that
>> the techniques only work for a while until garbage collection occurs.
>
> Hm, that is my take on this as well. I agree that if we want to preserve the 
> branches then we'll need to tag them. Buried in the comments to the first 
> answer to this question is an explanation of how to push the tags to the 
> remote repository:
>
> http://stackoverflow.com/questions/2342821/git-branch-deletion

Thank goodness for stackoverflow.  What a great response that deals
with essentially all questions we have had about this issue.

>
> If you are really worried about history preservation then you should also 
> implement a server side hook to prevent tag deletion.

I think it is an excellent idea to do everything we can to preserve our
development history.  Accordingly, I have now modified the update hook 
appropriately and
put it under git control (see latest push of ffada3a).  I have tested
that logic with a "play" bare server repo and a local working directory
repo that uses the bare one as a remote.  For that case,

git push --tags

works for propagating new local tags to the official repo (consistent
with the stackoverflow answer). And it
nicely errors out if you attempt to reuse an old tag for a different
commit.  i.e.,

git tag -f <oldtagname> <newcommit ID>
git push --tags

However, "git push --tags" completely ignores locally deleted
tags (one of a number of arcane things about git that are difficult to
understand).  In order to
attempt to propagate tag deletes to the server you need to run instead
the alternative syntax

git push --delete origin <tagname>

The current update hook obligingly errors out in that case as well.
So all seems well with its logic, but by all means try it yourself
for your own play repos.

I have just now propagated this new version to the correct part
of the SF repo using the following two commands.

ssh airwin,plp...@shell.sourceforge.net create

(wait for a few minutes until it responds with the
message that your shell access is ready to go [for the
next 4 hours]).

software@raven> scp \
/home/software/plplot_svn/HEAD/plplot.git/git_hooks/update \
airwin,plp...@shell.sourceforge.net:/home/git/p/plplot/plplot.git/hooks

If anything screws up with that update logic, i.e., any of us are
getting error messages from attempting to make a legit push that include
no invalid tag deletes, tag reuses, or merge commits, then one of us will
need to adjust the logic in git_hooks/update, push it so others can
see the change that has been made, and do the equivalent two commands
above to deploy/activate it.

If you have time, and now that I have made it impossible for tags to
be deleted/reused for our SF repo, then I would appreciate you
following up by taking responsibility for the safe branch deletion of
all the svn-generated branches other than master.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to