8000 Ignore submodules running `git status` by clemens-tolboom · Pull Request #3918 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Ignore submodules running git status #3918

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

Conversation

clemens-tolboom
Copy link
Contributor
Q A
Doc fix? no
New docs? no
Applies to
Fixed tickets

When doing

symfony-docs$ git st
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

    modified:   _exts (untracked content)

no changes added to commit (use "git add" and/or "git commit -a")

the directory _exts should not get listed.

The patch is based on http://stackoverflow.com/questions/5127178/gitignore-files-added-inside-git-submodules ... ready that issue there is another option dirty.

Not sure what's best so:

  • choose between dirty and untracked

@stof
Copy link
Member
stof commented Jun 8, 2014

what are the untracked files being created in the submodule ?

@clemens-tolboom
Copy link
Contributor Author
symfony-docs/_exts$ git status
HEAD detached at 6fea4b1
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    sensio/__init__.pyc
    sensio/sphinx/__init__.pyc
    sensio/sphinx/configurationblock.pyc
    sensio/sphinx/phpcode.pyc
    sensio/sphinx/refinclude.pyc

nothing added to commit but untracked files present (use "git add" to track)

@stof
Copy link
Member
stof commented Jun 8, 2014

a much better fix is to add the .pyc files to the gitignore of the extension repo, as these files should never be committed in it. The repo is at https://github.com/fabpot/sphinx-php

@clemens-tolboom
Copy link
Contributor Author

Will do.

@wouterj
Copy link
Member
wouterj commented Jun 8, 2014

Then we can close this one, thanks @clemens-tolboom for taking care of this!

@wouterj wouterj closed this Jun 8, 2014
@stof
Copy link
Member
stof commented Jun 8, 2014

once the change is merged in sphinx-php, there will still be a need to update the submodule to the fixed version

@clemens-tolboom clemens-tolboom deleted the feature/ignore-submodule branch June 8, 2014 15:26
@xabbuh
Copy link
Member
xabbuh commented Jun 8, 2014

@stof Are you sure? The .gitmodules doesn't mention any exact version.

@stof
Copy link
Member
stof commented Jun 8, 2014

@xabbuh the .gitmodules file is only half of the definition of a submodule for Git (it is the url to get it used when running git submodule init, which can be altered locally if you prefer. the target of the submodule is defined by git as a special kind of object for the /_exts path. If you look at the github tree, you will see that it displays the commit targetted by the submodule: https://github.com/symfony/symfony-docs

@stof
Copy link
Member
stof commented Jun 8, 2014

if you want a comparison between git submodules and composer, git submodule update is the equivalent of composer install: it updates the local working directory to match the locked version.
for submodules, updating the locked version to a different commit (what composer update does) looks like this:

$ cd _exts
$ git fetch
$ git checkout <newref>
$ cd ..
$ git add _exts
$ git commit -m 'Updating the vendor'

@xabbuh
Copy link
Member
xabbuh commented Jun 8, 2014

That makes sense. Thanks for the great explanation @stof.

@stof
Copy link
Member
stof commented Jun 8, 2014

and if you missed it, the PR is now merged in the extensions

@clemens-tolboom
Copy link
Contributor Author

Awesome explanation. Thanks @stof

weaverryan added a commit that referenced this pull request Jun 9, 2014
This PR was merged into the 2.3 branch.

Discussion
----------

update fabpot Sphinx extensions version

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

As described by @stof in #3918 this pull requests updates the Sphinx extensions to the version that ignores ``*.pyc`` files.

Commits
-------

62b6185 update fabpot Sphinx extensions version
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.

4 participants
0