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

Re: Incorrect and inconsistent End-Of-Line characters in .gitmodules after "git submodule set-branch --branch <branch_name>"

From
Torsten B��gershausen <tboegi@web.de>
Date
Jul 17, 2021, 17:05 UTC
Message-ID
<20210717170536.x2n443dtejk76wfp@tb-raspi4>
In-Reply-To
<CANt7McFAu5gAFcgd+dejQjDQDxfcnyhz=BxSAejXGMMtGQzO_w@mail.gmail.com>
On Fri, Jul 16, 2021 at 12:55:07AM +0300, Rostislav Krasny wrote:
Show 13 quoted lines
> Hello,
>
> Originally this bug was reported in the Git for Windows project and
> contains two screenshots:
> https://github.com/git-for-windows/git/issues/3321
> Johannes Schindelin (dscho) is convinced that this is not a
> Windows-specific issue. Following is a brief description of this bug
> as I've faced it:
>
> After running the "git submodule set-branch --branch master -- ms1"
> I've noticed that the .gitmodules file is encoded with both DOS and
> UNIX End-of-Line characters simultaneously: all original lines use DOS
> EOL characters but the added "branch = master" line uses UNIX EOL.
First of all: Thanks for posting this here.

Then there are some questions, at least from my side. How did you get there ? In which shell did you enter the command ?

Could you run od -c .gitmodules and post the results here ?

Or is it possible to set up a dummy repo, which does show the problem, somewhere ?

What we appreciate is a fully reproducable receipt, so that anybody can reproduce the problem.

I have the slight suspicion that the CR as part of CRLF had sneaked in somewhere via the command line. But that is already a speculation.

And I don't know, if there is a problem at all, or is it just cosmetics ?
Anyway, a full set of commands would be good to have.
Show 42 quoted lines
>
> Found on the following environment:
>
> $ git --version --build-options
> git version 2.32.0.windows.2
> cpu: x86_64
> built from commit: 3d45ac813c4adf97fe3733c1f763ab6617d5add5
> sizeof-long: 4
> sizeof-size_t: 8
> shell-path: /bin/sh
> feature: fsmonitor--daemon
>
> $ cmd.exe /c ver
>
> Microsoft Windows [Version 10.0.19042.1083]
>
> $ cat /etc/install-options.txt
>
> Editor Option: VIM
> Custom Editor Path:
> Default Branch Option:
> Path Option: Cmd
> SSH Option: OpenSSH
> Tortoise Option: false
> CURL Option: OpenSSL
> CRLF Option: CRLFAlways
> Bash Terminal Option: MinTTY
> Git Pull Behavior Option: Merge
> Use Credential Manager: Core
> Performance Tweaks FSCache: Enabled
> Enable Symlinks: Enabled
> Enable Pseudo Console Support: Disabled
> Enable FSMonitor: Disabled
>
> Comments of Johannes Schindelin (dscho) in the GitHub bug report:
>
> > I don't believe that Git considers its config files free game regarding line endings.
> > Therefore, I think that having DOS line endings in there is already a violation of Git's
> > assumptions. In any case, this is not a Windows-specific issue, even if DOS line
> > endings are much more prevalent on Windows than on other platforms. Please take
> > it to the Git mailing list (send plain-text messages, HTML messages are dropped
> > silently).
Previous: Atharva RaykarNext: Rostislav Krasny
Message 8 of 10 in “Incorrect and inconsistent End-Of-Line characters in .gitmodules after "git submodule set-branch --branch <branch_name>"”
  1. Rostislav KrasnyJul 15, 2021
  2. brian m. carlsonJul 16, 2021
  3. Rostislav KrasnyJul 17, 2021
  4. Why do submodules detach HEAD? (was Re: Incorrect and inconsistent End-Of-Line characters in .gitmodules ...)Atharva Raykar, Jul 21, 2021
  5. Philippe BlainJul 21, 2021
  6. Rostislav KrasnyAug 5, 2021
  7. Atharva RaykarAug 5, 2021
  8. Torsten B��gershausenJul 17, 2021
  9. Rostislav KrasnyJul 17, 2021
  10. Torsten B��gershausenJul 18, 2021

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.