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

Re: [PATCH] add: add --chmod=+x / --chmod=-x options

From
Edward Thomson <ethomson@edwardthomson.com>
Date
May 27, 2016, 04:41 UTC
Message-ID
<20160527044112.GA31742@zoidberg>
In-Reply-To
<xmqqh9dm37xk.fsf@gitster.mtv.corp.google.com>
On Wed, May 25, 2016 at 12:36:55AM -0700, Junio C Hamano wrote:
> 
> At the design level, I have a few comments.

Thanks, I will submit a new patch that incorporates your (and dscho's) comments.

Show 6 quoted lines
>  * This is about a repository with core.filemode=0; I wonder if
>    something for a repository with core.symlinks=0 would also help?
>    That is, would it be a big help to users if they can prepare a
>    text file that holds symbolic link contents and add it as if it
>    were a symlink with "git add", instead of having to run two
>    commands, "hash-objects && update-index --cacheinfo"?

I think that this is much less common and - speaking only from personal experience - nobody has ever asked me how to stage a symlink on a Windows machine. I think that this is due to the fact that symlinks on Windows are basically impossible to use, so people doing cross-platform development wouldn't even try.

On the other hand, it's quite common for cross-platform teams to use some scripting language since those do work across platforms, and Windows users would want to add new scripts as executable for the benefit of their brethren on platforms with an executable bit.

>  * I am not familiar with life on filesystems with core.filemode=0;
>    do files people would want to be able to "add --chmod=+x" share
>    common trait that can be expressed with .gitattributes mechanism?

Perhaps... It would not be things like `*.bat` or `*.exe` - Windows gets those as executable "for free" and would not care about adding the execute bit on those files (since they're not executable anywhere else). It would be items like `*.sh` or `*.rb` that should be executable on POSIX platforms.

However I do not think that this is a common enough action that it needs to be made automatic such that when I `git add foo.rb` it is automatically made executable. I think that the reduced complexity of having a single mechanism to control executability (that being the execute mode in the index or a tree) is preferable to a gitattributes based mechanism, at least until somebody else makes a cogent argument that the gitattributes approach would be helpful for them. :)

Thanks again for the comments, an updated patch is forthcoming.
-ed
Previous: Junio C HamanoNext: Mike Hommey
Message 7 of 14 in “add: add --chmod=+x / --chmod=-x options”
  1. add: add --chmod=+x / --chmod=-x optionsEdward Thomson, May 25, 2016
  2. Junio C HamanoMay 25, 2016
  3. Johannes SchindelinMay 25, 2016
  4. Junio C HamanoMay 25, 2016
  5. Johannes SchindelinMay 25, 2016
  6. Junio C HamanoMay 25, 2016
  7. Edward ThomsonMay 27, 2016
  8. Mike HommeyMay 27, 2016
  9. Junio C HamanoMay 27, 2016
  10. Junio C HamanoMay 27, 2016
  11. Edward ThomsonMay 31, 2016
  12. Johannes SchindelinMay 25, 2016
  13. Junio C HamanoMay 27, 2016
  14. Junio C HamanoMay 25, 2016

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.