git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <junkio@cox.net>
Cc: Bill Lear <rael@zopyra.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	git@vger.kernel.org
Subject: Re: Error converting from 1.4.4.1 to 1.5.0?
Date: Wed, 14 Feb 2007 23:32:17 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.63.0702142321390.22628@wbgn013.biozentrum.uni-wuerzburg.de> (raw)
In-Reply-To: <7vire4l76a.fsf@assigned-by-dhcp.cox.net>

Hi,

On Wed, 14 Feb 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Wed, 14 Feb 2007, Junio C Hamano wrote:
> >
> >> By the way, I sometimes think it might be worth doing this:
> >> 
> >> 	$ chmod a-r .git/
> >> 
> >> We always access files by explicit paths and never ask "ls .git/foo*" to 
> >> find what are under .git/ directory.
> >
> > If so, please make it unconfigurable. I use tab-completion in the git 
> > directory quite often.
> 
> Do you mean "configurable"?

No. I meant "unconfigurable", since the sane default _would_ be a-r.

But then, I see that I was silly. This chmod is done on git-init time, and 
easy to undo _if_ you want it.

So, colour me a supporter of that feature.

> I wonder what you are doing inside .git directory in the first place.  
> I never chdir() into it myself, but that may be because I practicaly 
> live inside Emacs.

:-) Lucky you. Since long time, I became a vi user, not out of fun, but 
out of necessity. I had to work on many machines which had vi installed, 
but not emacs. On some, my quota was not large enough to compile the 
beast, so I eventually gave in.

Back to the subject: Sometimes I just want to look if a certain file is 
present. But I cannot be bothered to really type out ".git/index.lock", 
but rather I do ".g<TAB>/i<TAB>.<TAB>"...

Anyway, here is a minimal (completely untested) patch to do what you 
proposed:

-- snipsnap --

[PATCH] init: create GIT_DIR non-readable

We access all files in GIT_DIR by name, so we do not really need it to be 
readable. However, it is less easy to corrupt the repository 
unintentionally when it is not readable.

Those who want to be able to see the contents of GIT_DIR, always can just 
do a `chown u+r $GIT_DIR`.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

 builtin-init-db.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-init-db.c b/builtin-init-db.c
index 12e43d0..8496269 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -18,7 +18,7 @@
 
 static void safe_create_dir(const char *dir, int share)
 {
-	if (mkdir(dir, 0777) < 0) {
+	if (mkdir(dir, share ? 0777 : 0333) < 0) {
 		if (errno != EEXIST) {
 			perror(dir);
 			exit(1);

  reply	other threads:[~2007-02-14 22:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 16:12 Error converting from 1.4.4.1 to 1.5.0? Bill Lear
2007-02-14 17:07 ` Bill Lear
2007-02-14 17:15 ` Junio C Hamano
2007-02-14 17:20   ` Bill Lear
2007-02-14 17:45     ` Junio C Hamano
2007-02-14 20:49       ` Bill Lear
2007-02-14 20:58         ` Bill Lear
2007-02-14 21:19           ` Linus Torvalds
2007-02-14 21:40             ` Bill Lear
2007-02-14 21:47               ` Junio C Hamano
2007-02-14 21:52                 ` Junio C Hamano
2007-02-14 22:04                   ` Johannes Schindelin
2007-02-14 22:13                     ` Junio C Hamano
2007-02-14 22:32                       ` Johannes Schindelin [this message]
2007-02-15  0:41                       ` Jakub Narebski
2007-02-15  0:54                       ` Olivier Galibert
2007-02-15  1:36                         ` Johannes Schindelin
2007-02-14 22:02               ` Johannes Schindelin
2007-02-14 22:27               ` Nicolas Pitre
2007-02-14 22:41                 ` Bill Lear
2007-02-15  1:18                   ` OT: data destruction classics (was: Re: Error converting from 1.4.4.1 to 1.5.0?) Simon 'corecode' Schubert
2007-02-15  2:13                     ` Shawn O. Pearce
2007-02-15  2:51                       ` Linus Torvalds
2007-02-15 10:24                         ` Johannes Schindelin
2007-02-15 13:13                           ` Michael K. Edwards
2007-02-15 11:58                         ` Bill Lear
2007-02-15  9:13                     ` Andy Parkins
2007-02-15 14:30                       ` Mark Wooding
2007-02-14 23:24                 ` Error converting from 1.4.4.1 to 1.5.0? Linus Torvalds
2007-02-14 23:03               ` Linus Torvalds
2007-02-15  8:40               ` Uwe Kleine-König
2007-02-14 21:12         ` Junio C Hamano
2007-02-14 21:18           ` Bill Lear
2007-02-14 21:14         ` Nicolas Pitre
2007-02-14 21:32         ` Junio C Hamano
2007-02-14 18:19     ` Linus Torvalds
2007-02-14 18:42       ` Linus Torvalds
2007-02-14 21:13       ` Bill Lear
2007-02-14 21:35         ` Linus Torvalds

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=Pine.LNX.4.63.0702142321390.22628@wbgn013.biozentrum.uni-wuerzburg.de \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=rael@zopyra.com \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).