Byte order mark always make some files modified

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Byte order mark always make some files modified

Chenxiong Qi-2
Hi,

Following files are always marked as modified in my repos when swtich
between maint and master back and forth, sometimes these modified
files prevent git from git-checkout, meanwhile they cannot be stashed
or checked out with `checkout --`.

modified:   doc/README-de.win32-bin.txt
modified:   doc/README-fr.win32-bin.txt
modified:   doc/README-it.win32-bin.txt
modified:   doc/README-nl.win32-bin.txt
modified:   doc/README-zh_CN.win32-bin.txt
modified:   doc/README-zh_TW.win32-bin.txt
modified:   doc/README.win32-bin.txt
modified:   doc/examples/downloaded.mt940

I searched archived mails in gnucash-devel, set `git config --global
core.autocrlf input`. However, this only affects the first time when
checkout branch from master to maint. Above issue happens again when
checkout back to master from maint. Really confused, have no idea why
this happens and not sure whether it's an CRLF-related issue.

--
Regards,
Chenxiong Qi
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: Byte order mark always make some files modified

John Ralls-2

> On Dec 27, 2014, at 3:50 AM, Chenxiong Qi <[hidden email]> wrote:
>
> Hi,
>
> Following files are always marked as modified in my repos when swtich
> between maint and master back and forth, sometimes these modified
> files prevent git from git-checkout, meanwhile they cannot be stashed
> or checked out with `checkout --`.
>
> modified:   doc/README-de.win32-bin.txt
> modified:   doc/README-fr.win32-bin.txt
> modified:   doc/README-it.win32-bin.txt
> modified:   doc/README-nl.win32-bin.txt
> modified:   doc/README-zh_CN.win32-bin.txt
> modified:   doc/README-zh_TW.win32-bin.txt
> modified:   doc/README.win32-bin.txt
> modified:   doc/examples/downloaded.mt940
>
> I searched archived mails in gnucash-devel, set `git config --global
> core.autocrlf input`. However, this only affects the first time when
> checkout branch from master to maint. Above issue happens again when
> checkout back to master from maint. Really confused, have no idea why
> this happens and not sure whether it's an CRLF-related issue.

Those files' line endings are supposed to be controlled by .gitattributes, which overrides the core.autocrlf setting.
I tweaked the globs in .gitattributes 2 Dec., and Mike Alexander removed the line endings from the repo on the 8th. This worked correctly for me just now, with no core.autocrlf setting. Did you experience the problem with a fresh checkout
or an older one?

README.win32-bin.txt and downloaded.mt940 don't have BOMs.

Regards,
John Ralls


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: git always make some files modified

Christian Stimming-4
Am Samstag, 27. Dezember 2014, 09:22:12 schrieb John Ralls:

> > Following files are always marked as modified in my repos when swtich
> > between maint and master back and forth, sometimes these modified
> > files prevent git from git-checkout, meanwhile they cannot be stashed
> > or checked out with `checkout --`.
> >
> > modified:   doc/README-de.win32-bin.txt
> > modified:   doc/README-fr.win32-bin.txt
> > modified:   doc/README-it.win32-bin.txt
> > modified:   doc/README-nl.win32-bin.txt
> > modified:   doc/README-zh_CN.win32-bin.txt
> > modified:   doc/README-zh_TW.win32-bin.txt
> > modified:   doc/README.win32-bin.txt
> > modified:   doc/examples/downloaded.mt940
> >
> > I searched archived mails in gnucash-devel, set `git config --global
> > core.autocrlf input`. However, this only affects the first time when
> > checkout branch from master to maint. Above issue happens again when
> > checkout back to master from maint. Really confused, have no idea why
> > this happens and not sure whether it's an CRLF-related issue.
>
> Those files' line endings are supposed to be controlled by .gitattributes,
> which overrides the core.autocrlf setting.

Yes, the .gitattributes file is the other source of CRLF-related settings. I
think 1-2 years ago it took me a while to discover how to get rid of this same
"modified: doc/README...txt" message. I got stuck in those message when
switching between master and some older branch such as maint or even older.

My solution is as follows:

- Remove the .gitattributes file
- Commit this removal into git (which makes the modified-message go away),
- And reset the master branch back to the original master.

It still sounds a bit funny to me, but this somehow works to get rid of those
error message.

> README.win32-bin.txt and downloaded.mt940 don't have BOMs.

Yes, byte order mark (BOM) is the wrong keyword here - we are only talking
about line endings, not byte order.

Regards,

Christian
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: Byte order mark always make some files modified

Mike Alexander
In reply to this post by John Ralls-2
--On December 27, 2014 at 9:22:12 AM -0800 John Ralls
<[hidden email]> wrote:

>
>> On Dec 27, 2014, at 3:50 AM, Chenxiong Qi <[hidden email]> wrote:
>>
>> Hi,
>>
>> Following files are always marked as modified in my repos when swtich
>> between maint and master back and forth, sometimes these modified
>> files prevent git from git-checkout, meanwhile they cannot be stashed
>> or checked out with `checkout --`.
>>
>> modified:   doc/README-de.win32-bin.txt
>> modified:   doc/README-fr.win32-bin.txt
>> modified:   doc/README-it.win32-bin.txt
>> modified:   doc/README-nl.win32-bin.txt
>> modified:   doc/README-zh_CN.win32-bin.txt
>> modified:   doc/README-zh_TW.win32-bin.txt
>> modified:   doc/README.win32-bin.txt
>> modified:   doc/examples/downloaded.mt940
>>
>> I searched archived mails in gnucash-devel, set `git config --global
>> core.autocrlf input`. However, this only affects the first time when
>> checkout branch from master to maint. Above issue happens again when
>> checkout back to master from maint. Really confused, have no idea why
>> this happens and not sure whether it's an CRLF-related issue.
>
> Those files' line endings are supposed to be controlled by
> .gitattributes, which overrides the core.autocrlf setting. I tweaked
> the globs in .gitattributes 2 Dec., and Mike Alexander removed the
> line endings from the repo on the 8th. This worked correctly for me
> just now, with no core.autocrlf setting. Did you experience the
> problem with a fresh checkout or an older one?
>
> README.win32-bin.txt and downloaded.mt940 don't have BOMs.

And what sort of machine is this on?  Windows, Mac, or Linux?  I have
core.autocrlf set to "input" and it seems to work ok for me on my Mac.
You might want to reread the section on "End-of-line conversion" in the
"git help attributes" man page.

               Mike
 
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: git always make some files modified

Mike Alexander
In reply to this post by Christian Stimming-4
--On December 27, 2014 at 9:16:56 PM +0100 Christian Stimming
<[hidden email]> wrote:

> My solution is as follows:
>
> - Remove the .gitattributes file
> - Commit this removal into git (which makes the modified-message go
> away),
> - And reset the master branch back to the original master.

Removing .gitattributes is a very bad idea.  It will mess up the line
endings in your repository.  It will only affect you if you don't push
things to other repositories, but it is still not a good idea.  Anyone
who pushes things to other repositories should not remove that file (or
change it unless they are very careful).

Git repositories are supposed to have all text files normalized to LF
line endings.  Then autocrlf controls what happens to them in your
checked out copy.  One of the big problems is determining what files
are text files and so should be normalized.  If you remove
.gitattributes then you will cause git to misidentify text files and
mess up line endings in things you commit to the repository.  This is
particularly true on Windows machines, but can be a problem on Linux
machines or Macs too.

         Mike


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: Byte order mark always make some files modified

Chenxiong Qi-2
In reply to this post by Mike Alexander
On Sun, Dec 28, 2014 at 4:19 AM, Mike Alexander <[hidden email]> wrote:

> --On December 27, 2014 at 9:22:12 AM -0800 John Ralls <[hidden email]>
> wrote:
>
>>
>>> On Dec 27, 2014, at 3:50 AM, Chenxiong Qi <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> Following files are always marked as modified in my repos when swtich
>>> between maint and master back and forth, sometimes these modified
>>> files prevent git from git-checkout, meanwhile they cannot be stashed
>>> or checked out with `checkout --`.
>>>
>>> modified:   doc/README-de.win32-bin.txt
>>> modified:   doc/README-fr.win32-bin.txt
>>> modified:   doc/README-it.win32-bin.txt
>>> modified:   doc/README-nl.win32-bin.txt
>>> modified:   doc/README-zh_CN.win32-bin.txt
>>> modified:   doc/README-zh_TW.win32-bin.txt
>>> modified:   doc/README.win32-bin.txt
>>> modified:   doc/examples/downloaded.mt940
>>>
>>> I searched archived mails in gnucash-devel, set `git config --global
>>> core.autocrlf input`. However, this only affects the first time when
>>> checkout branch from master to maint. Above issue happens again when
>>> checkout back to master from maint. Really confused, have no idea why
>>> this happens and not sure whether it's an CRLF-related issue.
>>
>>
>> Those files' line endings are supposed to be controlled by
>> .gitattributes, which overrides the core.autocrlf setting. I tweaked
>> the globs in .gitattributes 2 Dec., and Mike Alexander removed the
>> line endings from the repo on the 8th. This worked correctly for me
>> just now, with no core.autocrlf setting. Did you experience the
>> problem with a fresh checkout or an older one?

Yeah, reproduced this problem with fresh checkout several times.

>>
>> README.win32-bin.txt and downloaded.mt940 don't have BOMs.
>
>
> And what sort of machine is this on?  Windows, Mac, or Linux?  I have
> core.autocrlf set to "input" and it seems to work ok for me on my Mac. You
> might want to reread the section on "End-of-line conversion" in the "git
> help attributes" man page.

Linux. I'm running Fedora 21.

>
>               Mike
>



--
Regards,
Chenxiong Qi
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: Byte order mark always make some files modified

Mike Alexander
--On December 28, 2014 at 7:19:42 PM +0800 Chenxiong Qi
<[hidden email]> wrote:

>> And what sort of machine is this on?  Windows, Mac, or Linux?  I have
>> core.autocrlf set to "input" and it seems to work ok for me on my
>> Mac. You might want to reread the section on "End-of-line
>> conversion" in the "git help attributes" man page.
>
> Linux. I'm running Fedora 21.

I don't know what the problem is.  I just tried this again using Git
2.2.1 on MacOSX 10.9.5 and it works fine.  I cloned the github
repository and switched back and forth between maint and master a
number of times and it worked fine.  The *.win32-bin.txt and *.mt940
files have DOS line endings in my clone as they should.  What version
of Git are you using?  Perhaps that is the problem.  There doesn't seem
to be anything wrong with the repository's copy of GnuCash.

           Mike
 
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel