git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Suggestion: Allow .gitattributes to specify executable mode

From
Ssome-java-user-99206970363698485155@vodafonemail.de <some-java-user-99206970363698485155@vodafonemail.de>
Date
Oct 17, 2021, 20:56 UTC
Message-ID
<a5a41a53a50448a0829dc3bb8681f5bc@vodafonemail.de>
Hello,

some build systems have script files with certain specific names which are always intended to be executable. For example Gradle has a `gradlew` file, and Maven has a (currently unofficial) `mvnw` file.

For Windows users these script files often cause problems when checked in with Git and used by a CI (continuous integration) system running Linux. The CI build usually fails because the script files do not have the executable flag set (Windows does not have this concept).

Would it be possible to extend the `.gitattributes` file to allow specifying that files should automatically get the executable flag when added to the index? For example Gradle's `gradle init` command already creates a `.gitattributes` file; it could then add such a default entry to ease development for Windows users to make sure they add the `gradlew` script file with the correct file mode.

Assuming the flag is called `exec`, Gradle could then create the following `.gitattributes` entry: ``` gradlew text exec ```

It might also help with questions such as https://stackoverflow.com/q/14267441.
What do you think?

My C knowledge is rather limited, and I am not familiar with the Git source, so unfortunately I cannot submit a patch for this.

Kind regards
Next: brian m. carlson
Message 1 of 2 in “Suggestion: Allow .gitattributes to specify executable mode”
  1. some-java-user-99206970363698485155@vodafonemail.deOct 17, 2021
  2. brian m. carlsonOct 17, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.