Re: [PATCH] builtin/remote.c: teach `-v` to list filters for promisor remotes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for the late response.

Junio C Hamano <gitster@xxxxxxxxx> 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 :)



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux