Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

CRLF line endings

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


stefan at bytereef

Mar 25, 2011, 2:36 AM

Post #1 of 11 (815 views)
Permalink
CRLF line endings

Hi,

A commit hook prevented pushing changes to the cdecimal repository:

pushing to ssh://hg [at] hg/features/cdecimal
searching for changes
8 changesets found
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 8 changesets with 117 changes to 117 files
remote: error: pretxnchangegroup.eol hook failed: Modules/cdecimal/tests/dnloop.patch in 80914c366edf should not have CRLF line endings
remote: transaction abort!
remote: rollback completed
remote: abort: Modules/cdecimal/tests/dnloop.patch in 80914c366edf should not have CRLF line endings


However, dnloop.patch is correct and must have CRLF line endings. How
can I disable the commit hook?


Stefan Krah

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ncoghlan at gmail

Mar 25, 2011, 4:12 AM

Post #2 of 11 (798 views)
Permalink
Re: CRLF line endings [In reply to]

On Fri, Mar 25, 2011 at 7:36 PM, Stefan Krah <stefan [at] bytereef> wrote:
> Hi,
>
> A commit hook prevented pushing changes to the cdecimal repository:
>
> pushing to ssh://hg [at] hg/features/cdecimal
> searching for changes
> 8 changesets found
> remote: adding changesets
> remote: adding manifests
> remote: adding file changes
> remote: added 8 changesets with 117 changes to 117 files
> remote: error: pretxnchangegroup.eol hook failed: Modules/cdecimal/tests/dnloop.patch in 80914c366edf should not have CRLF line endings
> remote: transaction abort!
> remote: rollback completed
> remote: abort: Modules/cdecimal/tests/dnloop.patch in 80914c366edf should not have CRLF line endings
>
>
> However, dnloop.patch is correct and must have CRLF line endings. How
> can I disable the commit hook?

Don't disable the commit hook, update .hgeol to flag that file as
requiring CRLF line endings.

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan [at] gmail   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


stefan at bytereef

Mar 25, 2011, 5:59 AM

Post #3 of 11 (796 views)
Permalink
Re: CRLF line endings [In reply to]

Nick Coghlan <ncoghlan [at] gmail> wrote:
> > However, dnloop.patch is correct and must have CRLF line endings. How
> > can I disable the commit hook?
>
> Don't disable the commit hook, update .hgeol to flag that file as
> requiring CRLF line endings.

Thanks, that works well.


Stefan Krah


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


rdmurray at bitdance

Mar 25, 2011, 6:12 AM

Post #4 of 11 (796 views)
Permalink
Re: CRLF line endings [In reply to]

On Fri, 25 Mar 2011 21:12:19 +1000, Nick Coghlan <ncoghlan [at] gmail> wrote:
> Don't disable the commit hook, update .hgeol to flag that file as
> requiring CRLF line endings.

Note however that we discovered that the server side hook looks at the
.hgeol file in the *server's checkout*. I don't know if Georg or Antoine
have fixed this or not (it's a standard Mercurial plugin, so probably
not).

So, I think that once you check in the .hgeol, you have to get a server
admin to update the repo checkout on the server. Maybe we should
set up a cron job.

But, yeah, updating .hgeol is the correct solution, otherwise you'll
just run in to the trouble when you try to merge the branch into default.

--
R. David Murray http://www.bitdance.com
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ncoghlan at gmail

Mar 25, 2011, 6:21 AM

Post #5 of 11 (794 views)
Permalink
Re: CRLF line endings [In reply to]

On Fri, Mar 25, 2011 at 11:12 PM, R. David Murray <rdmurray [at] bitdance> wrote:
> On Fri, 25 Mar 2011 21:12:19 +1000, Nick Coghlan <ncoghlan [at] gmail> wrote:
>> Don't disable the commit hook, update .hgeol to flag that file as
>> requiring CRLF line endings.
>
> Note however that we discovered that the server side hook looks at the
> .hgeol file in the *server's checkout*.  I don't know if Georg or Antoine
> have fixed this or not (it's a standard Mercurial plugin, so probably
> not).

Not that I noticed - to get my sandbox updated after you moved all the
email test files, I just had to one do push to get the .hgeol file
updated, then the second push with all the subsequent changes went
through without any trouble.

The one thing you can't do is push an updated .hgeol *and* files that
depend on the updated ruleset in one operation - the server will
process the whole transaction using the *old* version of the .hgeol
file and it will fail as a result. But "hg log .hgeol" will tell you
which version last changed it, then a "hg push -r <rev>" will get the
server's version updated.

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan [at] gmail   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


solipsis at pitrou

Mar 25, 2011, 6:32 AM

Post #6 of 11 (792 views)
Permalink
Re: CRLF line endings [In reply to]

On Fri, 25 Mar 2011 09:12:53 -0400
"R. David Murray" <rdmurray [at] bitdance> wrote:
> On Fri, 25 Mar 2011 21:12:19 +1000, Nick Coghlan <ncoghlan [at] gmail> wrote:
> > Don't disable the commit hook, update .hgeol to flag that file as
> > requiring CRLF line endings.
>
> Note however that we discovered that the server side hook looks at the
> .hgeol file in the *server's checkout*. I don't know if Georg or Antoine
> have fixed this or not (it's a standard Mercurial plugin, so probably
> not).

We have "fixed" it by nulling the server's checkout (updating to it to
changeset 0000000000, that is). Unless someone logs in and manually
does "hg up" in that directory, it shouldn't happen again.

(but, yes, it's probably a bug or misfeature in hgeol)

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


vinay_sajip at yahoo

May 3, 2012, 8:28 AM

Post #7 of 11 (493 views)
Permalink
Re: CRLF line endings [In reply to]

Chris Angelico <rosuav <at> gmail.com> writes:

> Not all Windows editors choke on \n line endings; when I'm on Windows
> and run into one, I open it in Wordpad (or, if I have one, a dedicated
> programming editor like SciTE or the Open Watcom editor). AFAIK only
> Notepad (of standard Windows utilities) has trouble.
>
> Not sure if that makes a difference or not.

It's only really an issue for new / inexperienced users, I agree. Since these
files are installed only on Windows systems, there's no reason for them not to
have the native line endings.

Regards,

Vinay Sajip

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


rosuav at gmail

May 3, 2012, 8:30 AM

Post #8 of 11 (495 views)
Permalink
Re: CRLF line endings [In reply to]

On Fri, May 4, 2012 at 1:28 AM, Vinay Sajip <vinay_sajip [at] yahoo> wrote:
> It's only really an issue for new / inexperienced users, I agree. Since these
> files are installed only on Windows systems, there's no reason for them not to
> have the native line endings.

Then sure, doesn't make a lot of difference that it's only Notepad.

Somebody needs to rewrite that ancient editor and give Windows a
better default...

ChrisA
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

May 3, 2012, 2:00 PM

Post #9 of 11 (491 views)
Permalink
Re: CRLF line endings [In reply to]

Zitat von Chris Angelico <rosuav [at] gmail>:

> On Thu, May 3, 2012 at 10:50 PM, Vinay Sajip <vinay_sajip [at] yahoo> wrote:
>> Although these are text files, the CRLF line endings are needed because
>> otherwise, the files won't be presented correctly on Windows, e.g.
>> in Notepad.
>
> Not all Windows editors choke on \n line endings; when I'm on Windows
> and run into one, I open it in Wordpad (or, if I have one, a dedicated
> programming editor like SciTE or the Open Watcom editor). AFAIK only
> Notepad (of standard Windows utilities) has trouble.
>
> Not sure if that makes a difference or not.

I think that .bat files strictly *have* to have CRLF line endings. Not sure
about PowerShell, though.

In any case, having CRLF for these files sounds good to me.

Regards,
Martin


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


v+python at g

May 3, 2012, 4:46 PM

Post #10 of 11 (486 views)
Permalink
Re: CRLF line endings [In reply to]

On 5/3/2012 2:00 PM, martin [at] v wrote:
> I think that .bat files strictly *have* to have CRLF line endings.

Nope. Both .bat and .cmd work fine with LF only in Win7 (and IIRC, in
XP as well, but I just tested Win7)


ncoghlan at gmail

May 3, 2012, 5:37 PM

Post #11 of 11 (487 views)
Permalink
Re: CRLF line endings [In reply to]

On Fri, May 4, 2012 at 7:00 AM, <martin [at] v> wrote:
> In any case, having CRLF for these files sounds good to me.

Right. While Windows has been getting much better at coping with LF
only line endings over the years, being able to explicitly flag files
for CRLF endings is the entire reason we held out for the EOL
extension before making the switch to Mercurial.

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan [at] gmail   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.