-
-
Notifications
You must be signed in to change notification settings - Fork 954
index.add() method add support for "chmod=+x" #1156
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
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
Replies: 2 comments
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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 :)
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1