This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 253422 - hg resolve must not change line endings
Summary: hg resolve must not change line endings
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 8.0.2
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-12 05:46 UTC by terje7601
Modified: 2015-08-02 01:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description terje7601 2015-07-12 05:46:06 UTC
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb)
Comment 1 terje7601 2015-07-12 05:51:50 UTC
I'm working on a Java Mercurial project with UNIX-style line endings on a Windows PC. After doing a merge, I have some conflicts: I do "Resolve Conflicts...", and at the end NetBeans asks me to save the file & I answer "Yes". At this point, NetBeans saves the file with Windows-style line endings. So if I do the commit now, the diff will be 1 huge hunk of the whole file, instead of just the minor conflicting changes.

In short, resolving conflicts must never change the line endings of the file.
Comment 2 Ondrej Vrabec 2015-07-13 13:18:09 UTC
You should use commit hooks to convert from/to Unix line-endings on Windows:
[extensions]
win32text =
[decode]
** = cleverdecode:
[encode]
** = cleverencode:

That way you will not unintentionally commit with Windows line-endings even when creating a new file e.g. in an external editor.
Comment 3 terje7601 2015-07-13 14:11:58 UTC
Personally I think this should "just work". It seems obvious to me that NetBeans should not mess with line endings if I don't explicitly ask it to.

The proposed win32text is deprecated and "may be removed in a future release of Mercurial." [https://mercurial.selenic.com/wiki/Win32TextExtension] Its proposed alernative, eol, "is considered a feature of last resort." [https://mercurial.selenic.com/wiki/EolExtension]

I don't mind if I accidentally create & commit a new file with the wrong line endings, I can always correct this. What I don't want, is that NetBeans (or any other editor) changes line endings of existing files without my knowledge.
Comment 4 Ondrej Vrabec 2015-07-13 14:20:39 UTC
Sure, i am not closing this. If there's a problem with NB changing line-ending i will try to evaluate it.
I just wanted to let you know that every NB developer uses the extension because it prevents committing with CRLF quite reliably.
Comment 5 terje7601 2015-07-13 16:12:18 UTC
Thanks for your consideration. I just started using Mercurial, and it took me quite some time to figure out why my commit diffs were "broken", so I feel strongly about this :)
Comment 6 Ondrej Vrabec 2015-07-31 15:42:27 UTC
fixed: core-main #21a343bb9baa
Comment 7 Quality Engineering 2015-08-02 01:14:58 UTC
Integrated into 'main-silver', will be available in build *201508020002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/21a343bb9baa
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #253422 - hg resolve must not change line endings