{"thread":{"id":"24453","subject":"Git commit behaving strangely","startedAt":"2010-07-21T02:28:04Z","lastAt":"2010-07-22T16:28:55Z","messageCount":5,"participants":["Zeeshan Qureshi","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145924","messageId":"4C465B34.2040407@zqureshi.in","threadId":"24453","inReplyTo":null,"subject":"Git commit behaving strangely","fromName":"Zeeshan Qureshi","fromEmail":"zeeshan@zqureshi.in","sentAt":"2010-07-21T02:28:04Z","receivedAt":"2010-07-21T02:28:04Z","isPatch":false,"sender":{"key":"zeeshan@zqureshi.in","avatar":null},"body":"Hello,\n\nI am new to git and was going through gittutorial-2 when i noticed \nsomething weird.\n\n1. I first create a file file.txt with some text and committed it.\n2. I create a file called closing.txt with some text and committed it.\n3. then i added 1 new line to both closing.txt and file.txt\n4. i added the file closing.txt to the staging are by running 'git add \nclosing.txt'\n5. now i ran 'git checkout' (by mistake)\n6. Now i run 'git diff --cached' (which should show the changes i have \nin the index), the output is this\n\ndiff --git a/closing.txt b/closing.txt\nindex da55920..953ec3a 100644\n--- a/closing.txt\n+++ b/closing.txt\n@@ -1 +1,2 @@\n  closing\n+again?\n\n7. Now when i run 'git commit -m \"closing again\"', the change is not \ncommitted even though i get a new commit id.\n\nThe output of 'git log -p' is this (as you can clearly see, there are \nnew commits but no change has been recorded)\n\ncommit 7dbe9a272c58decc08f9fd5ce07efd5bf28d89f8\nAuthor: Zeeshan Qureshi <{email}>\nDate:   Tue Jul 20 15:36:05 2010 -0400\n\n     closing again\n\ncommit 1bfda310eb82e62925b28d62e98097d6fbd61620\nAuthor: Zeeshan Qureshi <{email}>\nDate:   Tue Jul 20 15:34:46 2010 -0400\n\n     closing again\n\ncommit 3d0e35717bea56adbc7c578b3b17db3657e30040\nAuthor: Zeeshan Qureshi <{email}>\nDate:   Tue Jul 20 15:33:40 2010 -0400\n\n     closing\n\ndiff --git a/closing.txt b/closing.txt\nnew file mode 100644\nindex 0000000..da55920\n--- /dev/null\n+++ b/closing.txt\n@@ -0,0 +1 @@\n+closing\n\ncommit 2a0a0e4edb1810b6e31b0739bd7736d1360e6d13\nAuthor: Zeeshan Qureshi <{email}>\nDate:   Tue Jul 20 15:32:13 2010 -0400\n\n     initial commit\n\ndiff --git a/file.txt b/file.txt\nnew file mode 100644\nindex 0000000..3b18e51\n--- /dev/null\n+++ b/file.txt\n@@ -0,0 +1 @@\n+hello world\n\n\n-- \nZeeshan Qureshi\nzeeshan@zqureshi.in\n"},{"id":"145925","messageId":"20100721030608.GA25992@burratino","threadId":"24453","inReplyTo":"4C465B34.2040407@zqureshi.in","subject":"Re: Git commit behaving strangely","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-21T03:06:09Z","receivedAt":"2010-07-21T03:06:09Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Zeeshan,\n\nZeeshan Qureshi wrote:\n\n> 3. then i added 1 new line to both closing.txt and file.txt\n> 4. i added the file closing.txt to the staging are by running 'git\n> add closing.txt'\n> 5. now i ran 'git checkout' (by mistake)\n[...]\n> 7. Now when i run 'git commit -m \"closing again\"', the change is not\n> committed even though i get a new commit id.\n> \n> The output of 'git log -p' is this (as you can clearly see, there\n> are new commits but no change has been recorded)\n\nStrange.  I tried to reproduce this but I got different results\n(the new commit includes in a change to closing.txt).  What am\nI doing wrong?\n\n git init repo\n cd repo\n\n echo 'hello world' >file.txt\n git add .\n git commit -m 'Initial version of repo, a test repository'\n\n echo closing >closing.txt\n git add closing.txt\n git commit -m 'Goodbye, all'\n\n echo 'hi!' >>file.txt\n echo 'again?' >>closing.txt\n git add closing.txt\n\n git checkout\n git diff --cached\n\n git commit -m 'closing again'\n git log -p\n"},{"id":"145926","messageId":"AANLkTin9cGW77iqXR63XPmJkft_RXjw5nLkdmUNIjgmA@mail.gmail.com","threadId":"24453","inReplyTo":"20100721030608.GA25992@burratino","subject":"Re: Git commit behaving strangely","fromName":"Zeeshan Qureshi","fromEmail":"zeeshan@zqureshi.in","sentAt":"2010-07-21T04:01:10Z","receivedAt":"2010-07-21T04:01:10Z","isPatch":false,"sender":{"key":"zeeshan@zqureshi.in","avatar":null},"body":"Hello Jonathan,\n\nThe problem seems to be with the Blastwave git package (it 1.6.x) on Solaris.\n\nI tried reproducing it on 2 different linux machines (both running git\n1.7) and I couldn't reproduce it.\n\nI will do it again when I get to work tomorrow (i don't have remote\naccess to the workstation) and post the results.\n\nThanks,\nZeeshan\n"},{"id":"145995","messageId":"AANLkTimbeDz_9PPOXBg2FU05Mnba2an-BkK99ye1glDL@mail.gmail.com","threadId":"24453","inReplyTo":"20100721050558.GA15273@burratino","subject":"Re: Git commit behaving strangely","fromName":"Zeeshan Qureshi","fromEmail":"zeeshan@zqureshi.in","sentAt":"2010-07-22T13:48:39Z","receivedAt":"2010-07-22T13:48:39Z","isPatch":false,"sender":{"key":"zeeshan@zqureshi.in","avatar":null},"body":"Hello Jonathan,\n\nOn Wed, Jul 21, 2010 at 1:05 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Zeeshan Qureshi wrote:\n>\n>> I will do it again when I get to work tomorrow (i don't have remote access\n>> to the workstation) and post the results.\n>\n> Sounds good.  Thanks for looking into it.\n>\n> Jonathan\n>\n\nI did the test again on the Solaris machine, and encountered the same problem.\n\nI am on a Sun Blade 1500 machine running Solaris 10.\nZeeshan\n"},{"id":"145997","messageId":"20100722162855.GA2206@burratino","threadId":"24453","inReplyTo":"AANLkTimbeDz_9PPOXBg2FU05Mnba2an-BkK99ye1glDL@mail.gmail.com","subject":"Re: Git commit behaving strangely","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-22T16:28:55Z","receivedAt":"2010-07-22T16:28:55Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Zeeshan Qureshi wrote:\n>>>> Zeeshan Qureshi wrote:\n\n>>>>> 3. then i added 1 new line to both closing.txt and file.txt\n>>>>> 4. i added the file closing.txt to the staging are by running 'git\n>>>>> add closing.txt'\n>>>>> 5. now i ran 'git checkout' (by mistake)\n[...]\n>>>>> 7. Now when i run 'git commit -m \"closing again\"', the change is not\n>>>>> committed even though i get a new commit id.\n>>>>> \n>>>>> The output of 'git log -p' is this (as you can clearly see, there\n>>>>> are new commits but no change has been recorded)\n[...]\n> I did the test again on the Solaris machine, and encountered the same problem.\n> \n> I am on a Sun Blade 1500 machine running Solaris 10.\n\nSince this seems to be hard to replicate without blastwave, I would suggest\nreporting it through the blastwave forum.\n\nThanks, and good luck.\n"}]}