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

Git auto modified file with phing vendor #613

Closed
tuancode opened this issue Oct 31, 2016 · 4 comments
Closed

Git auto modified file with phing vendor #613

tuancode opened this issue Oct 31, 2016 · 4 comments

Comments

@tuancode
Copy link

tuancode commented Oct 31, 2016

Dear,

I use Ubuntu and install Phing via composer, then I push all the vendor to my git. My friend pull my git to their computer (also run in Ubuntu). Although he pull without modified any previous things, he still get a lot of modified files inside phing vendor. Moreover, he cannot checkout or reset these files. I also reference this article https://help.github.com/articles/dealing-with-line-endings/ to resolve, but it still happened. Below is the different from few files I've tried to check:

diff --git a/vendor/phing/phing/bin/pear-phing b/vendor/phing/phing/bin/pear-phing
index 42916c2..ecfa9e7 100755
--- a/vendor/phing/phing/bin/pear-phing
+++ b/vendor/phing/phing/bin/pear-phing
@@ -2,7 +2,7 @@

------------------------------------------------------------------------

The phing build script for Unix based systems

-# $Id: ecfa9e749f177126fd428080c9dc4419f00f2594 $
+# $Id$

------------------------------------------------------------------------

-------------------------------------------------------------------------

diff --git a/vendor/phing/phing/bin/pear-phing.bat b/vendor/phing/phing/bin/pear-phing.bat
index 14813a0..ede2027 100644
--- a/vendor/phing/phing/bin/pear-phing.bat
+++ b/vendor/phing/phing/bin/pear-phing.bat
@@ -2,7 +2,7 @@

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: The phing build script for Windows based systems
-:: $Id: ede20276d318656862d744a37380a15b08c7f55a $
+:: $Id$
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::----------------------------------------------------------------------------------
diff --git a/vendor/phing/phing/bin/phing b/vendor/phing/phing/bin/phing
index 718a490..3da5a27 100755
--- a/vendor/phing/phing/bin/phing
+++ b/vendor/phing/phing/bin/phing
@@ -3,7 +3,7 @@

/**

  • Shell wrapper for Phing
    • $Id: 3da5a2758ca689a6ee49defabcda5efa6dd70a97 $
    • $Id$
@siad007
Copy link
Member

siad007 commented Oct 31, 2016

@tuanvu-se hello, you should not include vendor in your repository [at]see https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md

@mrook
Copy link
Member

mrook commented Nov 1, 2016

@tuanvu-se from the diff you posted it looks like the .gitattributes file is not populated correctly, see https://github.com/phingofficial/phing/blob/master/.gitattributes for inspiration. But like @siad007 says, I wouldn't include vendor/ in your repository.

@mrook mrook closed this as completed Nov 1, 2016
@tuancode
Copy link
Author

tuancode commented Nov 2, 2016

Hi @siad007 and @mrook,
Thanks for your advices! I also know that I should never include vendor/ to my repository. However, I can't control this behaviour in the situation. Honestly, It is a project of company and I try to resolve the issue for my team.

For the way of @mrook , I've included the information to my .gitattributes repository but it didn't solve problem.
This is my .gitattributes

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
vendor/phing/phing/* ident

This is my steps

  1. Add more config to .gitattributes
  2. Commit .gitattributes file
  3. Remove git index: $git rm --cached -r .
  4. Rewrite the Git index: $git reset --hard.

And the result is not change

(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified: vendor/phing/phing/bin/pear-phing
modified: vendor/phing/phing/bin/pear-phing.bat
modified: vendor/phing/phing/bin/phing
modified: vendor/phing/phing/bin/phing.bat
modified: vendor/phing/phing/bin/phing.php
modified: vendor/phing/phing/build/BuildPhingPEARPackageTask.php
modified: vendor/phing/phing/classes/phing/BuildEvent.php
modified: vendor/phing/phing/classes/phing/BuildException.php
modified: vendor/phing/phing/classes/phing/BuildListener.php
modified: vendor/phing/phing/classes/phing/BuildLogger.php
................................................................

@siad007
Copy link
Member

siad007 commented Nov 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants