You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
index.add() method add support for "chmod=+x" #1021
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?
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
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 :)
Activity
Byron commentedon 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
ericsunplus commentedon Jun 21, 2020
Thank you Byron. I actually used the
repo.git.addas a solution and it works well. I was just thinkingindex.addis more like a native solution for GitPython and expect to be as versatile as git shell command. Up to you to judge :)