Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Wed, Jan 26, 2011 at 17:37, Andrew Dunstan and...@dunslane.net 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-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 11:13 AM, Magnus Hagander mag...@hagander.net wrote: On Wed, Jan 26, 2011 at 17:37, Andrew Dunstan and...@dunslane.net 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.

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Wed, Jan 26, 2011 at 17:37, Andrew Dunstan and...@dunslane.net 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

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

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Thu, Jan 27, 2011 at 17:36, Andrew Dunstan and...@dunslane.net 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

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 and...@dunslane.net 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 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

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian br...@momjian.us 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

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 br...@momjian.us 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 Tom Lane
Andrew Dunstan and...@dunslane.net 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

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Kevin Grittner
Bruce Momjian br...@momjian.us 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

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Bruce Momjian
Tom Lane wrote: Andrew Dunstan and...@dunslane.net 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

Re: [HACKERS] Caution when removing git branches

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

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. And

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Magnus Hagander
On Thu, Jan 27, 2011 at 18:19, Robert Haas robertmh...@gmail.com wrote: On Thu, Jan 27, 2011 at 11:52 AM, Bruce Momjian br...@momjian.us wrote: Robert Haas wrote: On Thu, Jan 27, 2011 at 11:41 AM, Bruce Momjian br...@momjian.us wrote: Or for that we could just disable branch creation

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Kevin Grittner
Robert Haas robertmh...@gmail.com 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

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 12:24 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: Robert Haas robertmh...@gmail.com 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

Re: [HACKERS] Caution when removing git branches

2011-01-27 Thread Robert Haas
On Thu, Jan 27, 2011 at 12:22 PM, Bruce Momjian br...@momjian.us 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

Re: [HACKERS] Caution when removing git branches

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

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 people, so

[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

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 believe that

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.

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 repository

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Robert Haas
On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian br...@momjian.us 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

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 I don't

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 br...@momjian.us 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

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Robert Haas
On Wed, Jan 26, 2011 at 11:49 AM, Bruce Momjian br...@momjian.us wrote: Robert Haas wrote: On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian br...@momjian.us 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 Bruce Momjian
Robert Haas wrote: On Wed, Jan 26, 2011 at 11:49 AM, Bruce Momjian br...@momjian.us wrote: Robert Haas wrote: On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian br...@momjian.us wrote: For those of you using git, I wanted to point out that it is fairly easy to remove git branches. ?For

Re: [HACKERS] Caution when removing git branches

2011-01-26 Thread Robert Haas
On Wed, Jan 26, 2011 at 12:07 PM, Bruce Momjian br...@momjian.us wrote: Robert Haas wrote: On Wed, Jan 26, 2011 at 11:49 AM, Bruce Momjian br...@momjian.us wrote: Robert Haas wrote: On Wed, Jan 26, 2011 at 11:26 AM, Bruce Momjian br...@momjian.us wrote: For those of you using git, I