Git development
 help / color / mirror / Atom feed
From: "Dirk Süsserott" <newsletter@dirk.my1.cc>
To: Git Mailing List <git@vger.kernel.org>
Subject: [msysGit] Windows & executable bit for newly created files
Date: Thu, 15 Dec 2011 21:07:35 +0100	[thread overview]
Message-ID: <4EEA5387.5020808@dirk.my1.cc> (raw)

Hi,

I sometimes write new (shell/perl) scripts under Windows whithin
msysGit's bash. An "ls -l" shows them as executable:

$ ls -l

    -rwxr-xr-x  ...  11 Dec 15 20:33 test.sh

Ok, "ls" just *pretends* they have the bit set (I think it just peeks
for the she-bang line).

Adding the file and looking at the patch gives:

$ git add test.sh
$ git diff --cached

    diff --git a/test.sh b/test.sh
    new file mode 100644
    index 0000000..13f4793
    --- /dev/null
    +++ b/test.sh
    @@ -0,0 +1,2 @@
    +#!/bin/sh
    +

Is there a way to convince git that the new mode is 755 instead of 644,
even with core.filemode set to false? So that the mode is correct when I
checkout the file under Linux later on?

My impression is that when git once knows the file has 755, it remembers
that. I'd like to avoid those commits (made under Linux) with "chmod +x
for scripts newly created under Windows".

Sometimes I create a script under Windows, add and commit it, create a
patch (git-format-patch), edit the patch (644 -> 755), reset the branch,
and finally git-am the patch. It works but is not particularly convenient.

Is there sth. like

$ git add --filemode=755 <filepattern>   ?


Cheers,
    Dirk

             reply	other threads:[~2011-12-15 20:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 20:07 Dirk Süsserott [this message]
2011-12-15 20:56 ` [msysGit] Windows & executable bit for newly created files Junio C Hamano
2011-12-16 18:27   ` Dirk Süsserott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EEA5387.5020808@dirk.my1.cc \
    --to=newsletter@dirk.my1.cc \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox