From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: Re: [PATCH] Docs: git checkout --orphan: `root commit' and `branch head' Date: Tue, 27 Sep 2011 19:35:49 -0400 Message-ID: <20110927233549.GA10434@sigill.intra.peff.net> References: <7vaa9r2jii.fsf@alter.siamese.dyndns.org> <1317073309.5579.9.camel@centaur.lab.cmartin.tk> <4E81F080.7010905@drmicha.warpmail.net> <7v39fhyk21.fsf@alter.siamese.dyndns.org> <4E823359.7080602@nextest.com> <20110927214213.GC5176@sigill.intra.peff.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Philip Oakley , Eric Raible , Junio C Hamano , Michael J Gruber , Carlos =?utf-8?Q?Mart=C3=ADn?= Nieto , vra5107 , git@vger.kernel.org To: Michael Witten X-From: git-owner@vger.kernel.org Wed Sep 28 01:35:57 2011 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R8hBs-00015H-Ce for gcvg-git-2@lo.gmane.org; Wed, 28 Sep 2011 01:35:56 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753013Ab1I0Xfw (ORCPT ); Tue, 27 Sep 2011 19:35:52 -0400 Received: from 99-108-226-0.lightspeed.iplsin.sbcglobal.net ([99.108.226.0]:45600 "EHLO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172Ab1I0Xfv (ORCPT ); Tue, 27 Sep 2011 19:35:51 -0400 Received: (qmail 29540 invoked by uid 107); 27 Sep 2011 23:40:53 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Tue, 27 Sep 2011 19:40:53 -0400 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Tue, 27 Sep 2011 19:35:49 -0400 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Tue, Sep 27, 2011 at 11:28:14PM +0000, Michael Witten wrote: > With "git commit --no-parent", you would be altering the current > branch head, which means you are potentially leaving as a dangling > commit the commit to which that branch head originally pointed. > I.e., it is about as dangerous as "git reset --hard ", > something for which we do NOT provide any protection. Didn't I already mention that example? And then say that I think the lack of protection there has been the source of a lot of confusion and hardship? Repeating the problems of "git reset" does not seem like a good idea to me. Especially not with a command like "commit", which is usually very safe. That being said, I did say in my last email that one option would be for the documentation to be very clear about leaving the old history dangling. That at least keeps clueless people from stumbling into using the option accidentally. So I'm not saying "we can't do this". I'm saying "this is dangerous, so let's think for a minute about what safety mechanisms we can have". > For instance, what if I want the current branch head to point to that > new root commit? The existing solution requires juggling branch names; > why can't git just do what I tell it to do (as with "git reset")? > After all, "git commit --no-parent" is pretty name explicit. It's explicit if you understand how git works, or what "parent" means. I'm not sure every git user does, these days. -Peff