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

index.add() method add support for "chmod=+x" #1021

Closed
ericsunplus opened this issue Jun 12, 2020 · 2 comments
Closed

index.add() method add support for "chmod=+x" #1021

ericsunplus opened this issue Jun 12, 2020 · 2 comments
Labels
Q&A

Comments

@ericsunplus
Copy link

@ericsunplus ericsunplus commented Jun 12, 2020

On Windows OS, if you have a unix file with permission 100755 -rwxr-xr-x, after git add, the staged file will miss the x permission and becomes 100644 -rw-r--r-- as shown in git ls-files --stage. git add has the option `--chmod=+x' to handle this problem. Can gitpython also add this feature in index.add() method?

@Byron Byron added the Q&A label Jun 13, 2020
@Byron
Copy link
Member

@Byron Byron commented Jun 13, 2020

Unless you explicitly require GitPython for 'plumbing', it is recommended to use Repo(path).git.add(…, chmod='+x'), which supports all flags that git supports. You can read more about that in the respective section of the docs.

Even though I am closing this issue assuming you don't actually need plumbing, please let me know if you do which would make this a feature request or bugfix. Thank you

@Byron Byron closed this Jun 13, 2020
@ericsunplus
Copy link
Author

@ericsunplus ericsunplus commented Jun 21, 2020

Thank you Byron. I actually used the repo.git.add as a solution and it works well. I was just thinking index.add is more like a native solution for GitPython and expect to be as versatile as git shell command. Up to you to judge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.