git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* what is git's position on "classic" mac <CR>-only end of lines?
@ 2017-10-01 17:52 Robert P. J. Day
  2017-10-01 19:29 ` Bryan Turner
  0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2017-10-01 17:52 UTC (permalink / raw)
  To: Git Mailing list


  sorry for more pedantic nitpickery, but i'm trying to write a
section on how to properly process mixtures of EOLs in git, and when i
read "man git-config", everything seems to refer to Mac OS X and macOS
(and linux, of course) using <LF> for EOL, with very little mention of
what one does if faced with "classic" mac EOL of just <CR>.

  is there a description of what happens in that case? or is it
considered not important enough to deal with?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what is git's position on "classic" mac <CR>-only end of lines?
  2017-10-01 17:52 what is git's position on "classic" mac <CR>-only end of lines? Robert P. J. Day
@ 2017-10-01 19:29 ` Bryan Turner
  2017-10-01 20:58   ` Johannes Sixt
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Turner @ 2017-10-01 19:29 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Git Mailing list

On Sun, Oct 1, 2017 at 10:52 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
>   sorry for more pedantic nitpickery, but i'm trying to write a
> section on how to properly process mixtures of EOLs in git, and when i
> read "man git-config", everything seems to refer to Mac OS X and macOS
> (and linux, of course) using <LF> for EOL, with very little mention of
> what one does if faced with "classic" mac EOL of just <CR>.

 No command in Git that I'm aware of considers a standalone <CR> to be
a line ending. A file containing only <CR>s is treated as a single
line by every Git command I've used. I'm not sure whether that
behavior is configurable. For files with standalone <CR>s mixed with
other line endings (<CRLF> or <LF>, either or both), the <CRLF> and
<LF> endings are both considered line endings while the standalone
<CR>s are not.

That's just based on my experience with them, though. In general, `git
blame` and `git diff`, for example, don't seem honor them. Perhaps
someone else knows of some useful knows of which I'm not aware.

Best regards,
Bryan Turner

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what is git's position on "classic" mac <CR>-only end of lines?
  2017-10-01 19:29 ` Bryan Turner
@ 2017-10-01 20:58   ` Johannes Sixt
  2017-10-01 21:29     ` Robert P. J. Day
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2017-10-01 20:58 UTC (permalink / raw)
  To: Bryan Turner, Robert P. J. Day; +Cc: Git Mailing list

Am 01.10.2017 um 21:29 schrieb Bryan Turner:
> On Sun, Oct 1, 2017 at 10:52 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>>
>>    sorry for more pedantic nitpickery, but i'm trying to write a
>> section on how to properly process mixtures of EOLs in git, and when i
>> read "man git-config", everything seems to refer to Mac OS X and macOS
>> (and linux, of course) using <LF> for EOL, with very little mention of
>> what one does if faced with "classic" mac EOL of just <CR>.
> 
>   No command in Git that I'm aware of considers a standalone <CR> to be
> a line ending. A file containing only <CR>s is treated as a single
> line by every Git command I've used. I'm not sure whether that
> behavior is configurable. For files with standalone <CR>s mixed with
> other line endings (<CRLF> or <LF>, either or both), the <CRLF> and
> <LF> endings are both considered line endings while the standalone
> <CR>s are not.

That's true, AFAIK. In addition, when Git auto-detects whether a file is 
binary or text, then a file with a bare CR is treated as binary:

https://github.com/git/git/blob/master/convert.c#L91

That basically amounts to: "it [is] considered not important enough to 
deal with" ;)

-- Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: what is git's position on "classic" mac <CR>-only end of lines?
  2017-10-01 20:58   ` Johannes Sixt
@ 2017-10-01 21:29     ` Robert P. J. Day
  0 siblings, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2017-10-01 21:29 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Bryan Turner, Git Mailing list

On Sun, 1 Oct 2017, Johannes Sixt wrote:

> Am 01.10.2017 um 21:29 schrieb Bryan Turner:
> > On Sun, Oct 1, 2017 at 10:52 AM, Robert P. J. Day <rpjday@crashcourse.ca>
> > wrote:
> > >
> > >    sorry for more pedantic nitpickery, but i'm trying to write a
> > > section on how to properly process mixtures of EOLs in git, and
> > > when i read "man git-config", everything seems to refer to Mac
> > > OS X and macOS (and linux, of course) using <LF> for EOL, with
> > > very little mention of what one does if faced with "classic" mac
> > > EOL of just <CR>.
> >
> >   No command in Git that I'm aware of considers a standalone <CR>
> > to be a line ending. A file containing only <CR>s is treated as a
> > single line by every Git command I've used. I'm not sure whether
> > that behavior is configurable. For files with standalone <CR>s
> > mixed with other line endings (<CRLF> or <LF>, either or both),
> > the <CRLF> and <LF> endings are both considered line endings while
> > the standalone <CR>s are not.
>
> That's true, AFAIK. In addition, when Git auto-detects whether a
> file is binary or text, then a file with a bare CR is treated as
> binary:
>
> https://github.com/git/git/blob/master/convert.c#L91
>
> That basically amounts to: "it [is] considered not important enough
> to deal with" ;)

  that's fine, that's all i was after -- basically, git handles Mac OS
X and macOS, and if you're dealing with mac "classic" EOLs, well ...

  http://i.imgur.com/z96dZ0x.jpg

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-01 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-01 17:52 what is git's position on "classic" mac <CR>-only end of lines? Robert P. J. Day
2017-10-01 19:29 ` Bryan Turner
2017-10-01 20:58   ` Johannes Sixt
2017-10-01 21:29     ` Robert P. J. Day

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).