login
Header Space

 
 

Re: Difficulties in advertising a new branch to git newbies

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nicolas Pitre <nico@...>
Cc: Junio C Hamano <junkio@...>, <cworth@...>, <git@...>
Date: Wednesday, January 31, 2007 - 1:07 pm

On Wed, Jan 31, 2007 at 09:59:08AM -0500, Nicolas Pitre wrote:


Sure, the dangerous thing is moving away. But my point is there are many
steps leading up to that, and we can warn at any one. However, the
warning is _most_ useful as close to the dangerous thing as possible
(ideally, we would warn when doing the actual dangerous thing, but IIRC,
there was some complexity with that).

IOW, here's a rough flow chart of states and user actions:
         checkout non-branch          commit, etc
(1) regular  ---------> (2) detached,  --------> (3) detached,
         ^                  no commits                commits
         |  checkout branch |  checkout old branch     /\
          \-----------------<--------------------------  |
                                                         |  checkout
                                                         | new branch
                                                         v
                                                   (4) new regular branch

Hopefully my ASCII art skillz are coherent enough. The actual
"dangerous" thing here is moving from 3 to 1. We can theoretically warn
at any transition. Right now we warn moving from 1 to 2. But a large
number of users are just going to go right back to 1, never even doing
anything dangerous! For them, the warning is confusing. I'm proposing
warning between 2 and 3. I would also be happy with warning (and
probably blocking without -f) moving from 3 to 1, which is the actual
dangerous thing. However, I think putting a warning between 2 and 3 is
reasonable, because the next step the user will make from 3 is either
moving to 1 (dangerous) or to 4 (ok), and they must use the correct
git-checkout invocation. So basically, it's our last chance (besides the
actual git-checkout itself) to warn them.


What is so special about it? My argument is that it is not really very
special _until you make commits_. Are there other operations which we
should be warning people about if they have a detached head?


I think you are proving my point here. If you think warning at commit
time is too early, then how is warning _before_ that (when we detach)
not too early?


Agreed.


Again, I don't understand why the state is special (aside from the
possibility of losing commits).

-Peff
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Difficulties in advertising a new branch to git newbies, Josef Weidendorfer, (Wed Jan 31, 8:20 pm)
Re: Difficulties in advertising a new branch to git newbies, Guilhem Bonnefille, (Wed Jan 31, 9:13 am)
Re: Difficulties in advertising a new branch to git newbies, Johannes Schindelin, (Wed Jan 31, 12:15 pm)
Re: Difficulties in advertising a new branch to git newbies, Daniel Barkalow, (Tue Jan 30, 8:10 pm)
Re: Difficulties in advertising a new branch to git newbies, Daniel Barkalow, (Wed Jan 31, 1:09 am)
Re: Difficulties in advertising a new branch to git newbies, Daniel Barkalow, (Wed Jan 31, 12:25 pm)
Re: Difficulties in advertising a new branch to git newbies, J. Bruce Fields, (Wed Jan 31, 10:38 am)
Re: Difficulties in advertising a new branch to git newbies, Jeff King, (Wed Jan 31, 1:07 pm)
Re: Difficulties in advertising a new branch to git newbies, Matthias Lederhofer, (Tue Jan 30, 6:33 pm)
Re: Difficulties in advertising a new branch to git newbies, Matthias Lederhofer, (Tue Jan 30, 6:36 pm)
speck-geostationary