All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Cc: git@vger.kernel.org, Michael Cronenworth <mike@cchtml.com>
Subject: Re: git-cvsserver strips exec bit
Date: Tue, 10 Sep 2013 10:02:26 -0700	[thread overview]
Message-ID: <xmqqa9jkzk2l.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <522F397E.6080709@cchtml.com> (Michael Cronenworth's message of "Tue, 10 Sep 2013 10:23:42 -0500")

Michael Cronenworth <mike@cchtml.com> writes:

> On git 1.8.1.x (Fedora 18) I was able to use the git-cvsserver to checkout code
> to package into a tarball. Script files that were in git with 755 masks were
> checked-out with the same mask. After upgrading the git repository machine to
> Fedora 19 (1.8.3.1) the behaviour has changed. When I checkout the same script
> files their mask is now 644. The mask has not changed in git.

Matthew, I do not know if you are still using the git-cvsserver, but
it seems that the only substantial change to that subsystem between
the 1.8.1.x and 1.8.3.x is your update.

Especially 2c3af7e7 (cvsserver: factor out git-log parsing logic,
2012-10-13) looks interesting.  It has a hunk like this:

-                my $git_perms = "";
-                $git_perms .= "r" if ( $mode & 4 );
-                $git_perms .= "w" if ( $mode & 2 );
-                $git_perms .= "x" if ( $mode & 1 );
-                $git_perms = "rw" if ( $git_perms eq "" );
+                my $dbMode = convertToDbMode($mode);

with the definition of convertToDbMode being:

+sub convertToDbMode
+{
+    my $mode = shift;
+    ...
+    $mode=~/^\d\d(\d)\d{3}$/;
+    my $userBits=$1;
+
+    my $dbMode = "";
+    $dbMode .= "r" if ( $userBits & 4 );
+    $dbMode .= "w" if ( $userBits & 2 );
+    $dbMode .= "x" if ( $userBits & 1 );
+    $dbMode = "rw" if ( $dbMode eq "" );
+
+    return $dbMode;

The $mode in the caller comes from diff-tree output (the post-change
side of the mode string, like "100755").

Picking the third digit from the left (i.e. "10'0'755"), instead of
the tail digit (i.e. "10075'5'"), looks strange.

Side note: now I look at it, the original does not make much sense
for that matter.  "100755" & 4 is different from oct("100755") & 4.

  reply	other threads:[~2013-09-10 17:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 15:23 git-cvsserver strips exec bit Michael Cronenworth
2013-09-10 17:02 ` Junio C Hamano [this message]
2013-09-10 20:11   ` Junio C Hamano
2013-09-10 22:20     ` Michael Cronenworth
2013-09-10 22:22       ` Michael Cronenworth
2013-09-10 22:33         ` Junio C Hamano
2013-09-11 13:12           ` Michael Cronenworth

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=xmqqa9jkzk2l.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mike@cchtml.com \
    --cc=mmogilvi_git@miniinfo.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.