git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git commit behaving strangely
@ 2010-07-21  2:28 Zeeshan Qureshi
  2010-07-21  3:06 ` Jonathan Nieder
  0 siblings, 1 reply; 5+ messages in thread
From: Zeeshan Qureshi @ 2010-07-21  2:28 UTC (permalink / raw)
  To: git

Hello,

I am new to git and was going through gittutorial-2 when i noticed 
something weird.

1. I first create a file file.txt with some text and committed it.
2. I create a file called closing.txt with some text and committed it.
3. then i added 1 new line to both closing.txt and file.txt
4. i added the file closing.txt to the staging are by running 'git add 
closing.txt'
5. now i ran 'git checkout' (by mistake)
6. Now i run 'git diff --cached' (which should show the changes i have 
in the index), the output is this

diff --git a/closing.txt b/closing.txt
index da55920..953ec3a 100644
--- a/closing.txt
+++ b/closing.txt
@@ -1 +1,2 @@
  closing
+again?

7. Now when i run 'git commit -m "closing again"', the change is not 
committed even though i get a new commit id.

The output of 'git log -p' is this (as you can clearly see, there are 
new commits but no change has been recorded)

commit 7dbe9a272c58decc08f9fd5ce07efd5bf28d89f8
Author: Zeeshan Qureshi <{email}>
Date:   Tue Jul 20 15:36:05 2010 -0400

     closing again

commit 1bfda310eb82e62925b28d62e98097d6fbd61620
Author: Zeeshan Qureshi <{email}>
Date:   Tue Jul 20 15:34:46 2010 -0400

     closing again

commit 3d0e35717bea56adbc7c578b3b17db3657e30040
Author: Zeeshan Qureshi <{email}>
Date:   Tue Jul 20 15:33:40 2010 -0400

     closing

diff --git a/closing.txt b/closing.txt
new file mode 100644
index 0000000..da55920
--- /dev/null
+++ b/closing.txt
@@ -0,0 +1 @@
+closing

commit 2a0a0e4edb1810b6e31b0739bd7736d1360e6d13
Author: Zeeshan Qureshi <{email}>
Date:   Tue Jul 20 15:32:13 2010 -0400

     initial commit

diff --git a/file.txt b/file.txt
new file mode 100644
index 0000000..3b18e51
--- /dev/null
+++ b/file.txt
@@ -0,0 +1 @@
+hello world


-- 
Zeeshan Qureshi
zeeshan@zqureshi.in

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

* Re: Git commit behaving strangely
  2010-07-21  2:28 Git commit behaving strangely Zeeshan Qureshi
@ 2010-07-21  3:06 ` Jonathan Nieder
  2010-07-21  4:01   ` Zeeshan Qureshi
       [not found]   ` <AANLkTikYoNEQpotpfdVci4WSUc1GMNnM9y0OqXJb7Fzu@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Nieder @ 2010-07-21  3:06 UTC (permalink / raw)
  To: Zeeshan Qureshi; +Cc: git

Hi Zeeshan,

Zeeshan Qureshi wrote:

> 3. then i added 1 new line to both closing.txt and file.txt
> 4. i added the file closing.txt to the staging are by running 'git
> add closing.txt'
> 5. now i ran 'git checkout' (by mistake)
[...]
> 7. Now when i run 'git commit -m "closing again"', the change is not
> committed even though i get a new commit id.
> 
> The output of 'git log -p' is this (as you can clearly see, there
> are new commits but no change has been recorded)

Strange.  I tried to reproduce this but I got different results
(the new commit includes in a change to closing.txt).  What am
I doing wrong?

 git init repo
 cd repo

 echo 'hello world' >file.txt
 git add .
 git commit -m 'Initial version of repo, a test repository'

 echo closing >closing.txt
 git add closing.txt
 git commit -m 'Goodbye, all'

 echo 'hi!' >>file.txt
 echo 'again?' >>closing.txt
 git add closing.txt

 git checkout
 git diff --cached

 git commit -m 'closing again'
 git log -p

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

* Re: Git commit behaving strangely
  2010-07-21  3:06 ` Jonathan Nieder
@ 2010-07-21  4:01   ` Zeeshan Qureshi
       [not found]   ` <AANLkTikYoNEQpotpfdVci4WSUc1GMNnM9y0OqXJb7Fzu@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Zeeshan Qureshi @ 2010-07-21  4:01 UTC (permalink / raw)
  To: git

Hello Jonathan,

The problem seems to be with the Blastwave git package (it 1.6.x) on Solaris.

I tried reproducing it on 2 different linux machines (both running git
1.7) and I couldn't reproduce it.

I will do it again when I get to work tomorrow (i don't have remote
access to the workstation) and post the results.

Thanks,
Zeeshan

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

* Re: Git commit behaving strangely
       [not found]     ` <20100721050558.GA15273@burratino>
@ 2010-07-22 13:48       ` Zeeshan Qureshi
  2010-07-22 16:28         ` Jonathan Nieder
  0 siblings, 1 reply; 5+ messages in thread
From: Zeeshan Qureshi @ 2010-07-22 13:48 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git

Hello Jonathan,

On Wed, Jul 21, 2010 at 1:05 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Zeeshan Qureshi wrote:
>
>> I will do it again when I get to work tomorrow (i don't have remote access
>> to the workstation) and post the results.
>
> Sounds good.  Thanks for looking into it.
>
> Jonathan
>

I did the test again on the Solaris machine, and encountered the same problem.

I am on a Sun Blade 1500 machine running Solaris 10.
Zeeshan

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

* Re: Git commit behaving strangely
  2010-07-22 13:48       ` Zeeshan Qureshi
@ 2010-07-22 16:28         ` Jonathan Nieder
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Nieder @ 2010-07-22 16:28 UTC (permalink / raw)
  To: Zeeshan Qureshi; +Cc: git

Zeeshan Qureshi wrote:
>>>> Zeeshan Qureshi wrote:

>>>>> 3. then i added 1 new line to both closing.txt and file.txt
>>>>> 4. i added the file closing.txt to the staging are by running 'git
>>>>> add closing.txt'
>>>>> 5. now i ran 'git checkout' (by mistake)
[...]
>>>>> 7. Now when i run 'git commit -m "closing again"', the change is not
>>>>> committed even though i get a new commit id.
>>>>> 
>>>>> The output of 'git log -p' is this (as you can clearly see, there
>>>>> are new commits but no change has been recorded)
[...]
> I did the test again on the Solaris machine, and encountered the same problem.
> 
> I am on a Sun Blade 1500 machine running Solaris 10.

Since this seems to be hard to replicate without blastwave, I would suggest
reporting it through the blastwave forum.

Thanks, and good luck.

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

end of thread, other threads:[~2010-07-22 16:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-21  2:28 Git commit behaving strangely Zeeshan Qureshi
2010-07-21  3:06 ` Jonathan Nieder
2010-07-21  4:01   ` Zeeshan Qureshi
     [not found]   ` <AANLkTikYoNEQpotpfdVci4WSUc1GMNnM9y0OqXJb7Fzu@mail.gmail.com>
     [not found]     ` <20100721050558.GA15273@burratino>
2010-07-22 13:48       ` Zeeshan Qureshi
2010-07-22 16:28         ` Jonathan Nieder

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