git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>,
	Git <git@vger.kernel.org>
Subject: Re: [PATCH] builtin/remote.c: teach `-v` to list filters for promisor remotes
Date: Sun,  1 May 2022 21:27:25 +0530	[thread overview]
Message-ID: <20220501155725.93866-1-chakrabortyabhradeep79@gmail.com> (raw)
In-Reply-To: <xmqqczgy6zk5.fsf@gitster.g>

Sorry for the late response.

Junio C Hamano <gitster@pobox.com> wrote:

> Three comments and a half on the code:
>
>  - Is it likely that to new readers it would be obvious that what is
>    in the [square brackets] is the list-objects-filter used?  When we
>    want to add new kinds of information other than the URL and the
>    list-objects-filter, what is our plan to add them? 

I do think that new readers can easily understand the meaning of the
text inside the [square brackets]. These square brackets (with the
list-objects-filter inside it) will be shown only if the remote is
a promisor remote. So, users who don't use promisor remotes, will not
be affected. Those who used the filters can only notice the change.
They can easily understand it. In fact, I think it would give them an
option to quickly check which are the promisor remotes and which are not.
Though this change should be properly documented (which I forgot to
add) so that they can be sure about it.

>  - The presentation order is <remote-name> then <direction> (fetch
>    or push) and then optionally <list-objects-filter>.
>
>    (a) shouldn't the output format be described in the
>        doucmentation?
>
>    (b) does it make sense to append new information like this, or
>        is it more logical to keep the <direction> at the end?

Yeah, it should be documented. I forgot it :|
Will add it in the next version.

I think it is better to keep <list-objects-filter> at the end.
Because I think, people first want to check whether the remote
is (fetch) or (push). After that, they might want to know about the
filter. Another point is that <list-objects-filter> is optional
(i.e. only for promisor remotes). It would not make sense to put an
optional info in between two permanent info (in this case,
<remote-name> and <direction>). It would be difficult for scripts
which parse the output of `git remote -v` on the basis of string
positions.

>  - Now url_buf no longer contains the url of the remote, but it still
>    is called url_buf.  It is merely a "temporary string" now.  Is it
>    a good idea to either rename it, stop reusing the same thing for
>    different purposes, or do something else?

Hmm, this can be a subject for discussion. Yes, it is true that the
name `url_buf` is not suitable for the additional info it contains ( in
the proposed change). I did it to use less memory. I think renaming it
to `remote_info_buf` or similar is a better idea.

>  - By adding this unconditionally, we would break the scripts that
>    read the output from this command and expect there won't be extra
>    information after the <direction>.  It may be a good thing (they
>    are not prepared to see the list-objects-filter, and the breakage
>    may serve as a reminder that they need to update these scripts
>    when they see breakage), or it may be an irritating regression.

I agree. Frankly speaking, I have no counter argument for this. I can
tell that the proposed change will be beneficial for the users who use
promisor remotes along with other remotes. So, may be we can accept the
short term consequences of it. What we can do is we can provide a proper
documentation so that if anything bad happen to those scripts, devs can
see the documentation and update the scripts accordingly.

> But stepping back a bit.
>
> Why do we want to give this in the "remote -v" output in the first
> place?  When a reader really cares, they can ask "git config" for
> this extra piece of information.  When you have more than one
> remote, "git remote -v" that gives the URL is a good way to remind
> which nickname you'd want to give to "git pull" or "git push".

`remote -v` helps users to get the overall idea of the remotes. We can
see how many remotes are there, which remote name corresponds to which
url etc. That is we can get a summary of remotes. Having that said, does
not it make sense to add the extra <list-objects-filter> here? Users
can easily understand which are promisor remotes ( along with their
filter type) and which are not. Of course, they can use git config for
that. But it would be a tidious job to check the the type of remotes
(i.e. which are promisor remotes and which are not) one by one. If the
user try to search for the promisor remotes in the config file, he/she
have to go through the other configuration settings (irrelevant to him/her
at that time) to reach the `[remote]` section. Isn't it?

> ...  If
> it makes sense to add the extra <list-objects-filtrer> information,
> that would mean that there are probably two remote nicknames that
> refer to the same URL (i.e. "remote -v" readers cannot tell them
> apart without extra information), but how likely is that, I wonder?

I think, having a proper documentation about the new changes is the
answer to it.


Thanks :)

  reply	other threads:[~2022-05-01 15:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30 13:19 [PATCH] builtin/remote.c: teach `-v` to list filters for promisor remotes Abhradeep Chakraborty via GitGitGadget
2022-04-30 21:17 ` Junio C Hamano
2022-05-01 15:57   ` Abhradeep Chakraborty [this message]
2022-05-01 16:14     ` Junio C Hamano
2022-05-01 19:38       ` Abhradeep Chakraborty
2022-05-02 10:33         ` Philip Oakley
2022-05-02 14:56           ` Abhradeep Chakraborty
2022-05-03 15:20 ` [PATCH v2] " Abhradeep Chakraborty via GitGitGadget
2022-05-04 17:10   ` Junio C Hamano
2022-05-05 14:12     ` Abhradeep Chakraborty
2022-05-07 14:20   ` [PATCH v3] " Abhradeep Chakraborty via GitGitGadget
2022-05-08 15:33     ` Philippe Blain
2022-05-09 16:29       ` Junio C Hamano
2022-05-09 16:45         ` Philippe Blain
2022-05-08 15:44     ` Philippe Blain
2022-05-09  9:13       ` Abhradeep Chakraborty
2022-05-09 11:32     ` [PATCH v4] " Abhradeep Chakraborty via GitGitGadget
2022-05-09 15:34       ` Taylor Blau
2022-05-09 17:01         ` Philippe Blain
2022-05-09 17:52           ` Junio C Hamano
2022-05-13 13:49             ` Abhradeep Chakraborty
2022-05-13 18:37               ` Junio C Hamano
2022-05-16 15:38                 ` Abhradeep Chakraborty
2022-05-09 17:21         ` Abhradeep Chakraborty
2022-05-09 22:22           ` Taylor Blau
2022-05-09 17:44         ` Abhradeep Chakraborty

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=20220501155725.93866-1-chakrabortyabhradeep79@gmail.com \
    --to=chakrabortyabhradeep79@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).