From: jateeq <jawad_atiq@hotmail.com>
To: git@vger.kernel.org
Subject: How do I get the correct modification status after running git diff?
Date: Thu, 4 Mar 2010 07:40:00 -0800 (PST) [thread overview]
Message-ID: <27782430.post@talk.nabble.com> (raw)
Hello,
I have added a new file to a working repository, and would like to run a
diff between the last commit and whatever is int he working tree, along with
an identification of what kind of a modification it was. Currently, I am
adding all files to the index with the -N option, and then running a git
diff --name-status. This works well for existing files that have been
modified or deleted, but fails if a file is rename or is added. Does anyone
know of the right way to do this? The commands I am using to add and diff
newly added files are as follows in the sequence shown.
Commands:
echo "this is a new file" > file1.xml
git add -N .
git diff --name-status
The output is :
M file1.xml
I want the status to show A for the newly added file (and R for renamed
files but I don't know if that's possible).
Thank You,
Jawad.
--
View this message in context: http://old.nabble.com/How-do-I-get-the-correct-modification-status-after-running-git-diff--tp27782430p27782430.html
Sent from the git mailing list archive at Nabble.com.
next reply other threads:[~2010-03-04 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-04 15:40 jateeq [this message]
2010-03-04 16:11 ` How do I get the correct modification status after running git diff? jateeq
2010-03-04 16:34 ` Michael J Gruber
2010-03-04 16:39 ` Andreas Schwab
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=27782430.post@talk.nabble.com \
--to=jawad_atiq@hotmail.com \
--cc=git@vger.kernel.org \
/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 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).