Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easily tell git to ignore built assets #9089

Merged
merged 4 commits into from
Oct 23, 2020

Conversation

mlocati
Copy link
Contributor

@mlocati mlocati commented Oct 1, 2020

When writing the source javascript/css assets, we often need to build the compiled assets.

When we commit the changes, we may want to commit only the changed source files, not the compiled files.

This is a bit of a mess at the moment.

What about adding an easy way to tell git to ignore the compiled assets?

This pull request:

  • add two new npm commands:
    • npm run-script git-skip tells git to ignore the compiled assets
    • npm run-script git-unskip tells git to consider the compiled assets
  • for convenience, we also call:
    • git-skip when building the assets for development (eg npm run-script dev)
    • git-unskip when building the assets for production (eg npm run-script prod)

@aembler
Copy link
Member

aembler commented Oct 19, 2020

Going to have @KorvinSzanto give the thumbs up on this one.

Copy link
Member

@KorvinSzanto KorvinSzanto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good to merge to me. We should make sure we document this somehow somewhere so that we know where and when to add to the skippable paths.

build/package.json Outdated Show resolved Hide resolved
@mlocati
Copy link
Contributor Author

mlocati commented Oct 20, 2020

We should make sure we document this somehow somewhere so that we know where and when to add to the skippable paths.

What about 9a1bad5 ?

@mlocati
Copy link
Contributor Author

mlocati commented Oct 21, 2020

I've had an offline discussion with @KorvinSzanto about calling automatically git-skip when building assets for development, and calling git-unskip when building assets for production.
IMHO this shouldn't be done: assets should be built by the server (see #8532), so we should work always locally with assets marked as git-skip, and we need to call git-unskip when rebasing/switching branches...

@mlocati
Copy link
Contributor Author

mlocati commented Oct 21, 2020

Updated with 8d83e39

@aembler aembler merged commit afebebb into concretecms:develop Oct 23, 2020
@mlocati mlocati deleted the git-skip-worktree branch October 23, 2020 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants