Re: [RFC] Detached-HEAD reminder on commit?
- From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
- Date
- Sep 2, 2008, 19:43 UTC
- Message-ID
- <200809022143.33294.robin.rosenberg.lists@dewire.com>
- In-Reply-To
- <1220383905-48316-1-git-send-email-pdebie@ai.rug.nl>
tisdagen den 2 september 2008 21.31.45 skrev Pieter de Bie:
Show 16 quoted lines
> Sometimes I work on a detached HEAD and then forget about it. If I then create > some commits and checkout another branch, I have to dig through my reflog to > find the older commits. I know that "git commit" adds has a "Not currently on > any branch", but it's not very noticeable and also doesn't work when you > specify a commit message on the command line. > > I suggest to add some extra output to the STDOUT after a commit if we're on a > detached HEAD. The quick patch below adds output like: > > Vienna:git pieter$ ./git commit --allow-empty -m"test" > Created commit 6ce62c8b: test > You are on a detached head, so this commit has not been recorded in a branch. > If you don't want to lose this commit, checkout a branch and then run: > git merge 6ce62c8bfcfb341106f3587d1c141c3955c2544c > > Are there any comments to this / strong opinions against such a change?
Probably doesn't hurt, but I think you should enable the git prompt. That will give you notice before committing.
-- robin