* Producing tar file with 666/777 permissions
@ 2006-03-04 4:25 Matt McCutchen
2006-03-04 5:03 ` Junio C Hamano
2006-03-04 5:35 ` [PATCH] tar-tree: file/dirmode fix Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Matt McCutchen @ 2006-03-04 4:25 UTC (permalink / raw)
To: git
Dear GIT people,
How do I package a git repository in a tar file with 666 and 777
embedded permissions? There's evidently some way to do it because the
Linux kernel source packages have 666 and 777 embedded permissions, but
git-tar-tree gives me a tar file with 644 and 755 permissions and
there's no obvious way to tell it to do otherwise.
There was lots of discussion on the mailing list about what permissions
to preserve when copying in and out of repositories (I obviously side
with those who want a single execute bit), but I could not find any
mention of permission issues in reference to git-tar-tree.
Please reply to me as I am off-list.
--
Matt McCutchen
hashproduct@verizon.net
http://hashproduct.metaesthetics.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Producing tar file with 666/777 permissions
2006-03-04 4:25 Producing tar file with 666/777 permissions Matt McCutchen
@ 2006-03-04 5:03 ` Junio C Hamano
2006-03-04 5:35 ` [PATCH] tar-tree: file/dirmode fix Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2006-03-04 5:03 UTC (permalink / raw)
To: Matt McCutchen; +Cc: git
Matt McCutchen <hashproduct@verizon.net> writes:
> Dear GIT people,
>
> How do I package a git repository in a tar file with 666 and 777
> embedded permissions? There's evidently some way to do it because the
> Linux kernel source packages have 666 and 777 embedded permissions, but
> git-tar-tree gives me a tar file with 644 and 755 permissions and
> there's no obvious way to tell it to do otherwise.
Ouch, thanks for reporting this. You have spotted a recent
regression.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] tar-tree: file/dirmode fix.
2006-03-04 4:25 Producing tar file with 666/777 permissions Matt McCutchen
2006-03-04 5:03 ` Junio C Hamano
@ 2006-03-04 5:35 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2006-03-04 5:35 UTC (permalink / raw)
To: git; +Cc: Matt McCutchen
This fixes two bugs introduced when we switched to generic tree
traversal code.
(1) directory mode recorded silently became 0755, not 0777
(2) if passed a tree object (not a commit), it emitted an
alarming error message (but proceeded anyway).
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
tar-tree.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
815afaf1bd0ddf419231d2d9f129260ce1ddbecc
diff --git a/tar-tree.c b/tar-tree.c
index e85a1ed..e478e13 100644
--- a/tar-tree.c
+++ b/tar-tree.c
@@ -304,9 +304,11 @@ static void write_header(const unsigned
}
if (S_ISDIR(mode))
- mode |= 0755; /* GIT doesn't store permissions of dirs */
- if (S_ISLNK(mode))
- mode |= 0777; /* ... nor of symlinks */
+ mode |= 0777;
+ else if (S_ISREG(mode))
+ mode |= (mode & 0100) ? 0777 : 0666;
+ else if (S_ISLNK(mode))
+ mode |= 0777;
sprintf(&header[100], "%07o", mode & 07777);
/* XXX: should we provide more meaningful info here? */
@@ -391,7 +393,7 @@ int main(int argc, char **argv)
usage(tar_tree_usage);
}
- commit = lookup_commit_reference(sha1);
+ commit = lookup_commit_reference_gently(sha1, 1);
if (commit) {
write_global_extended_header(commit->object.sha1);
archive_time = commit->date;
--
1.2.4.gfe04
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-04 5:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-04 4:25 Producing tar file with 666/777 permissions Matt McCutchen
2006-03-04 5:03 ` Junio C Hamano
2006-03-04 5:35 ` [PATCH] tar-tree: file/dirmode fix Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox