Thread (10 messages) flat view 10 messages, 6 authors, 2016-06-15

Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:47:33

On Wed, 14 Oct 2009, Jay Soffian wrote:
On Wed, Oct 14, 2009 at 12:44 AM, Daniel Barkalow [off-list ref] wrote:
quoted
 $ git commit
 You've been sightseeing "origin/master". The commit can't change that
 value, so your commit isn't held in any branch. If you want to create
 a branch to hold it, here's how.

"git checkout origin/master" should be similar in complexity to
"svn checkout -r 8655"; the difference is that svn won't let you
commit then and git will but you'll need to understand the
implications if you do so. If you don't commit (because you don't want
to make any changes, because you don't think it would be possible, or
because you don't want to worry about what would happen), there's no
meaningful difference, and you don't need to be told.
Huh, I hadn't seen this message before I wrote in a reply to
"builtin-checkout: suggest creating local branch" that we do the
following at commit, which I think is what you're suggesting:

$ git commit -m "blah"
Cannot commit while not on any branch. Please use git commit -b <branch> to
specify the name of a new branch to commit to, or use git commit -f to
force a detached commit.
The difference is that some experienced users depend on being able to 
commit while not on a branch, and want to not get a warning for every 
commit while not on a branch.
I'm not sure that requires the complexity of remembering how the user
got detached though?
What matters there is actually whether we got to the present state by 
committing or not. It's also relevant to telling the user what they've got 
checked out that isn't a branch.

	-Daniel
*This .sif left intentionally blank*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help