git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Another core.safecrlf behavor with git diff/git status
@ 2013-06-24 16:37 Yann Droneaud
  2013-06-24 16:43 ` Yann Droneaud
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yann Droneaud @ 2013-06-24 16:37 UTC (permalink / raw)
  To: git

Hi,

I'm still trying to use .gitattributes "text" flag with CRLF line ending 
files
under Linux.

I'm surprised about the interaction between the index and the working 
directory,
more specificaly about the interaction between git diff and git status:

   $ git init
   Initialized empty Git repository in /home/ydroneaud/tmp/.git/
   $ echo "test text" > .gitattributes
   $ git add .gitattributes
   $ git commit -m ".gitattributes"
   [master (root-commit) 67c2a06] attrib
    1 file changed, 1 insertion(+)
    create mode 100644 .gitattributes
   $ printf "One\r\nLine\r\n" > test
   $ git add test
   warning: CRLF will be replaced by LF in test.
   The file will have its original line endings in your working 
directory.
   $ git commit -m "test"
   [master 8b06aed] test
   warning: CRLF will be replaced by LF in test.
   The file will have its original line endings in your working 
directory.
    1 file changed, 2 insertions(+)
    create mode 100644 test
   $ git diff
   # <git diff report nothing>
   $ touch test
   $ git diff
   warning: CRLF will be replaced by LF in test.
   The file will have its original line endings in your working 
directory.
   $ git diff                                    # <= twice
   warning: CRLF will be replaced by LF in test.
   The file will have its original line endings in your working 
directory.
   $ git status
   # On branch master
   nothing to commit, working directory clean
   $ git diff
   # <git diff report nothing>


- Why git diff does not always report the CRLF/LF mismatch ?

- Why git status does not report about the CRLF/LF mismatch before 
updating the index:
   it silently hide the CRLF/LF warning.
   git add, git commit report the warning. git status should probably do 
the same.

Regards.

-- 
Yann Droneaud
OPTEYA

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

end of thread, other threads:[~2013-06-25  8:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24 16:37 Another core.safecrlf behavor with git diff/git status Yann Droneaud
2013-06-24 16:43 ` Yann Droneaud
2013-06-24 16:55 ` Junio C Hamano
2013-06-25  8:52   ` Yann Droneaud
2013-06-24 17:02 ` Yann Droneaud

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).