git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Strange line ending issue

From
JZJie Zhang <jzhang918@gmail.com>
Date
Oct 31, 2012, 16:37 UTC
Message-ID
<CACYR8yPuZTSWAq=xxAZE6oD==fCB6opgqeYr_VH8s3hrYgOZwQ@mail.gmail.com>
Hi,

I have a strange line ending issue with git. I'm not sure if it's a bug or not. But it's really strange. Below are the steps to reproduce what I saw:

1. $ git clone ssh://anonymous@firewall-sources.blackfin.uclinux.org:443/git/readonly-mirrors/toolchain.git
   $ cd toolchain
2. $ git status
# On branch trunk
nothing to commit, working directory clean
3. $ rm -rf libusb/msvc/libusb.dsw
4. $ git checkout libusb/msvc/libusb.dsw
5. $ git status
# On branch trunk
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   libusb/msvc/libusb.dsw
#
no changes added to commit (use "git add" and/or "git commit -a")
6. $ git reset --hard
7. $ git status
# On branch trunk
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    modified:   libusb/msvc/libusb.dsw
#
no changes added to commit (use "git add" and/or "git commit -a")
8. libusb.dsw is in DOS format. I changed CR-LF to CR-CR-LF in
libusb.dsw with a tool I modified from dos2unix.
9. $ git status
# On branch trunk
nothing to commit, working directory clean

I tested with git 1.7.10.4 from Debian and git 1.8.0 built by myself. Both have same result.

Thank you.
Jie
Message 1 of 1 in “Strange line ending issue”
  1. Jie ZhangOct 31, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.