Comments (4)
Just a theory, maybe when you use git on windows then git archive
thinks it should produce an archive with CRLF endings since that is the platform default?
I usually make a shell script that is responsible for generating the release builds and check that in to the repository, you can see an example here: https://github.com/ClassicPress/ClassicPress-Migration-Plugin/blob/master/bin/build-plugin-zip.sh
However if you can get git archive
working as intended then this might not be necessary.
I do switch between Linux and Windows but even when using Windows, my editor is set to use LF
This sounds right. git has some features to convert between line endings but I think they should never have added that at all, and just using LF everywhere is a much better idea.
I believe adding
* text eol=lf
to.gitattributes
may help.
I haven't had to use this feature myself and reading through the documentation was not immediately illuminating. That might help, but one issue is that you don't want to be treating images, fonts and other binary files as text and possibly having git try to convert them between different line endings, which would corrupt their contents.
First I would try this on your Windows machine: change to the classicpress-seo repository and run git config core.eol lf
to set the default line-ending style in that repository, then try git archive
and see what kind of line endings come through there. If that works then you won't need to mess around with line endings in .gitattributes
anymore, in fact you should be able to delete that line from .gitattributes
.
Or I guess you could try building the releases from Linux.
Is it OK to add
.gitattributes
and.gitignore
to.gitignore
?
These files should still be included in the git repository, so they shouldn't be added to .gitignore
. It looks like you can tell git archive
to skip them when exporting, using this attribute: https://www.git-scm.com/docs/gitattributes#_export_ignore
I'm not sure how much time is worth spending on this anyway... it's a pretty minor thing and I already spent a lot longer than I thought I would trying to make sense of the git documentation.
from classicpress-seo.
How is the release package currently built?
The line endings are also getting converted to CR+LF (Windows line endings) which is making git
complain. Released plugins should probably use LF (Unix) line endings.
from classicpress-seo.
contains .gitattributes and .gitignore files, these should be removed in the release process
I've had a look into this and have seen conflicting advice.
Is it OK to add .gitattributes
and .gitignore
to .gitignore
? Or are they best added to .git/info/exclude
? Or something else?
How is the release package currently built?
https://github.com/ClassicPress-plugins/classicpress-seo/releases/tag/v1.0.0-beta.4
... is created using GitHub "Create a new release".
https://github.com/ClassicPress-plugins/classicpress-seo/releases/download/v1.0.0-beta.4/classicpress-seo.zip
... is created using the following command:
git archive --prefix=classicpress-seo/ -o "classicpress-seo.zip" HEAD
The line endings are also getting converted to CR+LF
I don't know why this is. I do switch between Linux and Windows but even when using Windows, my editor is set to use LF and even if it's not, GitHub Desktop is supposed to convert CRLF line endings to LF (or at least give a warning). I also have the following line in .gitattributes
although I'm not convinced this does anything by itself:
* text=auto
I believe adding * text eol=lf
to .gitattributes
may help.
Any thoughts on this?
I shall investigate.
from classicpress-seo.
Thanks for the detailed info.
I've added the following lines to .gitattributes
in PR #96
.gitignore export-ignore
.gitattributes export-ignore
so git archive
will exclude these two files now.
I've also run git config core.eol lf
on my Windows repo but, in any case, I think the best thing to do is, as you say, a) only build releases on Linux, and b) use a bash script similar to the one you use for the migration plugin. That's what I intend doing from now on.
So I will close this issue when I merge #92.
from classicpress-seo.
Related Issues (20)
- Admin menu icon is too large HOT 2
- Documentation
- please update shortcode [cpseo_contact_info] HOT 2
- Change update server address in Update Manager
- Fatal error in php8 HOT 7
- Add npm and grunt for use with new unminified CSS and JS
- Enable CPSEO to be installed via composer HOT 1
- Enable GitHub Actions
- Hijacked dismissible admin notices HOT 3
- reply to comment
- PHP 8.0 Compatibility HOT 1
- Plugin could not be activated because it triggered a fatal error. HOT 1
- Composer discussion HOT 1
- ClassicPress-SEO: 2.1.2: Sitemap does not contain new posts HOT 2
- classic seo v2.2.0-alpha HOT 4
- WSOD with PHP below 7.3 HOT 1
- Remove usage tracking option HOT 1
- Can't activate V 2.2.0 because of Fatal error HOT 1
- Classic SEO prevents saving of metaboxes position HOT 3
- Deprecation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classicpress-seo.