git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Michael Witten <mfwitten@gmail.com>
Cc: "Philip Oakley" <philipoakley@iee.org>,
	"Eric Raible" <raible@nextest.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Michael J Gruber" <git@drmicha.warpmail.net>,
	"Carlos Martín Nieto" <cmn@elego.de>,
	vra5107 <venkatram.akkineni@gmail.com>,
	git@vger.kernel.org
Subject: Re: Re: [PATCH] Docs: git checkout --orphan: `root commit' and `branch head'
Date: Tue, 27 Sep 2011 19:35:49 -0400	[thread overview]
Message-ID: <20110927233549.GA10434@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMOZ1BvzWDPQ_e3Y5H8CX4wQwL5xf3xVvZvRL3gQPcB_kCGBbw@mail.gmail.com>

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 <new_root_commit>",
>   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

  reply	other threads:[~2011-09-27 23:35 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-25 14:15 Can a git changeset be created with no parent vra5107
2011-09-25 14:33 ` Andreas Ericsson
2011-09-25 14:33 ` Carlos Martín Nieto
2011-09-26 19:25   ` Junio C Hamano
2011-09-26 21:41     ` Carlos Martín Nieto
2011-09-27 14:43       ` [PATCH] Docs: git checkout --orphan: `root commit' and `branch head' Michael Witten
2011-09-27 15:02         ` Matthieu Moy
2011-09-27 15:46           ` [PATCH v2] " Michael Witten
2011-09-27 16:01             ` Matthieu Moy
2011-09-27 16:13               ` Michael Witten
2011-09-27 16:53                 ` Matthieu Moy
2011-09-27 17:09                   ` Michael Witten
2011-09-27 20:59               ` Philip Oakley
2011-09-28 16:23                 ` [PATCH v3] " Michael Witten
2011-09-28 20:34                   ` Junio C Hamano
2011-09-29 15:52                     ` Michael Witten
2011-09-29 15:44                       ` [PATCH v4] Docs: git checkout --orphan: Copyedit, and s/root commit/orphan branch/ Michael Witten
2011-09-29 16:44                         ` Michael Witten
2011-09-29 20:05                         ` Philip Oakley
2011-09-29 18:11                       ` In favor of "git commit --no-parent" Junio C Hamano
2011-09-29 18:52                         ` Michael Witten
2011-09-29 18:59                         ` [PATCH] Documentation/git-checkout.txt: Explain --orphan without introducing an undefined "orphan branch" Junio C Hamano
2011-09-29 19:02                           ` Michael Witten
2011-09-29 21:02                         ` In favor of "git commit --no-parent" Phil Hord
2011-09-29 21:28                           ` Michael Witten
2011-09-29 21:50                             ` Phil Hord
2011-09-29 22:01                               ` Michael Witten
     [not found]                         ` <CABURp0q8YhTS-GDYOANEa19P-V2wf_EUTo=RHqnhDB619w=y-w@mail.gmail.com>
     [not found]                           ` <7vd3ejrqin.fsf@alter.siamese.dyndns.org>
2011-09-29 21:54                             ` Junio C Hamano
2011-09-29 22:07                               ` Phil Hord
2011-09-29 22:29                                 ` Michael Witten
2011-09-29 22:32                                   ` Michael Witten
2011-09-29 23:08                                 ` Junio C Hamano
2011-09-30  0:51                                   ` Michael Witten
2011-09-30  2:28                                     ` Junio C Hamano
2011-09-29 22:07                               ` Michael Witten
2011-09-27 15:49         ` [PATCH] Docs: git checkout --orphan: `root commit' and `branch head' Michael J Gruber
2011-09-27 16:02           ` Michael Witten
2011-09-27 17:25             ` Junio C Hamano
2011-09-27 17:50               ` Michael Witten
2011-09-27 20:34               ` Eric Raible
2011-09-27 21:31                 ` Philip Oakley
2011-09-27 21:42                   ` Jeff King
2011-09-27 23:28                     ` Michael Witten
2011-09-27 23:35                       ` Jeff King [this message]
2011-09-27 23:44                         ` Michael Witten
2011-09-28  0:32                         ` Junio C Hamano
2011-09-28 13:40                           ` Michael Witten
2011-09-28 13:45                             ` Matthieu Moy
2011-09-28 13:50                               ` Michael Witten
2011-09-28 14:09                                 ` Matthieu Moy
2011-09-28 14:35                                   ` Michael Witten
2011-09-28 14:45                                     ` Matthieu Moy
2011-09-28 15:06                                       ` Michael Witten
2011-09-28 18:17                                   ` Junio C Hamano
2011-09-28  4:04               ` Jay Soffian
2011-09-28  4:37                 ` Michael Witten
2011-09-28  8:00               ` Michael J Gruber

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=20110927233549.GA10434@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=cmn@elego.de \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mfwitten@gmail.com \
    --cc=philipoakley@iee.org \
    --cc=raible@nextest.com \
    --cc=venkatram.akkineni@gmail.com \
    /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).