git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Barkalow <barkalow@iabervon.org>
To: Nicolas Pitre <nico@cam.org>
Cc: Carl Worth <cworth@cworth.org>, git@vger.kernel.org
Subject: Re: Difficulties in advertising a new branch to git newbies
Date: Wed, 31 Jan 2007 11:25:46 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0701311102300.20138@iabervon.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0701310923010.3021@xanadu.home>

On Wed, 31 Jan 2007, Nicolas Pitre wrote:

> On Wed, 31 Jan 2007, Daniel Barkalow wrote:
> 
> > On Tue, 30 Jan 2007, Nicolas Pitre wrote:
> > 
> > > On Tue, 30 Jan 2007, Daniel Barkalow wrote:
> > > 
> > > >   warning: you are now browsing the history without a local branch. You 
> > > >   will not be able to commit changes unless you create a new local branch 
> > > >   with "git checkout -b <new_branch_name>".
> > > 
> > > This isn't true.  You can commit on top of a detached head.  In fact you 
> > > can do almost anything.
> > 
> > "Commits you make will not be attached to permanent state unless you 
> > create a local branch"? I'm not sure how the feature turned out to work, 
> > but I know that (a) you're fine if you don't make any commits and (b) the 
> > behavior is more like what happens with anonymous checkouts of other 
> > people's repositories in non-distributed SCMs, so people will tend to
> > underestimate what they can do with this, rather than overestimating it 
> > and getting into trouble.
> > 
> > I suppose it's reasonable to warn at commit time, if we ended up going 
> > with allowing commits like normal.
> 
> I disagree.
> 
> It is not the commit which is dangerous when the head is detached.  It 
> is the checkout of another branch.  And this case is covered already 
> such that the checkout is refused unless you actually create a branch 
> for your detached head or you give -f to checkout to override the 
> protection.
> 
> Giving a warning at commit time is not the place where the user has to 
> be aware of the issue since it is indeed not the place where there is 
> any issue to worry about.

At commit time, the user is reasonably likely to be doing something 
unintended (at least, it's more likely that the user is doing something 
unintended by committing with a detatched head than that the user is doing 
something unintended by detatching the head). Certainly the only time 
there's any danger of losing work is when the head is detatched and a 
commit has been made since it was set, because otherwise there's either no 
work to lose, or no commits could be becoming unreachable.

I suspect that there will be people from other SCMs who will assume 
they're back on a local branch if the system lets them commit, because 
they would be prohibited from committing on top of an anonymous checkout 
or a historical commit. Of course, they can cherry-pick the misplaced 
commit, so it's not a big deal, but I think it's where a naive user would 
be getting into a state they don't understand.

	-Daniel
*This .sig left intentionally blank*

  parent reply	other threads:[~2007-01-31 16:25 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-30 20:13 Difficulties in advertising a new branch to git newbies Carl Worth
2007-01-30 21:02 ` Jakub Narebski
2007-01-30 21:25   ` Yann Dirson
2007-01-30 21:31     ` Jakub Narebski
2007-01-30 21:32     ` Junio C Hamano
2007-01-30 21:40       ` Jakub Narebski
2007-01-30 22:33 ` Matthias Lederhofer
2007-01-30 22:36   ` Matthias Lederhofer
2007-01-30 23:10 ` Jeff King
2007-01-31  1:34   ` Junio C Hamano
2007-01-31  1:51     ` Nicolas Pitre
2007-01-31  3:22     ` Jeff King
2007-01-31 14:59       ` Nicolas Pitre
2007-01-31 17:07         ` Jeff King
2007-01-31 18:59           ` Nicolas Pitre
2007-01-31 22:53             ` Jeff King
2007-01-31 20:20           ` Junio C Hamano
2007-01-31 22:51             ` Theodore Tso
2007-01-31 23:03               ` Junio C Hamano
2007-01-31 23:18               ` Jakub Narebski
2007-01-31  1:48   ` Nicolas Pitre
2007-01-31  0:10 ` Daniel Barkalow
2007-01-31  1:55   ` Nicolas Pitre
2007-01-31  5:09     ` Daniel Barkalow
2007-01-31 14:31       ` Nicolas Pitre
2007-01-31 14:38         ` J. Bruce Fields
2007-01-31 14:53           ` Jakub Narebski
2007-01-31 15:15             ` Nicolas Pitre
2007-01-31 16:25         ` Daniel Barkalow [this message]
2007-01-31 18:25           ` Nicolas Pitre
2007-01-31 13:13 ` Guilhem Bonnefille
2007-01-31 16:06   ` Carl Worth
2007-01-31 16:15     ` Johannes Schindelin
2007-01-31 19:27 ` Santi Béjar
2007-01-31 19:50   ` Carl Worth
2007-02-01  0:20     ` Josef Weidendorfer
2007-02-01  9:02       ` Santi Béjar
2007-02-01  4:12 ` Jakub Narebski
2007-02-06  5:51 ` Carl Worth
2007-02-06  6:37   ` Junio C Hamano
2007-02-06  7:25     ` Junio C Hamano
2007-02-06  7:31       ` Jeff King
2007-02-06 18:53     ` Carl Worth
2007-02-06 19:14       ` Junio C Hamano
2007-02-06 19:39         ` Carl Worth
2007-02-06 19:58           ` Jakub Narebski
2007-02-06  7:28   ` Jeff King
2007-02-06  7:46     ` Junio C Hamano
2007-02-06  8:12       ` Jeff King
2007-02-06 15:33     ` Nicolas Pitre

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=Pine.LNX.4.64.0701311102300.20138@iabervon.org \
    --to=barkalow@iabervon.org \
    --cc=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    /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).