git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
	Karthik Nayak <karthik.188@gmail.com>
Subject: Re: What's cooking in git.git (Feb 2024, #02; Fri, 2)
Date: Tue, 6 Feb 2024 13:56:43 +0000	[thread overview]
Message-ID: <a94a5ddf-c36f-4125-96b4-a4534b67d762@gmail.com> (raw)
In-Reply-To: <xmqqjznimrbe.fsf@gitster.g>

Hi Junio

On 05/02/2024 23:20, Junio C Hamano wrote:
> Phillip Wood <phillip.wood123@gmail.com> writes:
> 
>> I'm concerned that the UI could use some improvement. If I understand
>> correctly the proposal is to make
>>
>> 	git for-each-ref
>>
>> and
>>
>> 	git for-each-ref ""
>>
>> behave differently so that the latter prints the pseudorefs from the
>> current worktree and the former does not.
> 
> I would actually think that is perfectly sensible.  The optional
> arguments for-each-ref name "filtering patterns" and you can view
> the behaviour of the command as using "refs/" as the default
> filtering pattern when nothing is given.  But it is easy to defeat
> the unfortunate and historical default filtering pattern, by saying
> "we do not limit to any hierarchy, anything goes" by giving "" as
> the prefix.

There is a logic to that if one ignores 
"refs/{main-worktree,worktrees/$worktree}/*" not being shown. As Patrick 
has pointed out the change in the handling of the empty prefix here is a 
breaking change though [1]. To me, the handling of the empty prefix 
feels inconsistent with the rest of the pattern space. The patterns "*" 
and "*_HEAD" don't match anything and there is no way to filter a subset 
of pseudorefs. If all we want is a way to show all the refs including 
pseudorefs in a worktree then I think an option to do that which errored 
out if a pattern is given would be a better approach. I'd prefer an 
option (say "--include-pseudorefs") that included pseudorefs in the list 
of refs to be filtered and allowed the user to filter them as they 
wanted. That way we could later add a "--all-worktrees" option that 
included refs/{main-worktree,worktrees/$worktree} in the list of refs to 
be filtered as well.

Best Wishes

Phillip

[1] https://lore.kernel.org/git/ZcHEmyvvMR_b_Idl@tanuki/



  reply	other threads:[~2024-02-06 13:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03  8:23 What's cooking in git.git (Feb 2024, #02; Fri, 2) Junio C Hamano
2024-02-05 18:57 ` Phillip Wood
2024-02-05 23:20   ` Junio C Hamano
2024-02-06 13:56     ` Phillip Wood [this message]
2024-02-05 22:39 ` Taylor Blau

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=a94a5ddf-c36f-4125-96b4-a4534b67d762@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    /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).