Re: [RFC/PATCH] git-fetch: mega-terse fetch output
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Oct 19, 2007, 08:21 UTC
- Message-ID
- <471868FC.20409@viscovery.net>
- In-Reply-To
- <20071019073938.GN14735@spearce.org>
Shawn O. Pearce schrieb:
Show 17 quoted lines
> $ git fetch jc > ... > ==> git://repo.or.cz/alt-git.git > * tag junio-gpg-pub ......................... (new) > * tag v1.5.0 .......................... (tag moved) > > $ git fetch me > ... > ==> git://repo.or.cz/git/spearce.git > * branch gitk -> spearce/gitk ............... (new) > * branch maint -> spearce/maint > * branch master -> spearce/master > * branch next -> spearce/next > * branch pu -> spearce/pu ......... (forced update) > * branch todo -> spearce/todo ............... (new) > > The width of the terminal is computed to produce the ... padding.
I like the wording of the status tags.
But the padding does not convince me. How does this look on very wide terminals? Maybe use 80 as a maximum?
Show 10 quoted lines
> + if (ws_cols) {
> + size_t n = strlen(status) + strlen(remote_name) + 2;
> + if (op)
> + n += 1 + strlen(op);
> + if (local_name)
> + n += 1 + strlen(local_name);
> + n = ws_cols - n - strlen(reason) - 4;
> + fputc(' ', stderr);
> + while (n--)
> + fputc('.', stderr);while (n-- > 0)
otherwise you're screwed if your terminal is too narrow.
> +static void determine_window_size(void)
> +{#ifdef TIOCGWINSZ
> + struct winsize ws; > + if (!ioctl(2, TIOCGWINSZ, &ws)) > + ws_cols = ws.ws_col;
#endif
> +}
Pretty please. We don't have TIOCGWINSZ on Windows.
-- Hannes