From: Junio C Hamano <junkio@cox.net>
To: Peter Baumann <waste.manager@gmx.de>
Cc: Julian Phillips <julian@quantumfyre.co.uk>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pack-refs: dereference .git/packed-refs if it is a symlink
Date: Sat, 21 Apr 2007 13:05:50 -0700 [thread overview]
Message-ID: <7vk5w5trvl.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20070420165256.GA14318@xp.machine.xx> (Peter Baumann's message of "Fri, 20 Apr 2007 18:52:56 +0200")
Peter Baumann <waste.manager@gmx.de> writes:
> git-new-workdir creates a new working directory where everything
> necessary, including .git/packed-refs, is symlinked to your master repo.
> But git-pack-refs breaks the symlink, so you could accidentally loose some
> refs.
>
> This fixes git-pack-refs to first dereference .git/packed-refs if it is a
> symlink. While we are it, add some tests to prevent this from happening
> again.
Because you are only fixing the case where the worktree is
borrowing the packed-refs file from a real repository with a
symlink trick, and we do not know if somebody had his
packed-refs as a symlink to some random place for reasons other
than creating a lightweight worktree (maybe there was a
mistake), I am wondering if it makes sense to be more strict
about the value we read from readlink().
For example, if it does not end with "/packed-refs", doesn't it
suggest that the reason because the symlink is there is
different from the case you are handling (i.e. it is not a
packed-refs symlink in a lightweight worktree that points at the
corresponding real repository)? I wonder if in such a case we
would want to signal an error, instead of overwriting whatever
real file the symlink points at. Or is it too strict and
paranoid? I dunno.
next prev parent reply other threads:[~2007-04-21 20:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 16:17 [BUG] git-new-workdir doesn't understand packed refs Peter Baumann
2007-04-17 21:55 ` Julian Phillips
2007-04-18 5:52 ` Peter Baumann
2007-04-18 7:26 ` Julian Phillips
2007-04-18 7:40 ` Junio C Hamano
2007-04-18 8:11 ` Peter Baumann
2007-04-18 11:55 ` Julian Phillips
2007-04-18 16:23 ` Junio C Hamano
2007-04-18 17:43 ` Peter Baumann
2007-04-18 18:17 ` Junio C Hamano
2007-04-18 18:31 ` Peter Baumann
2007-04-18 18:42 ` Junio C Hamano
2007-04-18 21:08 ` Peter Baumann
2007-04-18 21:31 ` Junio C Hamano
2007-04-19 5:35 ` [PATCH] Add test for symlinked .git/packed-refs Peter Baumann
2007-04-19 6:06 ` Junio C Hamano
2007-04-20 16:52 ` [PATCH] pack-refs: dereference .git/packed-refs if it is a symlink Peter Baumann
2007-04-21 20:05 ` Junio C Hamano [this message]
2007-04-18 18:43 ` [BUG] git-new-workdir doesn't understand packed refs Julian Phillips
2007-04-18 10:28 ` [PATCH] pack-refs: dereference .git/packed-refs if it is a symlink Peter Baumann
2007-04-18 16:09 ` Linus Torvalds
2007-04-18 17:47 ` Peter Baumann
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=7vk5w5trvl.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=julian@quantumfyre.co.uk \
--cc=waste.manager@gmx.de \
/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).