0
0
I need to modify sources under Git version control. The sources are Visual Studio project files, which makes them native Microsoft. I want to avoid whitespace issues, including line ending games.
I looked at the files before the modification under emacs, and the ^M
was clearly not present.
I then executed the following from a script from a Linux machine:
sed -i 's/odbc32.lib //g' *.vcproj
sed -i 's/odbccp32.lib //g' *.vcproj
When I look at the changes:
$ git diff cryptest.vcproj
diff --git a/cryptest.vcproj b/cryptest.vcproj
index cec447d..9ae71ea 100644
--- a/cryptest.vcproj
+++ b/cryptest.vcproj
@@ -76,7 +76,7 @@
...
Name="VCLinkerTool"
- AdditionalDependencies="odbc32.lib odbccp32.lib Ws2_32.lib"
+ AdditionalDependencies="Ws2_32.lib"^M
SuppressStartupBanner="true"
...
How do I perform a replacement without adding extraneous whitespace?
*"I'm assuming you are on a Unix system..."* - yes (kind of). I'm on a Linux system, not Unix: "...I then executed the following from a script from a Linux machine"" . – jww – 2015-07-19T03:00:10.680
To get back to the orginal question: "How do I perform a replacement without adding extraneous whitespace?". I don't think that's provided in your answer. – jww – 2015-07-19T03:02:06.173
At the top of your working directory can you try the following commands:
git config core.eol
git config core.autocrlf
find . -name .gitattributes -o -name attributes
and if they show anything add the results to your question. Also, doescat -vet cryptest.vcproj
before the edit show the line endings as 3 chars^M$
on all lines, only some, or none. – meuh – 2015-07-19T07:11:04.963