git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] remote: align columns on -v

From
Kirill Kolyshkin <kolyshkin@gmail.com>
Date
Feb 9, 2023, 01:11 UTC
Message-ID
<CAGmPdrxcb+ztx96=aF2+ok7DgOkEnZ+znSrG4D=AE_nQ57A17w@mail.gmail.com>
In-Reply-To
<xmqq5yccuo2s.fsf@gitster.g>
On Wed, Feb 8, 2023 at 8:19 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 33 quoted lines
>
> Kir Kolyshkin <kolyshkin@gmail.com> writes:
>
> > Currently, git remote -v produces a misaligned output when a remote name
> > is more than 8 characters long (i.e. longer than a tab step). Here's how
> > it looks like:
>
> The condition under which URLs do not align is not when they are
> more than 8 characters long.  If all of your remotes have
> 10-character names, their URLs would perfectly align, no?  The
> description may need to be tightened if we really wanted to do this.
>
> But I am skeptical, even without my devil's advocate hat on.
>
> > giuseppe      https://github.com/giuseppe/runc (fetch)
> > giuseppe      https://github.com/giuseppe/runc (push)
> > kir   git@github.com:kolyshkin/runc.git (fetch)
> > ...
>
> The current output allows programs to post-process by splitting each
> line with a tab, but this change will break such practice and force
> those who use such practice to do something different (like "split
> at the first run of whitespaces or tabs").
>
> > While at it, let's keep the \t in case some tools depend on it
> > for parsing (there will still be trailing spaces in the remote name).
>
> That will not help avoid breaking the behaviour for existing
> practice (they did not need to strip the whitespaces, but now they
> are forced to).  It only make the output uglier by putting mixture
> of whitespaces and tabs.
>
> So, I dunno.

Yes, I agree that this can break someone's scripts, and adding \t was not a bright idea either, as having it may hide the issue (of incorrect splitting) rather than break things entirely (and thus urging to fix it).

I assume that any decent script would split by "any whitespace", plus the output of git remote -v is mostly for the user's eyes, not scripts.

Please take a look at v2 which I am sending now.
Previous: Junio C HamanoNext: Kir Kolyshkin
Message 6 of 7 in “remote: align columns on -v”
  1. remote: align columns on -vKir Kolyshkin, Feb 7, 2023
  2. Torsten BögershausenFeb 8, 2023
  3. Junio C HamanoFeb 8, 2023
  4. Kirill KolyshkinFeb 9, 2023
  5. Junio C HamanoFeb 8, 2023
  6. Kirill KolyshkinFeb 9, 2023
  7. remote: align columns on -vKir Kolyshkin, Feb 9, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.