public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce•org>
To: Jeff King <peff@peff•net>
Cc: David Symonds <dsymonds@gmail•com>, git@vger•kernel.org
Subject: Re: [RFC/PATCH] git-fetch: mega-terse fetch output
Date: Fri, 19 Oct 2007 04:07:55 -0400	[thread overview]
Message-ID: <20071019080755.GO14735@spearce.org> (raw)
In-Reply-To: <20071019075725.GA29436@coredump.intra.peff.net>

Jeff King <peff@peff•net> wrote:
> On Fri, Oct 19, 2007 at 03:39:39AM -0400, Shawn O. Pearce wrote:
> 
> > What about this on top of Jeff's patch?
> > 
> > $ git fetch jc
> > ...
> > ==> git://repo.or.cz/alt-git.git
> >  * tag junio-gpg-pub ......................... (new)
> >  * tag v1.5.0 .......................... (tag moved)
> 
> Ugh. I strongly suspect that it would look ugly on anything bigger than
> about 80 columns, anyway. You are probably better off just not worrying
> about the terminal width, and always using an 80-ish column total. And
> then you don't have to worry about the ugly ioctl call.

Then you get linewrap on smaller terminals, and bigger ones don't
line up the right side.  *shrug*
 
> > +			show_update("* branch", note, "->", "FETCH_HEAD", NULL);
> 
> Hrm, btw, I can't seem to get this one to show (I was curious how ugly
> the FETCH_HEAD would look).

Yea, I can't easily see how to get this to generate.
 
> >  		if (verbose)
> > -			fprintf(stderr, " - %s == %s\n",
> > -				note, pretty_ref);
> > +			show_update("-", note, "==", pretty_ref, "unchanged");
> >  		return 0;
> 
> Also, I was unable to generate a test case that showed this one. Did
> you?

git fetch -v jc

> > +static void determine_window_size(void)
> > +{
> > +	struct winsize ws;
> > +	if (!ioctl(2, TIOCGWINSZ, &ws))
> > +		ws_cols = ws.ws_col;
> > +}
> > +
> 
> Ugh. How portable is this?

No clue.  It compiles fine here on Mac OS X and on Linux, but those
are both reasonably modern UNIX systems.  Older systems like Solaris
8 or an ancient OpenBSD might have an issue.  I suspect though that
this is a reasonably standard thing but its not in POSIX so uh,
probably a bad thing to do.

-- 
Shawn.

  reply	other threads:[~2007-10-19  8:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19  6:22 [RFC/PATCH] git-fetch: mega-terse fetch output Jeff King
2007-10-19  6:39 ` David Symonds
2007-10-19  6:46   ` Jeff King
2007-10-19  7:39   ` Shawn O. Pearce
2007-10-19  7:57     ` Jeff King
2007-10-19  8:07       ` Shawn O. Pearce [this message]
2007-10-19  8:11         ` Jeff King
     [not found]         ` <?= =?ISO-8859-1?Q?2007101=049081127.?= =?ISO-8859-1?Q?GA30168@coredump?= =?ISO-8859-1?Q?.intra.peff.net>
2007-10-19  8:19           ` David Kastrup
2007-10-19  8:39             ` Jeff King
2007-10-19  8:21     ` Johannes Sixt
2007-10-19 10:03     ` Santi Béjar
2007-10-19 11:38       ` Theodore Tso
2007-10-19 12:31         ` Johannes Sixt
2007-10-19 14:14           ` Nicolas Pitre
2007-10-19 14:31             ` Johannes Schindelin
2007-10-19 14:31             ` Santi Béjar
2007-10-19 14:40               ` Karl Hasselström
2007-10-19 14:40               ` Johannes Sixt
2007-10-19 14:54                 ` Nicolas Pitre
2007-10-19 14:41               ` Johannes Schindelin
2007-10-19 14:56                 ` Nicolas Pitre
2007-10-19 14:52               ` Nicolas Pitre
2007-10-20  5:00             ` Jeff King
2007-10-20  6:58               ` Shawn O. Pearce
2007-10-19 14:38         ` Karl Hasselström
2007-10-19 15:03           ` Nicolas Pitre
2007-10-19 21:17             ` Theodore Tso
2007-10-19 21:40               ` Nicolas Pitre
2007-10-19 21:58                 ` Theodore Tso
2007-10-19 13:15       ` Nicolas Pitre
2007-10-23  8:39         ` Miles Bader
2007-10-19 10:45     ` Andreas Ericsson
2007-10-19 10:51     ` Andreas Ericsson
2007-10-19 13:05     ` Nicolas Pitre
2007-10-19 15:50     ` Steven Grimm
2007-10-19 15:53       ` Steven Grimm
2007-10-19 16:12       ` Nicolas Pitre
2007-10-19 17:26         ` Sam Ravnborg
2007-10-19 18:51           ` Nicolas Pitre
2007-10-19 10:40 ` Andreas Ericsson

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071019080755.GO14735@spearce.org \
    --to=spearce@spearce$(echo .)org \
    --cc=dsymonds@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox