All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Zeeshan Qureshi <zeeshan@zqureshi.in>
Cc: git@vger.kernel.org
Subject: Re: Git commit behaving strangely
Date: Tue, 20 Jul 2010 22:06:09 -0500	[thread overview]
Message-ID: <20100721030608.GA25992@burratino> (raw)
In-Reply-To: <4C465B34.2040407@zqureshi.in>

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

  reply	other threads:[~2010-07-21  3:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21  2:28 Git commit behaving strangely Zeeshan Qureshi
2010-07-21  3:06 ` Jonathan Nieder [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100721030608.GA25992@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=zeeshan@zqureshi.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.