Skip to content

Commit

Permalink
Remove docs about light-weight packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jan 7, 2013
1 parent bf32869 commit b34220e
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions doc/02-libraries.md
Expand Up @@ -115,33 +115,6 @@ on it. It only has an effect on the main project.
If you do not want to commit the lock file and you are using git, add it to
the `.gitignore`.

## Light-weight distribution packages

Some useless information like `.travis.yml`, or large examples should typically
not be included in distributed packages.

The `.gitattributes` file is a git specific file like `.gitignore` also living
at the root directory of your library. It overrides local and global
configuration (`.git/config` and `~/.gitconfig` respectively) when present and
tracked by git.

Use `.gitattributes` to prevent unwanted files from bloating the zip
distribution packages.

// .gitattributes
/demo export-ignore
phpunit.xml.dist export-ignore
/Resources/doc/ export-ignore
.travis.yml export-ignore

Test it by inspecting the zip file generated manually:

git archive branchName --format zip -o file.zip

> **Note:** Files would be still tracked by git just not included in the
> zip distribution. This will only work for GitHub packages installed from
> dist (i.e. tagged releases) for now.
## Publishing to a VCS

Once you have a vcs repository (version control system, e.g. git) containing a
Expand Down

4 comments on commit b34220e

@rogeriopradoj
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @Seldaek, is it available some discussion about this decision (I mean, do not use/or encourage to use .gitattributes to provide light-weight packages)?

I am asking that cause of phpoffice/phpexcel project, particularly its issue 98 and their commit using .gitattributes as the issue solution.

Thanks in advance!

@igorw
Copy link
Contributor

@igorw igorw commented on b34220e Mar 23, 2013

Choose a reason for hiding this comment

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

@rogeriopradoj This was mostly discussed in the context of symfony at symfony/symfony#6605. We decided to encourage including tests and docs as part of the zip distribution (since they are useful during development), and allow users to strip them as part of their own deployment process.

@rogeriopradoj
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, thanks @igorw, I can see your point.

After a long analysis, I could probably say that the problem there at https://github.com/phpoffice/phpexcel it the lack of tags in composer way. I will definitely suggest @MarkBaker to focus on retagging the releases.

Thanks again!

@smuuf
Copy link

@smuuf smuuf commented on b34220e Mar 14, 2024

Choose a reason for hiding this comment

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

I found this commit when trying to discover why the (as I understand it) feature of Composer ignoring files (...or not packing? Is even git archive involved somehow? I don't know; It's not in the docs...) marked by export-ignore in .gitattributes is completely undocumented.

Please, mention this functionality in Composer's documentation somehow.

We decided to encourage including tests and docs as part of the zip distribution.

You can encourage (although you don't can't know how big my docs/ might be and how much I'd really want to exclude it from my package's dist), but you don't have to hide an important piece of functionality because of that. And I had to go through some old and obscure and old of the internets to find out about this. I'd prefer to have this useful information available in Composer's documentation.

Please sign in to comment.