From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
GIT Mailing-list <git@vger.kernel.org>,
"Hart, Darren" <darren.hart@intel.com>,
"Ashfield, Bruce" <Bruce.Ashfield@windriver.com>
Subject: Re: Alternates corruption issue
Date: Tue, 31 Jan 2012 17:42:40 -0500 [thread overview]
Message-ID: <20120131224240.GA3844@sigill.intra.peff.net> (raw)
In-Reply-To: <20120131222258.GG13252@burratino>
On Tue, Jan 31, 2012 at 04:22:58PM -0600, Jonathan Nieder wrote:
> Forgetting the algorithms:
>
> (A) means "find what repository we are in the worktree for, or,
> barring that, what bare repository we are in".
>
> (B) means "find which repository the user pointed to. To be extra
> nice, we allow a '.git' extension to be left out, so the URL used
> doesn't have to include the redundant information that this is a
> git repository, and we even allow pointing to the toplevel of a
> worktree instead of a repository, too."
I can see that as a plausible interpretation. But I think your "means"
is kind of vague. In other words, we are assigning a meaning that is
not actually documented anywhere, and which we are hoping matches user
expectations. So the correct behavior kind of depends on your mental
model. IOW, I find your mental model plausible, but it is not the one
that I had.
But like I said, I'm OK either way. I'll prepare this fix with the least
behavior change possible. Then doing your change on top should be a
trivial rearrangement of the lookup arrays (the "hard" part for your
proposed change is adding in the is_git_directory() calls[1], but I'll
do that as part of mine).
> I admit part of the reason I care is that just putting "" first would
> probably taken care of the more important part of
> <http://bugs.debian.org/399041>.
Would that fix it? If I understand it, the repo in question is bare with
a ".git" directory inside it. Your proposed change would make "git
ls-remote foo" work, but wouldn't "cd foo && git log" still be broken?
At the very least, it would show a completely different repo than
ls-remote.
-Peff
[1] Without the is_git_directory() check, the ordering you propose
breaks things very badly. Because if I point to a non-bare directory
"foo", we say "OK, foo exists" and never look at "foo/.git". So
instead, we have to say "OK, foo exists, but hey, it looks nothing
like a .git directory" and keep trying.
next prev parent reply other threads:[~2012-01-31 22:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 14:05 Alternates corruption issue Richard Purdie
2012-01-31 19:39 ` Jeff King
2012-01-31 20:25 ` Junio C Hamano
2012-01-31 20:44 ` Jeff King
2012-01-31 21:40 ` Jonathan Nieder
2012-01-31 21:47 ` Jeff King
2012-01-31 21:55 ` Jonathan Nieder
2012-01-31 22:05 ` Jeff King
2012-01-31 22:22 ` Jonathan Nieder
2012-01-31 22:42 ` Jeff King [this message]
2012-01-31 22:59 ` Jonathan Nieder
2012-02-02 21:59 ` Jeff King
2012-02-03 0:47 ` Junio C Hamano
2012-02-03 12:02 ` Jeff King
2012-02-03 17:38 ` Junio C Hamano
2012-02-03 21:29 ` Jeff King
2012-02-03 21:51 ` Junio C Hamano
2012-02-03 21:53 ` Jeff King
2012-02-03 14:40 ` Richard Purdie
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=20120131224240.GA3844@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Bruce.Ashfield@windriver.com \
--cc=darren.hart@intel.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=richard.purdie@linuxfoundation.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).