git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* stage/commit issue when checking out a branch
@ 2009-05-12 16:01 Peter MacMillan
  2009-05-12 16:38 ` Junio C Hamano
  2009-05-12 16:56 ` [PATCH] Revert "checkout branch: prime cache-tree fully" Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Peter MacMillan @ 2009-05-12 16:01 UTC (permalink / raw)
  To: git

Hello,

I've run into a problem where staging changes, checking out a
different branch, and then commiting results in an empty commit.

Here is a simplified reproduction of the problem:

currently using 1.6.3, verified that it works correctly in git version 1.6.1.3.

New repo:

$ mkdir bug
$ cd bug
$ git init
Initialized empty Git repository in /home/peterm/bug/.git/

New file:

$ echo "Hello" > FILE
$ git add FILE
$ git commit -m "V1"
[master (root-commit) 5aeea22] V1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 FILE

Simple change:

$ echo "Hello, world." > FILE
$ git add FILE

Move to a different branch:

$ git checkout -b branch
M	FILE
Switched to a new branch 'branch'
$ git status
# On branch branch
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   FILE
#

Oh, still on the stage. Great. Commit!

$ git commit -m "V2"
[branch 818175e] V2
$ git show HEAD
commit 818175efc55d2e23871541c5caa2fe771c825b73
Author: Peter MacMillan <peterm@metavera.com>
Date:   Tue May 12 11:38:02 2009 -0400

    V2
$ git status
# On branch branch
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   FILE
#

Guh? A few of us at the office have hit this and it used to work. The
only way to commit the stage is to reset to HEAD, re-add and then
commit.

Thanks for your help,

Peter MacMillan <peterm@metavera.com>

Application Developer, Metavera Solutions Inc.
502-2221 Yonge Street, Toronto, ON, M4S 2B4
416-598-9300 x 27

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-12 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-12 16:01 stage/commit issue when checking out a branch Peter MacMillan
2009-05-12 16:38 ` Junio C Hamano
2009-05-12 16:56 ` [PATCH] Revert "checkout branch: prime cache-tree fully" Junio C Hamano

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).