Skip to content

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

Description

@ericsunplus

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?

Activity

  1. Byron commented on Jun 13, 2020

    @Byron
    Member

    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

  2. ericsunplus commented on Jun 21, 2020

    @ericsunplus
    Author

    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 :)

  3. reopened this on Feb 26, 2021
  4. locked and limited conversation to collaborators on Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions