line-endings

git & Cygwin - trailing whitespace causes “not uptodate” [closed]

你。 提交于 2019-12-13 00:44:47
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago . Git on Windows w/ Cygwin is fraught with dangers. However there's one that's really starting to bug me. It's related to the core.autocrlf=true behaviour. After spending a week trawling the 'net it became clear

ASP Readline non-standard Line Endings

不问归期 提交于 2019-12-12 15:17:51
问题 I'm using the ASP Classic ReadLine() function of the File System Object. All has been working great until someone made their import file on a Mac in TextEdit. The line endings aren't the same, and ReadLine() reads in the entire file, not just 1 line at a time. Is there a standard way of handling this? Some sort of page directive, or setting on the File System Object? I guess that I could read in the entire file, and split on vbLF , then for each item, replace vbCR with "", then process the

Why does Git insist that a file has been modified even after a `git checkout --`?

馋奶兔 提交于 2019-12-12 11:45:39
问题 I made a change to a couple of files locally, without committing them . git status shows: >> git status # On branch feature-ravendb # Your branch is ahead of 'origin/feature-ravendb' by 1 commit. # # 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: source/Octopus.Tentacle/Integration/PowerShell/IPowerShell.cs # modified: source/Octopus.Tentacle/Integration

emacs change default line ending

我的未来我决定 提交于 2019-12-12 08:31:20
问题 In Windows, Emacs is using cr-lf for a linebreak, but I like all my files to use Unix line endings (lf). I found a way to change it during my session, but I am not such an Emacs guru to translate the solution into an elisp command in my .emacs file. Can anybody help me, so Emacs in Windows will use lf permanently? 回答1: See also How to configure GNU Emacs to write UNIX or DOS formatted files by default? (setq default-buffer-file-coding-system 'utf-8-unix) 来源: https://stackoverflow.com

How to force converting worktree files after changing core.autocrlf?

我与影子孤独终老i 提交于 2019-12-11 19:05:47
问题 I'm on Windows and have systemwide core.autocrlf=true . For a specific repository, I've overridden it locally to false . But that didn't convert line endings in checked-out files. How do I do that? If I convert the files manually with e.g. dos2unix , they show as altered. Also tried git checkout --force HEAD , it had no effect. The only working way I have found is to delete all the files, then git reset --hard which is rather awkward (=there's no simple and reliable command to do that, and it

Emacs showing ^M in a process buffer

随声附和 提交于 2019-12-11 13:43:59
问题 At the moment, I have a process-buffer which is utf-8-auto (emacs modeline reports the buffer as utf-8-auto-dos ) with CRLF style newlines. When I write multi-line text into the buffer via a process-send-region or process-send-string each line is suffixed with ^M . What makes this problem odd is that text written to the process-buffer directly from the process, does not contain ^M 's. It doesn't seem to make any difference where the source text comes from, in fact, even a multi-line region

git sees entire file as one line due to mac line endings

瘦欲@ 提交于 2019-12-11 09:28:12
问题 I am working on Windows platform, with files in Mac ANSI encoding when I edit a single line of a file, and then do a git diff , this is what I see: diff --git a/class.php b/class.php @@ -1 +1 @@ -<?php^Mclass Type {^M^M private $x;// level^M ..etc \ No newline at end of file +<?php^Mclass Type {^M^M private $x;// level^M ..etc \ No newline at end of file In other words, git sees my file as a single line, due to the mac line endings. I have looked at various posts on git hub and got tried a

Inconsistent results with PHP Reflection API

旧城冷巷雨未停 提交于 2019-12-11 06:42:43
问题 I have an application that works perfectly on both Windows & Mac that uses the PHP5 Reflection API. I attempted to deploy the application to a Linux machine (CentOS box running PHP 5.3.6 -production server), only to find that the ReflectionMethod::getDocComment() function does not return anything. I investigated for a little while, and discovered that the line-endings were a potential culprit. I used the dos2unix utility on my server to change the line-endings all to Unix-style, and the

Why are my line-endings still wrong according to CodeSniffer?

可紊 提交于 2019-12-11 03:37:33
问题 I made a git hook that checks my code style before commit. It passes the staged files to CodeSniffer. I use the PSR-2 code style which means newlines should be \n even on Windows. However even after changing PhpStorm settings and git settings it still gives me the error that the newlines are \r\n . Why does this happen? PhpStorm Searching for \r\n with regex on does not return instances, so I believe the problem to lie with git. .gitconfig [core] autocrlf = false editor = \"C:/Program Files

Function not working in a bash script - error messages relate to '\r' [duplicate]

穿精又带淫゛_ 提交于 2019-12-11 02:54:37
问题 This question already has answers here : Convert DOS line endings to Linux line endings in vim (26 answers) Closed 4 years ago . I have recently installed a fresh version of Debian. I created this simple script: #!/bin/bash print_something () { echo Hello I am a function } print_something print_something However this displays this error upon me issuing bash test.sh : test.sh: line 3: $'\r': command not found test.sh: line 4: syntax error near unexpected token `$'{\r'' 'est.sh: line 4: `print