git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Doug Glidden <41mortimer@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git fast-export not preserving executable permissions?
Date: Thu, 30 Apr 2020 05:42:31 +0200	[thread overview]
Message-ID: <20200430034230.smqu3ai5nx3ewbdq@tb-raspi4> (raw)
In-Reply-To: <CAHTRwmjXXYAU_LTBF_9sX1CXFnGyHsu5_KHuCp1rB76-4zn=Gg@mail.gmail.com>

On Wed, Apr 29, 2020 at 09:36:31AM -0400, Doug Glidden wrote:
> Hello Git world!
>
> I have run into an issue that I cannot seem to resolve with git
> fast-export. When running a fast-export on a repo that contains
> scripts with executable permissions (e.g. a gradlew script), the
> resulting export does not properly reflect the executable permissions
> on the script files.
>
> To illustrate this issue, I created a small sample repo, with one
> executable file and one non-executable file. From the output below,
> you can see that the mode in the output from fast-export is the same
> for both files; according to the documentation for fast-import, the
> mode for the executable file should be 100755 instead of 100644.
>
>     $ ls -gG
>     total 2
>     -rwxr-xr-x 1 106 Apr 29 09:13 executable_script.sh*
>     -rw-r--r-- 1  63 Apr 29 09:12 non_executable_file.txt

What does
git ls-files -s
give you here ?
We need to know, how Git tracks the files, is it
100644 or 100755 ?

The following works for me:

user@pc:/tmp/fff> git init
Initialized empty Git repository in /private/tmp/fff/.git/
user@pc:/tmp/fff> echo file1 >file1
user@pc:/tmp/fff> git config core.filemode false
user@pc:/tmp/fff> echo file2 >file2
user@pc:/tmp/fff> git add file1 file2
user@pc:/tmp/fff> git ls-files -s
100644 e2129701f1a4d54dc44f03c93bca0a2aec7c5449 0       file1
100644 6c493ff740f9380390d5c9ddef4af18697ac9375 0       file2
user@pc:/tmp/fff> git update-index --chmod=+x file2
user@pc:/tmp/fff> git ls-files -s
100644 e2129701f1a4d54dc44f03c93bca0a2aec7c5449 0       file1
100755 6c493ff740f9380390d5c9ddef4af18697ac9375 0       file2
user@pc:/tmp/fff> git commit -m "Add file1 file2"
[master (root-commit) f75926e] Add file1 file2
 2 files changed, 2 insertions(+)
  create mode 100644 file1
  create mode 100755 file2

user@pc:/tmp/fff> git fast-export --all
blob
mark :1
data 6
file1

blob
mark :2
data 6
file2

reset refs/heads/master
commit refs/heads/master
mark :3
author Torsten Bögershausen <tboegi@web.de> 1588217922 +0200
committer Torsten Bögershausen <tboegi@web.de> 1588217922 +0200
data 16
Add file1 file2
M 100644 :1 file1
M 100755 :2 file2


      parent reply	other threads:[~2020-04-30  3:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 13:36 git fast-export not preserving executable permissions? Doug Glidden
2020-04-29 18:49 ` Taylor Blau
2020-05-01 13:35   ` Doug Glidden
2020-05-01 22:32     ` Taylor Blau
2020-05-04 14:23       ` Johannes Schindelin
2020-04-30  3:42 ` Torsten Bögershausen [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200430034230.smqu3ai5nx3ewbdq@tb-raspi4 \
    --to=tboegi@web.de \
    --cc=41mortimer@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).