Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Chris Browne
and...@dunslane.net (Andrew Dunstan) writes: > On 01/27/2011 11:29 AM, Tom Lane wrote: >> Given that nobody is supposed to push temporary branches to the master >> repo anyway, an intended branch removal should be a pretty darn rare >> event. Now, our committers all seem to be pretty careful peopl

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Thu, Jan 27, 2011 at 17:52, Bruce Momjian wrote: > Robert Haas wrote: >> On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian wrote: >> >> Or for that we could just disable branch creation *completely*, and >> >> then turn off that restriction that one time / year that we actually >> >> create a br

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 12:22 PM, Bruce Momjian wrote: > Robert Haas wrote: >> The master branch can be removed the same as any other one - just >> substitute master in place of REL9_0_STABLE in the above commands. >> But why would you do such a nutty thing?  Worst case scenario looks to >> me lik

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 12:24 PM, Kevin Grittner wrote: > Robert Haas wrote: > >> So if someone does this (which does not look at all likely to me): >> >> git push origin :REL9_0_STABLE >> git branch -r -D origin/REL9_0_STABLE >> git branch -d REL9_0_STABLE >> >> ...then, yes, they will need to f

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Kevin Grittner
Robert Haas wrote: > So if someone does this (which does not look at all likely to me): > > git push origin :REL9_0_STABLE > git branch -r -D origin/REL9_0_STABLE > git branch -d REL9_0_STABLE > > ...then, yes, they will need to find someone who has run 'git > pull' since the last change that

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Thu, Jan 27, 2011 at 18:19, Robert Haas wrote: > On Thu, Jan 27, 2011 at 11:52 AM, Bruce Momjian wrote: >> Robert Haas wrote: >>> On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian wrote: >>> >> Or for that we could just disable branch creation *completely*, and >>> >> then turn off that restric

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Bruce Momjian
Robert Haas wrote: > The master branch can be removed the same as any other one - just > substitute master in place of REL9_0_STABLE in the above commands. > But why would you do such a nutty thing? Worst case scenario looks to > me like you type the first of those commands and then go "oh crud".

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 11:52 AM, Bruce Momjian wrote: > Robert Haas wrote: >> On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian wrote: >> >> Or for that we could just disable branch creation *completely*, and >> >> then turn off that restriction that one time / year that we actually >> >> create a

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Bruce Momjian
Tom Lane wrote: > Andrew Dunstan writes: > > On 01/27/2011 11:29 AM, Tom Lane wrote: > >> Given that nobody is supposed to push temporary branches to the master > >> repo anyway, an intended branch removal should be a pretty darn rare > >> event. > > > Pushing a local topic branch by mistake seem

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Kevin Grittner
Bruce Momjian wrote: > OK, someone removes a branch. As was explained earlier on this thread, it's not gone at that point; it's a dangling reference. I think that unless someone explicitly "prunes" the dangling references, they are left around for a week, and can easily be checked out again.

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Tom Lane
Andrew Dunstan writes: > On 01/27/2011 11:29 AM, Tom Lane wrote: >> Given that nobody is supposed to push temporary branches to the master >> repo anyway, an intended branch removal should be a pretty darn rare >> event. > Pushing a local topic branch by mistake seems much more likely to me. Ye

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Bruce Momjian
Robert Haas wrote: > On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian wrote: > >> Or for that we could just disable branch creation *completely*, and > >> then turn off that restriction that one time / year that we actually > >> create a branch? > > > > Well, branch creation can always be undone --

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian wrote: >> Or for that we could just disable branch creation *completely*, and >> then turn off that restriction that one time / year that we actually >> create a branch? > > Well, branch creation can always be undone --- branch removal seems like > t

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Heikki Linnakangas
On 27.01.2011 18:41, Bruce Momjian wrote: Well, branch creation can always be undone --- branch removal seems like the big problem because it can't. Actually, all you need to do is to push the branch back to resurrect it. As long as your local branch is up-to-date with what was removed (or you

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Bruce Momjian
Magnus Hagander wrote: > On Thu, Jan 27, 2011 at 17:36, Andrew Dunstan wrote: > > > > > > On 01/27/2011 11:29 AM, Tom Lane wrote: > >> > >> Given that nobody is supposed to push temporary branches to the master > >> repo anyway, an intended branch removal should be a pretty darn rare > >> event. ?

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Thu, Jan 27, 2011 at 17:36, Andrew Dunstan wrote: > > > On 01/27/2011 11:29 AM, Tom Lane wrote: >> >> Given that nobody is supposed to push temporary branches to the master >> repo anyway, an intended branch removal should be a pretty darn rare >> event.  Now, our committers all seem to be pret

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Andrew Dunstan
On 01/27/2011 11:29 AM, Tom Lane wrote: Given that nobody is supposed to push temporary branches to the master repo anyway, an intended branch removal should be a pretty darn rare event. Now, our committers all seem to be pretty careful people, so I don't feel strongly about having extra secur

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Tom Lane
Magnus Hagander writes: > On Wed, Jan 26, 2011 at 17:37, Andrew Dunstan wrote: >> I thought we had some hooks on gitmaster to help prevent accidents like >> inadvertent branch deletion. > We have hooks to prevent a number of things, but not the removal of > branches (or tags). We'll send an emai

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 11:13 AM, Magnus Hagander wrote: > On Wed, Jan 26, 2011 at 17:37, Andrew Dunstan wrote: >> >> >> On 01/26/2011 11:26 AM, Bruce Momjian wrote: >>> >>> For those of you using git, I wanted to point out that it is fairly easy >>> to remove git branches.  For example, I can ea

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Wed, Jan 26, 2011 at 17:37, Andrew Dunstan wrote: > > > On 01/26/2011 11:26 AM, Bruce Momjian wrote: >> >> For those of you using git, I wanted to point out that it is fairly easy >> to remove git branches.  For example, I can easily remove a branch on >> my github repository using: >> >>      

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Robert Haas
On Wed, Jan 26, 2011 at 12:07 PM, Bruce Momjian wrote: > Robert Haas wrote: >> On Wed, Jan 26, 2011 at 11:49 AM, Bruce Momjian wrote: >> > Robert Haas wrote: >> >> On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian wrote: >> >> > For those of you using git, I wanted to point out that it is fairly e

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Bruce Momjian
Robert Haas wrote: > On Wed, Jan 26, 2011 at 11:49 AM, Bruce Momjian wrote: > > Robert Haas wrote: > >> On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian wrote: > >> > For those of you using git, I wanted to point out that it is fairly easy > >> > to remove git branches. ?For example, I can easily

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Robert Haas
On Wed, Jan 26, 2011 at 11:49 AM, Bruce Momjian wrote: > Robert Haas wrote: >> On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian wrote: >> > For those of you using git, I wanted to point out that it is fairly easy >> > to remove git branches. ?For example, I can easily remove a branch on >> > my gi

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Bruce Momjian
Robert Haas wrote: > On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian wrote: > > For those of you using git, I wanted to point out that it is fairly easy > > to remove git branches. ?For example, I can easily remove a branch on > > my github repository using: > > > > ? ? ? ?$ git branch -d :branch_

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Bruce Momjian
Andrew Dunstan wrote: > > > On 01/26/2011 11:26 AM, Bruce Momjian wrote: > > For those of you using git, I wanted to point out that it is fairly easy > > to remove git branches. For example, I can easily remove a branch on > > my github repository using: > > > > $ git branch -d :branch_name

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Robert Haas
On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian wrote: > For those of you using git, I wanted to point out that it is fairly easy > to remove git branches.  For example, I can easily remove a branch on > my github repository using: > >        $ git branch -d :branch_name > > I don't believe that i

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Bruce Momjian
Martijn van Oosterhout wrote: -- Start of PGP signed section. > On Wed, Jan 26, 2011 at 11:26:04AM -0500, Bruce Momjian wrote: > > For those of you using git, I wanted to point out that it is fairly easy > > to remove git branches. For example, I can easily remove a branch on > > my github reposit

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Andrew Dunstan
On 01/26/2011 11:26 AM, Bruce Momjian wrote: For those of you using git, I wanted to point out that it is fairly easy to remove git branches. For example, I can easily remove a branch on my github repository using: $ git branch -d :branch_name I don't believe that is revertable. Wha

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Martijn van Oosterhout
On Wed, Jan 26, 2011 at 11:26:04AM -0500, Bruce Momjian wrote: > For those of you using git, I wanted to point out that it is fairly easy > to remove git branches. For example, I can easily remove a branch on > my github repository using: > > $ git branch -d :branch_name > > I don't believ

[HACKERS] Caution when removing git branches

2011-01-26 Thread Bruce Momjian
For those of you using git, I wanted to point out that it is fairly easy to remove git branches. For example, I can easily remove a branch on my github repository using: $ git branch -d :branch_name I don't believe that is revertable. What is scarey is that this could be done on our 'or