{"thread":{"id":"29170","subject":"[msysGit] Windows & executable bit for newly created files","startedAt":"2011-12-15T20:07:35Z","lastAt":"2011-12-16T18:27:37Z","messageCount":3,"participants":["Dirk Süsserott","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"181246","messageId":"4EEA5387.5020808@dirk.my1.cc","threadId":"29170","inReplyTo":null,"subject":"[msysGit] Windows & executable bit for newly created files","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2011-12-15T20:07:35Z","receivedAt":"2011-12-15T20:07:35Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Hi,\n\nI sometimes write new (shell/perl) scripts under Windows whithin\nmsysGit's bash. An \"ls -l\" shows them as executable:\n\n$ ls -l\n\n    -rwxr-xr-x  ...  11 Dec 15 20:33 test.sh\n\nOk, \"ls\" just *pretends* they have the bit set (I think it just peeks\nfor the she-bang line).\n\nAdding the file and looking at the patch gives:\n\n$ git add test.sh\n$ git diff --cached\n\n    diff --git a/test.sh b/test.sh\n    new file mode 100644\n    index 0000000..13f4793\n    --- /dev/null\n    +++ b/test.sh\n    @@ -0,0 +1,2 @@\n    +#!/bin/sh\n    +\n\nIs there a way to convince git that the new mode is 755 instead of 644,\neven with core.filemode set to false? So that the mode is correct when I\ncheckout the file under Linux later on?\n\nMy impression is that when git once knows the file has 755, it remembers\nthat. I'd like to avoid those commits (made under Linux) with \"chmod +x\nfor scripts newly created under Windows\".\n\nSometimes I create a script under Windows, add and commit it, create a\npatch (git-format-patch), edit the patch (644 -> 755), reset the branch,\nand finally git-am the patch. It works but is not particularly convenient.\n\nIs there sth. like\n\n$ git add --filemode=755 <filepattern>   ?\n\n\nCheers,\n    Dirk\n"},{"id":"181250","messageId":"7vwr9xmu48.fsf@alter.siamese.dyndns.org","threadId":"29170","inReplyTo":"4EEA5387.5020808@dirk.my1.cc","subject":"Re: [msysGit] Windows & executable bit for newly created files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-15T20:56:39Z","receivedAt":"2011-12-15T20:56:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dirk Süsserott <newsletter@dirk.my1.cc> writes:\n\n> Is there a way to convince git that the new mode is 755 instead of 644,\n> even with core.filemode set to false? So that the mode is correct when I\n> checkout the file under Linux later on?\n\n\"git update-index --chmod=+x\"?\n"},{"id":"181315","messageId":"4EEB8D99.9030302@dirk.my1.cc","threadId":"29170","inReplyTo":"7vwr9xmu48.fsf@alter.siamese.dyndns.org","subject":"Re: [msysGit] Windows & executable bit for newly created files","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2011-12-16T18:27:37Z","receivedAt":"2011-12-16T18:27:37Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 15.12.2011 21:56 schrieb Junio C Hamano:\n> Dirk Süsserott <newsletter@dirk.my1.cc> writes:\n> \n>> Is there a way to convince git that the new mode is 755 instead of 644,\n>> even with core.filemode set to false? So that the mode is correct when I\n>> checkout the file under Linux later on?\n> \n> \"git update-index --chmod=+x\"?\n> \n\nOh, thanks. I wasn't aware of that option. Works exactly as I like.\n\nDirk\n"}]}