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

Re: How to avoid the ^M induced by Meld and Git

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 12, 2012, 14:57 UTC
Message-ID
<50C89B68.8090309@drmicha.warpmail.net>
In-Reply-To
<50C72821.10908@erasmusmc.nl>
Karl Brand venit, vidit, dixit 11.12.2012 13:33:
Show 11 quoted lines
> Esteemed Git users,
> 
> What i do:
> 
> 1. Create a script.r using Emacs/ESS.
> 2. Make some modifications to script.r with the nice diff gui, Meld
> 3. Commit these modifications using git commit -am "my message"
> 4. Reopen script.r in Emacs/ESS to continue working.
> 
> The lines added (&/edited ?) using Meld all end with ^M which i 
> certainly don't want. Lines not added/edited with Meld do NOT end with ^M.

What happens if you leave out step 3? If the same happens then Meld is the culprit. (Unless you've set some special options, git does not modify your file on commit, so this can't be git related.)

Show 21 quoted lines
> There are plenty of posts around about these being line endings used for 
> windows which can appear when working on a script under a *nix OS which 
> has previously been edited in a Windows OS. This is not the case here - 
> everything is taking place on Ubuntu 12.04.
> 
> FWIW: the directory is being synced by dropbox; and in Meld, Preferences 
>  > Encoding tab, "utf8" is entered in the text box.
> 
> Current work around is running in a terminal: dos2unix /path/to/script.r 
> which strips the ^M's
> 
> But this just shouldn't be necessary and I'd really appreciate the 
> reflections & advice on how to stop inducing these ^M's !
> 
> With thanks,
> 
> Karl
> 
> (re)posted here as suggested off topic at SO:
> http://stackoverflow.com/questions/13799631/create-script-r-in-emacs-modify-with-meld-git-commit-reopen-in-emacs-m
> 
Previous: Karl BrandNext: Karl Brand
Message 2 of 6 in “How to avoid the ^M induced by Meld and Git”
  1. Karl BrandDec 11, 2012
  2. Michael J GruberDec 12, 2012
  3. Karl BrandDec 12, 2012
  4. Michael J GruberDec 12, 2012
  5. Karl BrandDec 12, 2012
  6. Karl BrandDec 14, 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.