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

Re: git-cvsserver strips exec bit

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 10, 2013, 17:02 UTC
Message-ID
<xmqqa9jkzk2l.fsf@gitster.dls.corp.google.com>
In-Reply-To
<522F397E.6080709@cchtml.com>
Michael Cronenworth <mike@cchtml.com> writes:
Show 5 quoted lines
> 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.

Previous: Michael CronenworthNext: Junio C Hamano
Message 2 of 7 in “git-cvsserver strips exec bit”
  1. Michael CronenworthSep 10, 2013
  2. Junio C HamanoSep 10, 2013
  3. Junio C HamanoSep 10, 2013
  4. Michael CronenworthSep 10, 2013
  5. Michael CronenworthSep 10, 2013
  6. Junio C HamanoSep 10, 2013
  7. Michael CronenworthSep 11, 2013

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.