From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
git@vger.kernel.org, "H . Merijn Brand" <h.m.brand@xs4all.nl>,
"Harald Nordgren" <haraldnordgren@gmail.com>,
"Olga Telezhnaia" <olyatelezhnaya@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH] ref-filter: don't look for objects when outside of a repository
Date: Fri, 16 Nov 2018 14:09:07 +0900 [thread overview]
Message-ID: <xmqq36s1libw.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20181115094320.GA18790@sigill.intra.peff.net> (Jeff King's message of "Thu, 15 Nov 2018 04:43:20 -0500")
Jeff King <peff@peff.net> writes:
> On Thu, Nov 15, 2018 at 04:38:44AM -0500, Jeff King wrote:
>
>> Is SOURCE_NONE a complete match for what we want?
>>
>> I see problems in both directions:
>>
>> - sorting by "objectname" works now, but it's marked with SOURCE_OBJ,
>> and would be forbidden with your patch. I'm actually not sure if
>> SOURCE_OBJ is accurate; we shouldn't need to access the object to
>> show it (and we are probably wasting effort loading the full contents
>> for tools like for-each-ref).
>>
>> However, that's not the full story. For objectname:short, it _does_ call
>> find_unique_abbrev(). So we expect to have an object directory.
>
> Oops, I'm apparently bad at reading. It is in fact SOURCE_OTHER, which
> makes sense (outside of this whole "--sort outside a repo thing").
>
> But we'd ideally distinguish between "objectname" (which should be OK
> outside a repo) and "objectname:short" (which currently segfaults).
Arguably, use of ref-filter machinery in ls-remote, whether it is
given from inside or outside a repo, was a mistake in 1fb20dfd
("ls-remote: create '--sort' option", 2018-04-09), as the whole
point of "ls-remote" is to peek the list of refs and it is perfectly
normal that the objects listed are not available.
"ls-remote --sort=authorname" that is run in a repository may not
segfault on a ref that points at a yet-to-be-fetched commit, but it
cannot be doing anything sensible. Is it still better to silently
produce a nonsense result than refusing to --sort no matter what the
sort keys are, whether we are inside or outside a repository?
next prev parent reply other threads:[~2018-11-16 5:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-22 10:42 Coredump on ls-remote + --sort H.Merijn Brand
2018-09-22 12:33 ` Ævar Arnfjörð Bjarmason
2018-09-22 14:11 ` [PATCH] ref-filter: don't look for objects when outside of a repository SZEDER Gábor
2018-09-24 16:15 ` Junio C Hamano
2018-09-24 18:17 ` Jeff King
2018-09-24 21:20 ` SZEDER Gábor
2018-09-24 21:30 ` Jeff King
2018-09-25 20:57 ` Junio C Hamano
2018-11-14 12:27 ` SZEDER Gábor
2018-11-15 9:38 ` Jeff King
2018-11-15 9:43 ` Jeff King
2018-11-16 5:09 ` Junio C Hamano [this message]
2018-11-16 8:56 ` Jeff King
2018-11-16 10:07 ` Junio C Hamano
2018-11-16 13:16 ` SZEDER Gábor
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=xmqq36s1libw.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=h.m.brand@xs4all.nl \
--cc=haraldnordgren@gmail.com \
--cc=olyatelezhnaya@gmail.com \
--cc=peff@peff.net \
--cc=szeder.dev@gmail.com \
/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).