git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Bauer <jens-lists@gpio.dk>
To: Jeff King <peff@peff.net>
Cc: Drew Northup <drew.northup@maine.edu>, git@vger.kernel.org
Subject: Re: CRLF, LF ... CR ?
Date: Thu, 13 Sep 2012 20:55:37 +0200	[thread overview]
Message-ID: <20120913205537072129.afbbbae7@gpio.dk> (raw)
In-Reply-To: <20120913182344.GA2181@sigill.intra.peff.net>

Hi Jeff and Drew.

Excellent. I now removed the repository from the server, removed it from my gitolite.conf, added it to gitolite.conf, re-initialized and it works.
git diff shows what I wanted.

Thank you *very* much for making my dream come true. :)
-And thank you all for all the hard work you're doing. -Git is how all other open-source projects should be: Well-written and well-defined (oh - and fast!). :)


Love
Jens

On Thu, 13 Sep 2012 14:23:44 -0400, Jeff King wrote:
> On Thu, Sep 13, 2012 at 08:17:20PM +0200, Jens Bauer wrote:
> 
>> In my home directory, I have a .gitconfig file, here's the 
>> interesting part:
>> [core]
>>         editor = nano
>>         excludesfile = /Users/jens/.gitexcludes
>>         attributesfile = /Users/jens/.gitattributes
>> 
>> [filter "cr"]
>>         clean = tr '\\r' '\\n'
>>         smudge = tr '\\n' '\\r'
>> 
>> 
>> In my home directory I added .gitattributes:
>> *.osm   filter=cr
> 
> Looks right.
> 
>> Now, when I clone the project, make a change and then issue this command...
>> $ git diff mypcb.osm
>> 
>> ...I get a strange diff. On line 3, one of the files shows a lot of 
>> control-m (<cr>) lines.
>> After that, I see <lf> lines, all prefixed with a '+', as if they 
>> were added.
>> 
>> I think I might be nearly there, just missing some obvious detail 
>> somewhere.
> 
> Yes, that's expected.  The point of the "clean" filter is to convert
> your working tree file into a canonical (lf-only) representation inside
> the repository. But you've already made commits with the cr form in the
> repository. So you can choose one of:
> 
>   1. Make a new commit with these settings, which will have the
>      canonical format. Accept that the old history will be funny, but
>      you will be OK from here on out.
> 
>   2. Rewrite the old history to pretend that it was always LF. This
>      gives you a nice clean history, but if you are collaborating with
>      other people, they will need to rebase their work on the new
>      history. See "git help filter-branch" for details.
> 
> -Peff

  reply	other threads:[~2012-09-13 18:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 15:09 CRLF, LF ... CR ? Jens Bauer
2012-09-13 15:34 ` Drew Northup
2012-09-13 15:43   ` Jeff King
2012-09-13 15:53     ` Jens Bauer
2012-09-13 18:17       ` Jens Bauer
2012-09-13 18:23         ` Jeff King
2012-09-13 18:55           ` Jens Bauer [this message]
2012-09-13 18:34       ` Johannes Sixt
2012-09-13 19:13         ` Jens Bauer
2012-09-13 15:43   ` Erik Faye-Lund
2012-09-14  4:06 ` David Aguilar
2012-09-14  4:36   ` Jens Bauer
2012-09-14  4:51   ` Junio C Hamano
2012-09-26  8:42     ` David Aguilar
2012-09-26 10:12       ` Jens Bauer
2012-09-26 10:31         ` Jens Bauer
2012-09-27  6:16       ` Junio C Hamano
2012-09-27 13:42         ` Jens Bauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120913205537072129.afbbbae7@gpio.dk \
    --to=jens-lists@gpio.dk \
    --cc=drew.northup@maine.edu \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).